diff options
author | Yaxun Liu <Yaxun.Liu@amd.com> | 2018-08-29 20:39:22 +0000 |
---|---|---|
committer | Yaxun Liu <Yaxun.Liu@amd.com> | 2018-08-29 20:39:22 +0000 |
commit | 0e9a76dbe3b4beeb5d326070834f16826e0c74a1 (patch) | |
tree | 39557c6d1fcd4a3c37f3befa011befe49fa9aa4e /clang/lib/Frontend/InitPreprocessor.cpp | |
parent | 77c57200f8f7a20eb71fc1a286fe5593d5a01f6e (diff) | |
download | bcm5719-llvm-0e9a76dbe3b4beeb5d326070834f16826e0c74a1.tar.gz bcm5719-llvm-0e9a76dbe3b4beeb5d326070834f16826e0c74a1.zip |
Add predefined macro __gnu_linux__ for proper aux-triple
Clang predefine macro __linx__ for aux-triple with Linux OS
but does not predefine macro __gnu_linux__. This causes
some compilation error for certain applications, e.g. Eigen.
This patch fixes that.
Differential Revision: https://reviews.llvm.org/D51441
llvm-svn: 340967
Diffstat (limited to 'clang/lib/Frontend/InitPreprocessor.cpp')
-rw-r--r-- | clang/lib/Frontend/InitPreprocessor.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/clang/lib/Frontend/InitPreprocessor.cpp b/clang/lib/Frontend/InitPreprocessor.cpp index 01a74d12902..3a488bb8537 100644 --- a/clang/lib/Frontend/InitPreprocessor.cpp +++ b/clang/lib/Frontend/InitPreprocessor.cpp @@ -1128,6 +1128,7 @@ static void InitializePredefinedAuxMacros(const TargetInfo &AuxTI, if (AuxTriple.getOS() == llvm::Triple::Linux) { Builder.defineMacro("__ELF__"); Builder.defineMacro("__linux__"); + Builder.defineMacro("__gnu_linux__"); // Used in features.h. If this is omitted, math.h doesn't declare float // versions of the functions in bits/mathcalls.h. if (LangOpts.CPlusPlus) |