diff options
author | Michal Gorny <mgorny@gentoo.org> | 2017-08-26 21:35:11 +0000 |
---|---|---|
committer | Michal Gorny <mgorny@gentoo.org> | 2017-08-26 21:35:11 +0000 |
commit | 172645925291222d7b21c356c54dd08073afc424 (patch) | |
tree | d807e669bce4d1bb747aac4e9c10401dccf424e3 /clang/test/Driver/linux-ld.c | |
parent | a67e13129ddd05c6f8c06960dd134a7931d57002 (diff) | |
download | bcm5719-llvm-172645925291222d7b21c356c54dd08073afc424.tar.gz bcm5719-llvm-172645925291222d7b21c356c54dd08073afc424.zip |
[Driver] Use arch type to find compiler-rt libraries (on Linux)
Use llvm::Triple::getArchTypeName() when looking for compiler-rt
libraries, rather than the exact arch string from the triple. This is
more correct as it matches the values used when building compiler-rt
(builtin-config-ix.cmake) which are the subset of the values allowed
in triples.
For example, this fixes an issue when the compiler set for
i686-pc-linux-gnu triple would not find an i386 compiler-rt library,
while this is the exact arch that is detected by compiler-rt. The same
applies to any other i?86 variant allowed by LLVM.
This also makes the special case for MSVC unnecessary, since now i386
will be used reliably for all 32-bit x86 variants.
Differential Revision: https://reviews.llvm.org/D26796
llvm-svn: 311836
Diffstat (limited to 'clang/test/Driver/linux-ld.c')
-rw-r--r-- | clang/test/Driver/linux-ld.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/clang/test/Driver/linux-ld.c b/clang/test/Driver/linux-ld.c index 1c5f1a4556b..a47afe39240 100644 --- a/clang/test/Driver/linux-ld.c +++ b/clang/test/Driver/linux-ld.c @@ -71,6 +71,27 @@ // CHECK-LD-RT: libclang_rt.builtins-x86_64.a" // // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +// RUN: --target=i686-unknown-linux \ +// RUN: --gcc-toolchain="" \ +// RUN: --sysroot=%S/Inputs/basic_linux_tree \ +// RUN: --rtlib=compiler-rt \ +// RUN: | FileCheck --check-prefix=CHECK-LD-RT-I686 %s +// CHECK-LD-RT-I686-NOT: warning: +// CHECK-LD-RT-I686: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" +// CHECK-LD-RT-I686: "--eh-frame-hdr" +// CHECK-LD-RT-I686: "-m" "elf_i386" +// CHECK-LD-RT-I686: "-dynamic-linker" +// CHECK-LD-RT-I686: "{{.*}}/usr/lib/gcc/i686-unknown-linux/4.6.0{{/|\\\\}}crtbegin.o" +// CHECK-LD-RT-I686: "-L[[SYSROOT]]/usr/lib/gcc/i686-unknown-linux/4.6.0" +// CHECK-LD-RT-I686: "-L[[SYSROOT]]/usr/lib/gcc/i686-unknown-linux/4.6.0/../../../../i686-unknown-linux/lib" +// CHECK-LD-RT-I686: "-L[[SYSROOT]]/usr/lib/gcc/i686-unknown-linux/4.6.0/../../.." +// CHECK-LD-RT-I686: "-L[[SYSROOT]]/lib" +// CHECK-LD-RT-I686: "-L[[SYSROOT]]/usr/lib" +// CHECK-LD-RT-I686: libclang_rt.builtins-i386.a" +// CHECK-LD-RT-I686: "-lc" +// CHECK-LD-RT-I686: libclang_rt.builtins-i386.a" +// +// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ // RUN: --target=arm-linux-androideabi \ // RUN: --gcc-toolchain="" \ // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ |