[PATCH] Forward -u to the linker on gnutools toolchains
Reid Kleckner
rnk at google.com
Wed Jun 25 18:02:41 PDT 2014
Hi chandlerc, joerg,
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.
http://reviews.llvm.org/D4304
Files:
lib/Driver/Tools.cpp
test/Driver/linux-ld.c
Index: lib/Driver/Tools.cpp
===================================================================
--- lib/Driver/Tools.cpp
+++ lib/Driver/Tools.cpp
@@ -7158,6 +7158,7 @@
}
Args.AddAllArgs(CmdArgs, options::OPT_L);
+ Args.AddAllArgs(CmdArgs, options::OPT_u);
const ToolChain::path_list Paths = ToolChain.getFilePaths();
Index: test/Driver/linux-ld.c
===================================================================
--- test/Driver/linux-ld.c
+++ test/Driver/linux-ld.c
@@ -1119,3 +1119,9 @@
// 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"
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D4304.10871.patch
Type: text/x-patch
Size: 876 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140626/a6c8af67/attachment.bin>
More information about the cfe-commits
mailing list