summaryrefslogtreecommitdiffstats
path: root/test/Driver/fuse-ld.c
diff options
context:
space:
mode:
authorPeter Zotov <whitequark@whitequark.org>2016-03-09 05:18:16 +0000
committerPeter Zotov <whitequark@whitequark.org>2016-03-09 05:18:16 +0000
commit635bc7fefc12cc1333ba6ec77e563b7c8af01265 (patch)
tree6dee2cc4b74324c073206ebece6d83ae1f169b26 /test/Driver/fuse-ld.c
parent58eceded343b5503538761bb71db6d518be40f6b (diff)
Accept absolute paths in the -fuse-ld option.
This patch extends the -fuse-ld option to accept a full path to an executable and use it verbatim to invoke the linker. There are generally two reasons to desire this. The first reason relates to the sad truth is that Clang is retargetable, Binutils are not. While any Clang from a binary distribution is sufficient to compile code for a wide range of architectures and prefixed BFD linkers (e.g. installed as /usr/bin/arm-none-linux-gnueabi-ld) as well as cross-compiled libc's (for non-bare-metal targets) are widely available, including on all Debian derivatives, it is impossible to use them together because the -fuse-ld= option allows to specify neither a linker prefix nor a full path to one. The second reason is linker development, both when porting existing linkers to new architectures and when working on a new linker such as LLD. Differential Revision: http://reviews.llvm.org/D17952 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@262996 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Driver/fuse-ld.c')
-rw-r--r--test/Driver/fuse-ld.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/Driver/fuse-ld.c b/test/Driver/fuse-ld.c
index bd25b8deb3..ca89eb9971 100644
--- a/test/Driver/fuse-ld.c
+++ b/test/Driver/fuse-ld.c
@@ -1,4 +1,10 @@
// RUN: %clang %s -### \
+// RUN: -fuse-ld=/usr/local/bin/or1k-linux-ld 2>&1 \
+// RUN: | FileCheck %s --check-prefix=CHECK-ABSOLUTE-LD
+// CHECK-ABSOLUTE-LD: /usr/local/bin/or1k-linux-ld
+
+
+// RUN: %clang %s -### \
// RUN: -target x86_64-unknown-freebsd 2>&1 \
// RUN: | FileCheck %s --check-prefix=CHECK-FREEBSD-LD
// CHECK-FREEBSD-LD: ld