llvm/clang-gcc-compat.patch
Evgenii Shatokhin 9b14190aa4 Updated to version 3.9.0
Most of the work was done in
https://abf.io/import/llvm/pull_requests/2

I have reworked clang-mandriva.patch to keeps it (as clang-rosa.patch).
It seems, it did not actually detect ROSA in the past (it checked that
/etc/lsb-release has DISTRIB_ID=Mandriva<...> while we have "Rosa<...>"
there). However, it could be useful to align the default Clang flags
with Ubuntu, Fedora and such.
2016-09-11 17:18:35 +03:00

73 lines
3.4 KiB
Diff

--- llvm-3.5/tools/clang/lib/Driver/Driver.cpp.gcc49~ 2014-08-22 22:54:39.000000000 +0200
+++ llvm-3.5/tools/clang/lib/Driver/Driver.cpp 2014-08-25 22:24:57.688608644 +0200
@@ -910,7 +910,7 @@
// If we want to return a more correct answer some day, then we should
// introduce a non-pedantically GCC compatible mode to Clang in which we
// provide sensible definitions for -dumpversion, __VERSION__, etc.
- llvm::outs() << "4.2.1\n";
+ llvm::outs() << "4.9.1\n";
return false;
}
--- llvm-3.5/tools/clang/lib/Frontend/InitPreprocessor.cpp.gcc49~ 2014-08-22 22:54:39.000000000 +0200
+++ llvm-3.5/tools/clang/lib/Frontend/InitPreprocessor.cpp 2014-08-25 22:24:57.689608632 +0200
@@ -522,9 +522,9 @@
#undef TOSTR
#undef TOSTR2
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 4.9.1, but only if we're
// not compiling for MSVC compatibility
- Builder.defineMacro("__GNUC_MINOR__", "2");
+ Builder.defineMacro("__GNUC_MINOR__", "9");
Builder.defineMacro("__GNUC_PATCHLEVEL__", "1");
Builder.defineMacro("__GNUC__", "4");
Builder.defineMacro("__GXX_ABI_VERSION", "1002");
@@ -542,9 +542,9 @@
Builder.defineMacro("__PRAGMA_REDEFINE_EXTNAME", "1");
// As sad as it is, enough software depends on the __VERSION__ for version
- // checks that it is necessary to report 4.2.1 (the base GCC version we claim
+ // checks that it is necessary to report 4.9.1 (the base GCC version we claim
// compatibility with) first.
- Builder.defineMacro("__VERSION__", "\"4.2.1 Compatible " +
+ Builder.defineMacro("__VERSION__", "\"4.9.1 Compatible " +
Twine(getClangFullCPPVersion()) + "\"");
// Initialize language-specific preprocessor defines.
--- llvm-3.5/tools/clang/test/Driver/immediate-options.c.gcc49~ 2014-08-22 22:54:39.000000000 +0200
+++ llvm-3.5/tools/clang/test/Driver/immediate-options.c 2014-08-25 22:24:57.690608619 +0200
@@ -7,7 +7,7 @@
// HELP-HIDDEN: driver-mode
// RUN: %clang -dumpversion | FileCheck %s -check-prefix=DUMPVERSION
-// DUMPVERSION: 4.2.1
+// DUMPVERSION: 4.9.1
// RUN: %clang -print-search-dirs | FileCheck %s -check-prefix=PRINT-SEARCH-DIRS
// PRINT-SEARCH-DIRS: programs: ={{.*}}
--- llvm-3.5/tools/clang/test/Preprocessor/init.c.gcc49~ 2014-08-25 22:24:57.691608607 +0200
+++ llvm-3.5/tools/clang/test/Preprocessor/init.c 2014-08-25 22:25:27.754232772 +0200
@@ -7025,7 +7025,7 @@
// SPARC:#define __UINT_LEAST8_MAX__ 255
// SPARC:#define __UINT_LEAST8_TYPE__ unsigned char
// SPARC:#define __USER_LABEL_PREFIX__
-// SPARC:#define __VERSION__ "4.2.1 Compatible{{.*}}
+// SPARC:#define __VERSION__ "4.9.1 Compatible{{.*}}
// SPARC:#define __WCHAR_MAX__ 2147483647
// SPARC:#define __WCHAR_TYPE__ int
// SPARC:#define __WCHAR_WIDTH__ 32
--- llvm-3.6.0.src/include/llvm/Support/Compiler.h.omv~ 2014-10-28 18:09:47.260731249 +0100
+++ llvm-3.6.0.src/include/llvm/Support/Compiler.h 2014-10-28 18:09:59.930572854 +0100
@@ -288,7 +288,7 @@
/// \macro LLVM_ASSUME_ALIGNED
/// \brief Returns a pointer with an assumed alignment.
-#if __has_builtin(__builtin_assume_aligned) || LLVM_GNUC_PREREQ(4, 7, 0)
+#if __has_builtin(__builtin_assume_aligned) || (!defined(__clang__) && LLVM_GNUC_PREREQ(4, 7, 0))
# define LLVM_ASSUME_ALIGNED(p, a) __builtin_assume_aligned(p, a)
#elif defined(LLVM_BUILTIN_UNREACHABLE)
// As of today, clang does not support __builtin_assume_aligned.