Skip to content

Commit

Permalink
Forward -u to the linker on gnutools toolchains
Browse files Browse the repository at this point in the history
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

llvm-svn: 211756
  • Loading branch information
rnk committed Jun 26, 2014
1 parent 157a8f9 commit 6907144
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions clang/lib/Driver/Tools.cpp
Expand Up @@ -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();

Expand Down
6 changes: 6 additions & 0 deletions clang/test/Driver/linux-ld.c
Expand Up @@ -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"

0 comments on commit 6907144

Please sign in to comment.