r228402 - [PowerPC] Re-disable linker optimizations for now
Bill Schmidt
wschmidt at linux.vnet.ibm.com
Fri Feb 6 07:31:03 PST 2015
Author: wschmidt
Date: Fri Feb 6 09:31:03 2015
New Revision: 228402
URL: http://llvm.org/viewvc/llvm-project?rev=228402&view=rev
Log:
[PowerPC] Re-disable linker optimizations for now
Modified:
cfe/trunk/lib/Driver/Tools.cpp
cfe/trunk/test/Driver/ppc-features.cpp
Modified: cfe/trunk/lib/Driver/Tools.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=228402&r1=228401&r2=228402&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Tools.cpp (original)
+++ cfe/trunk/lib/Driver/Tools.cpp Fri Feb 6 09:31:03 2015
@@ -7625,6 +7625,13 @@ void gnutools::Link::ConstructJob(Compil
D.DyldPrefix + getLinuxDynamicLinker(Args, ToolChain)));
}
+ // Work around a bug in GNU ld (and gold) linker versions up to 2.25
+ // that may mis-optimize code generated by this version of clang/LLVM
+ // to access general-dynamic or local-dynamic TLS variables.
+ if (ToolChain.getArch() == llvm::Triple::ppc64 ||
+ ToolChain.getArch() == llvm::Triple::ppc64le)
+ CmdArgs.push_back("--no-tls-optimize");
+
CmdArgs.push_back("-o");
CmdArgs.push_back(Output.getFilename());
Modified: cfe/trunk/test/Driver/ppc-features.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/ppc-features.cpp?rev=228402&r1=228401&r2=228402&view=diff
==============================================================================
--- cfe/trunk/test/Driver/ppc-features.cpp (original)
+++ cfe/trunk/test/Driver/ppc-features.cpp Fri Feb 6 09:31:03 2015
@@ -132,8 +132,10 @@
// linker features
// RUN: %clang -target powerpc64-unknown-linux-gnu %s -### -o %t.o 2>&1 | FileCheck -check-prefix=CHECK_BE_LD_ARGS %s
// CHECK_BE_LD_ARGS: "elf64ppc"
+// CHECK_BE_LD_ARGS: "--no-tls-optimize"
// RUN: %clang -target powerpc64le-unknown-linux-gnu %s -### -o %t.o 2>&1 | FileCheck -check-prefix=CHECK_LE_LD_ARGS %s
// CHECK_LE_LD_ARGS: "elf64lppc"
+// CHECK_LE_LD_ARGS: "--no-tls-optimize"
More information about the cfe-commits
mailing list