[PATCH] D51011: [Preprocessor] raise gcc compatibility macros.

Nick Desaulniers via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 20 16:19:51 PDT 2018


nickdesaulniers created this revision.
nickdesaulniers added a reviewer: aaron.ballman.
Herald added a subscriber: cfe-commits.

Building the Linux kernel with clang is now broken as of commit
cafa0010cd51 ("Raise the minimum required gcc version to 4.6").

We were getting lucky that Clang previously declared compatibility with
gcc 4.2.1 as the kernel only errored out for gcc < 3.2. The compiler
check in the kernel should be improved as well.


Repository:
  rC Clang

https://reviews.llvm.org/D51011

Files:
  lib/Frontend/InitPreprocessor.cpp


Index: lib/Frontend/InitPreprocessor.cpp
===================================================================
--- lib/Frontend/InitPreprocessor.cpp
+++ lib/Frontend/InitPreprocessor.cpp
@@ -587,12 +587,12 @@
                       "\"" CLANG_VERSION_STRING " "
                       + getClangFullRepositoryVersion() + "\"");
   if (!LangOpts.MSVCCompat) {
-    // Currently claim to be compatible with GCC 4.2.1-5621, but only if we're
+    // Currently claim to be compatible with GCC 8.2, but only if we're
     // not compiling for MSVC compatibility
     Builder.defineMacro("__GNUC_MINOR__", "2");
-    Builder.defineMacro("__GNUC_PATCHLEVEL__", "1");
-    Builder.defineMacro("__GNUC__", "4");
-    Builder.defineMacro("__GXX_ABI_VERSION", "1002");
+    Builder.defineMacro("__GNUC_PATCHLEVEL__", "0");
+    Builder.defineMacro("__GNUC__", "8");
+    Builder.defineMacro("__GXX_ABI_VERSION", "1013");
   }
 
   // Define macros for the C11 / C++11 memory orderings


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D51011.161613.patch
Type: text/x-patch
Size: 972 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180820/ec86e9c4/attachment.bin>


More information about the cfe-commits mailing list