summaryrefslogtreecommitdiffstats
path: root/clang/test/Driver/linux-ld.c
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2011-10-03 06:41:08 +0000
committerChandler Carruth <chandlerc@gmail.com>2011-10-03 06:41:08 +0000
commit2a649c7a42ba4218a11c67cb945d7b3ff98b0567 (patch)
tree3a28f8824672bed6cfb5df8d58b7056e76ad6844 /clang/test/Driver/linux-ld.c
parentb8c3aaf479394516454c8ca617ca9cb6377130d2 (diff)
downloadbcm5719-llvm-2a649c7a42ba4218a11c67cb945d7b3ff98b0567.tar.gz
bcm5719-llvm-2a649c7a42ba4218a11c67cb945d7b3ff98b0567.zip
Add initial support for applying the sysroot to library search paths.
This is still very much a WIP, but sysroot was completely broken before this so we are moving closer to correctness. The crux of this is that 'ld' (on Linux, the only place I'm touching here) doesn't apply the sysroot to any flags given to it. Instead, the driver must translate all the paths it adds to the link step with the system root. This is easily observed by building a GCC that supports sysroot, and checking its driver output. This patch just fixes the non-multilib library search paths. We should also use this in many other places, but first things first. This also allows us to make the Linux 'ld' test independent of the host system. This in turn will allow me to check in test tree configurations based on various different distro's configuration. Again, WIP. llvm-svn: 140990
Diffstat (limited to 'clang/test/Driver/linux-ld.c')
-rw-r--r--clang/test/Driver/linux-ld.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/clang/test/Driver/linux-ld.c b/clang/test/Driver/linux-ld.c
index 745b03c7a6a..8896afc5e8c 100644
--- a/clang/test/Driver/linux-ld.c
+++ b/clang/test/Driver/linux-ld.c
@@ -1,9 +1,16 @@
-// General tests that ld invocations on Linux targets sane.
+// General tests that ld invocations on Linux targets sane. Note that we use
+// sysroot to make these tests independent of the host system.
//
-// RUN: %clang -no-canonical-prefixes -ccc-host-triple i386-unknown-linux %s -### -o %t.o 2>&1 \
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: -ccc-host-triple i386-unkown-linux \
+// RUN: --sysroot=%S/Inputs/basic_linux_tree \
// RUN: | FileCheck --check-prefix=CHECK-LD-32 %s
-// CHECK-LD-32: "{{.*}}ld{{(.exe)?}}" {{.*}} "-L/lib" "-L/usr/lib"
+// CHECK-LD-32: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
+// CHECK-LD-32: {{.*}} "-L[[SYSROOT]]/lib" "-L[[SYSROOT]]/usr/lib"
//
-// RUN: %clang -no-canonical-prefixes -ccc-host-triple x86_64-unknown-linux %s -### -o %t.o 2>&1 \
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: -ccc-host-triple x86_64-unknown-linux \
+// RUN: --sysroot=%S/Inputs/basic_linux_tree \
// RUN: | FileCheck --check-prefix=CHECK-LD-64 %s
-// CHECK-LD-64: "{{.*}}ld{{(.exe)?}}" {{.*}} "-L/lib" "-L/usr/lib"
+// CHECK-LD-64: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
+// CHECK-LD-64: {{.*}} "-L[[SYSROOT]]/lib" "-L[[SYSROOT]]/usr/lib"
OpenPOWER on IntegriCloud