New commits:
commit c37a43705114edab0b179ddb79e1f3f4bf101984
Author: Pavel Vinogradov <public AT sourcemage.org>
Commit: Pavel Vinogradov <public AT sourcemage.org>
-@@ -837,17 +837,17 @@ tools::ParsePICArgs(const ToolChain &Too
+@@ -926,7 +926,7 @@
+
+ // AMDGPU-specific defaults for PIC.
+ if (Triple.getArch() == llvm::Triple::amdgcn)
+- PIC = true;
++ pic = true;
+
+ // The last argument relating to either PIC or PIE wins, and no
+ // other argument is used. If the last argument is any flavor of the
+@@ -955,17 +955,17 @@
if (O.matches(options::OPT_fPIC) || O.matches(options::OPT_fpic) ||
O.matches(options::OPT_fPIE) || O.matches(options::OPT_fpie)) {
PIE = O.matches(options::OPT_fPIE) || O.matches(options::OPT_fpie);
@@ -57,7 +66,7 @@ diff -Naupr
llvm-5.0.1.src/tools/clang/lib/Driver/ToolChains/CommonArgs.cpp llvm
ToolChain.getDriver().Diag(diag::warn_drv_ps4_force_pic)
<< LastPICArg->getSpelling();
}
-@@ -859,7 +859,7 @@ tools::ParsePICArgs(const ToolChain &Too
+@@ -977,7 +977,7 @@
// Introduce a Darwin and PS4-specific hack. If the default is PIC, but
the
// PIC level would've been set to level 1, force it back to level 2 PIC
// instead.
@@ -66,7 +75,7 @@ diff -Naupr
llvm-5.0.1.src/tools/clang/lib/Driver/ToolChains/CommonArgs.cpp llvm
IsPICLevelTwo |= ToolChain.isPICDefault();
// This kernel flags are a trump-card: they will disable PIC/PIE
-@@ -867,7 +867,7 @@ tools::ParsePICArgs(const ToolChain &Too
+@@ -985,7 +985,7 @@
if (KernelOrKext &&
((!EffectiveTriple.isiOS() || EffectiveTriple.isOSVersionLT(6)) &&
!EffectiveTriple.isWatchOS()))
@@ -75,7 +84,7 @@ diff -Naupr
llvm-5.0.1.src/tools/clang/lib/Driver/ToolChains/CommonArgs.cpp llvm
if (Arg *A = Args.getLastArg(options::OPT_mdynamic_no_pic)) {
// This is a very special mode. It trumps the other modes, almost no one
-@@ -881,9 +881,9 @@ tools::ParsePICArgs(const ToolChain &Too
+@@ -999,9 +999,9 @@
// Only a forced PIC mode can cause the actual compile to have PIC
defines
// etc., no flags are sufficient. This behavior was selected to closely
// match that of llvm-gcc and Apple GCC before that.
@@ -87,25 +96,26 @@ diff -Naupr
llvm-5.0.1.src/tools/clang/lib/Driver/ToolChains/CommonArgs.cpp llvm
}
bool EmbeddedPISupported;
-@@ -916,7 +916,7 @@ tools::ParsePICArgs(const ToolChain &Too
+@@ -1045,7 +1045,7 @@
+ // when the -mno-abicalls option is used. In that case we exit
+ // at next check regardless of PIC being set below.
+ if (ABIName == "n64")
+- PIC = true;
++ pic = true;
+ // When targettng MIPS with -mno-abicalls, it's always static.
+ if(Args.hasArg(options::OPT_mno_abicalls))
+ return std::make_tuple(llvm::Reloc::Static, 0U, false);
+@@ -1054,7 +1054,7 @@
+ IsPICLevelTwo = false;
}
- // ROPI and RWPI are not comaptible with PIC or PIE.
-- if ((ROPI || RWPI) && (PIC || PIE))
-+ if ((ROPI || RWPI) && (pic || PIE))
-
ToolChain.getDriver().Diag(diag::err_drv_ropi_rwpi_incompatible_with_pic);
-
- // When targettng MIPS64 with N64, the default is PIC, unless
-mno-abicalls is
-@@ -926,7 +926,7 @@ tools::ParsePICArgs(const ToolChain &Too
- Args.hasArg(options::OPT_mno_abicalls))
- return std::make_tuple(llvm::Reloc::Static, 0U, false);
-
- if (PIC)
+ if (pic)
return std::make_tuple(llvm::Reloc::PIC_, IsPICLevelTwo ? 2U : 1U, PIE);