]> granicus.if.org Git - clang/commitdiff
Forward -u to the linker on gnutools toolchains
authorReid Kleckner <reid@kleckner.net>
Thu, 26 Jun 2014 01:08:54 +0000 (01:08 +0000)
committerReid Kleckner <reid@kleckner.net>
Thu, 26 Jun 2014 01:08:54 +0000 (01:08 +0000)
Summary:
The BSDs and Darwin all forward the whole 'u' group, but gcc only
forwards -u so far as I can tell.  I only forward -u, since that's a
minimal change, and many people object to magically recognizing and
forwarding linker arguments.

Reviewers: chandlerc, joerg

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D4304

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@211756 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Driver/Tools.cpp
test/Driver/linux-ld.c

index f652fadf0f32c3d47b1d2d3cfa3fbde7915ac106..1f89d39f0dab5ab12ebec19df5398247e8f69df4 100644 (file)
@@ -7158,6 +7158,7 @@ void gnutools::Link::ConstructJob(Compilation &C, const JobAction &JA,
   }
 
   Args.AddAllArgs(CmdArgs, options::OPT_L);
+  Args.AddAllArgs(CmdArgs, options::OPT_u);
 
   const ToolChain::path_list Paths = ToolChain.getFilePaths();
 
index c476ec24f99058ea90cd45f54ea69b4585dc73f7..6cc143f2c2bb5bab0b405a6f39621f04d9720ee2 100644 (file)
 // RUN:        --sysroot=%S/Inputs/basic_linux_tree 2>& 1 \
 // RUN:   | FileCheck --check-prefix=CHECK-PG %s
 // CHECK-PG: gcrt1.o
+
+// GCC forwards -u to the linker.
+// RUN: %clang -u asdf --target=x86_64-unknown-linux -### %s \
+// RUN:        --sysroot=%S/Inputs/basic_linux_tree 2>& 1 \
+// RUN:   | FileCheck --check-prefix=CHECK-u %s
+// CHECK-u: "-u" "asdf"