Add -fgnuc-version to ClangModuleCompilationOptions on Darwin.
authorAdrian Prantl <aprantl@apple.com>
Fri, 11 Oct 2019 19:54:09 +0000 (19:54 +0000)
committerAdrian Prantl <aprantl@apple.com>
Fri, 11 Oct 2019 19:54:09 +0000 (19:54 +0000)
This adapts LLDB for https://reviews.llvm.org/D68055.

Darwin's libC headers expect the GNUC macro to be set.

llvm-svn: 374585

lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp

index e497424..241f9eb 100644 (file)
@@ -1506,7 +1506,8 @@ void PlatformDarwin::AddClangModuleCompilationOptionsForSDKType(
     Target *target, std::vector<std::string> &options, SDKType sdk_type) {
   const std::vector<std::string> apple_arguments = {
       "-x",       "objective-c++", "-fobjc-arc",
-      "-fblocks", "-D_ISO646_H",   "-D__ISO646_H"};
+      "-fblocks", "-D_ISO646_H",   "-D__ISO646_H",
+      "-fgnuc-version=4.2.1"};
 
   options.insert(options.end(), apple_arguments.begin(), apple_arguments.end());