aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2021-10-01 19:43:21 +0000
committerDimitry Andric <dim@FreeBSD.org>2021-12-25 11:51:38 +0000
commitc0c181405379add206c7db9e50bad4ed61cb549c (patch)
treec6ad2abfb1621009fb7aa7880fd0088fcb8c1332
parent838e2fa19531c45727938a9160cdd78ecedf8c92 (diff)
downloadsrc-c0c181405379add206c7db9e50bad4ed61cb549c.tar.gz
src-c0c181405379add206c7db9e50bad4ed61cb549c.zip
Stop clang 13 from defining conflicting macros on PowerPC
Merge commit c9539f957f57 from llvm git (by Nemanja Ivanovic): [PowerPC] Define XL-compatible macros only for AIX and Linux Since XLC only ever shipped on PowerPC AIX and Linux, it is not reasonable to provide the compatibility macros on any target other than those two. This patch restricts those macros to AIX/Linux. Differential revision: https://reviews.llvm.org/D110213 PR: 258209 (cherry picked from commit 39dadd0628cd1f28be39a3ab35969545b7401623)
-rw-r--r--contrib/llvm-project/clang/lib/Basic/Targets/PPC.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/contrib/llvm-project/clang/lib/Basic/Targets/PPC.cpp b/contrib/llvm-project/clang/lib/Basic/Targets/PPC.cpp
index 59656888e25f..ecfbe284fb2e 100644
--- a/contrib/llvm-project/clang/lib/Basic/Targets/PPC.cpp
+++ b/contrib/llvm-project/clang/lib/Basic/Targets/PPC.cpp
@@ -243,7 +243,10 @@ static void defineXLCompatMacros(MacroBuilder &Builder) {
void PPCTargetInfo::getTargetDefines(const LangOptions &Opts,
MacroBuilder &Builder) const {
- defineXLCompatMacros(Builder);
+ // We define the XLC compatibility macros only on AIX and Linux since XLC
+ // was never available on any other platforms.
+ if (getTriple().isOSAIX() || getTriple().isOSLinux())
+ defineXLCompatMacros(Builder);
// Target identification.
Builder.defineMacro("__ppc__");