Skip to content

Commit

Permalink
Revert r311836 - [Driver] Use arch type to find compiler-rt libraries…
Browse files Browse the repository at this point in the history
… (on Linux)

This causes a breakage on the Android build bot. Let's revert it until
we figure out the correct solution there.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@311861 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
mgorny committed Aug 27, 2017
1 parent 2018de5 commit 4f648cc
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 32 deletions.
5 changes: 4 additions & 1 deletion lib/Driver/ToolChain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -297,12 +297,15 @@ static StringRef getArchNameForCompilerRTLib(const ToolChain &TC,
const llvm::Triple &Triple = TC.getTriple();
bool IsWindows = Triple.isOSWindows();

if (Triple.isWindowsMSVCEnvironment() && TC.getArch() == llvm::Triple::x86)
return "i386";

if (TC.getArch() == llvm::Triple::arm || TC.getArch() == llvm::Triple::armeb)
return (arm::getARMFloatABI(TC, Args) == arm::FloatABI::Hard && !IsWindows)
? "armhf"
: "arm";

return llvm::Triple::getArchTypeName(TC.getArch());
return TC.getArchName();
}

std::string ToolChain::getCompilerRTPath() const {
Expand Down
Empty file.
Empty file.
21 changes: 0 additions & 21 deletions test/Driver/linux-ld.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,27 +71,6 @@
// 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 \
Expand Down
2 changes: 1 addition & 1 deletion test/Driver/nostdlib.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@
//
// CHECK-LINUX-NOSTDLIB: warning: argument unused during compilation: '--rtlib=compiler-rt'
// CHECK-LINUX-NOSTDLIB: "{{(.*[^.0-9A-Z_a-z])?}}ld{{(.exe)?}}"
// CHECK-LINUX-NOSTDLIB-NOT: "{{.*}}/Inputs/resource_dir{{/|\\\\}}lib{{/|\\\\}}linux{{/|\\\\}}libclang_rt.builtins-i386.a"
// CHECK-LINUX-NOSTDLIB-NOT: "{{.*}}/Inputs/resource_dir{{/|\\\\}}lib{{/|\\\\}}linux{{/|\\\\}}libclang_rt.builtins-i686.a"
// CHECK-MSVC-NOSTDLIB: warning: argument unused during compilation: '--rtlib=compiler-rt'
10 changes: 2 additions & 8 deletions test/Driver/print-libgcc-file-name-clangrt.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,10 @@
// RUN: | FileCheck --check-prefix=CHECK-CLANGRT-X8664 %s
// CHECK-CLANGRT-X8664: libclang_rt.builtins-x86_64.a

// RUN: %clang -rtlib=compiler-rt -print-libgcc-file-name 2>&1 \
// RUN: --target=i386-pc-linux \
// RUN: | FileCheck --check-prefix=CHECK-CLANGRT-I386 %s
// CHECK-CLANGRT-I386: libclang_rt.builtins-i386.a

// Check whether alternate arch values map to the correct library.
//
// RUN: %clang -rtlib=compiler-rt -print-libgcc-file-name 2>&1 \
// RUN: --target=i686-pc-linux \
// RUN: | FileCheck --check-prefix=CHECK-CLANGRT-I386 %s
// RUN: | FileCheck --check-prefix=CHECK-CLANGRT-I686 %s
// CHECK-CLANGRT-I686: libclang_rt.builtins-i686.a

// RUN: %clang -rtlib=compiler-rt -print-libgcc-file-name 2>&1 \
// RUN: --target=arm-linux-gnueabi \
Expand Down
2 changes: 1 addition & 1 deletion test/Driver/windows-cross.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
// RUN: | FileCheck %s --check-prefix CHECK-SANITIZE-ADDRESS-EXE-X86

// CHECK-SANITIZE-ADDRESS-EXE-X86: "-fsanitize=address"
// CHECK-SANITIZE-ADDRESS-EXE-X86: "{{.*}}clang_rt.asan_dynamic-i386.lib" "{{.*}}clang_rt.asan_dynamic_runtime_thunk-i386.lib" "--undefined" "___asan_seh_interceptor"
// CHECK-SANITIZE-ADDRESS-EXE-X86: "{{.*}}clang_rt.asan_dynamic-i686.lib" "{{.*}}clang_rt.asan_dynamic_runtime_thunk-i686.lib" "--undefined" "___asan_seh_interceptor"

// RUN: %clang -### -target armv7-windows-itanium --sysroot %S/Inputs/Windows/ARM/8.1 -B %S/Inputs/Windows/ARM/8.1/usr/bin -fuse-ld=lld-link2 -shared -o shared.dll -fsanitize=tsan -x c++ %s 2>&1 \
// RUN: | FileCheck %s --check-prefix CHECK-SANITIZE-TSAN
Expand Down

0 comments on commit 4f648cc

Please sign in to comment.