r228253 - [PowerPC] Revert workaround for TLS linker bug

Bill Schmidt wschmidt at linux.vnet.ibm.com
Wed Feb 4 17:12:24 PST 2015


Author: wschmidt
Date: Wed Feb  4 19:12:24 2015
New Revision: 228253

URL: http://llvm.org/viewvc/llvm-project?rev=228253&view=rev
Log:
[PowerPC] Revert workaround for TLS linker bug

In r227480, Ulrich Weigand introduced a workaround for a linker
optimization bug that can create mis-optimized code for accesses to
general-dynamic or local-dynamic TLS variables.  The linker
optimization bug only occurred for Clang/LLVM because of some
inefficient code being generated for these TLS accesses.  I have
recently corrected LLVM to produce the efficient code sequence
expected by the linkers, so this workaround is no longer needed.
Therefore this patch reverts r227480.

I've tested that the previous bootstrap failure no longer occurs with
the workaround reverted.

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=228253&r1=228252&r2=228253&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Tools.cpp (original)
+++ cfe/trunk/lib/Driver/Tools.cpp Wed Feb  4 19:12:24 2015
@@ -7625,13 +7625,6 @@ 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=228253&r1=228252&r2=228253&view=diff
==============================================================================
--- cfe/trunk/test/Driver/ppc-features.cpp (original)
+++ cfe/trunk/test/Driver/ppc-features.cpp Wed Feb  4 19:12:24 2015
@@ -132,10 +132,8 @@
 // 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