[PATCH] D25686: [Driver] Improve support for Gentoo arm*-hardfloat-*-*eabi triples
Michał Górny via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Dec 2 12:08:55 PST 2016
mgorny retitled this revision from "[Driver] Support "hardfloat" vendor triples used by Gentoo" to "[Driver] Improve support for Gentoo arm*-hardfloat-*-*eabi triples".
mgorny updated the summary for this revision.
mgorny added a reviewer: atanasyan.
mgorny updated this revision to Diff 80118.
https://reviews.llvm.org/D25686
Files:
lib/Driver/ToolChains.cpp
test/Driver/Inputs/gentoo_linux_gcc_armhf_tree/usr/armv7a-hardfloat-linux-gnueabi/lib/.keep
test/Driver/Inputs/gentoo_linux_gcc_armhf_tree/usr/include/.keep
test/Driver/Inputs/gentoo_linux_gcc_armhf_tree/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.9.3/crtbegin.o
test/Driver/Inputs/gentoo_linux_gcc_armhf_tree/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.9.3/include/g++-v4.9.3/.keep
test/Driver/linux-ld.c
Index: test/Driver/linux-ld.c
===================================================================
--- test/Driver/linux-ld.c
+++ test/Driver/linux-ld.c
@@ -1002,6 +1002,32 @@
// CHECK-DEBIAN-SPARC64: "[[SYSROOT]]/usr/lib/gcc/sparc64-linux-gnu/4.9{{/|\\\\}}crtend.o"
// CHECK-DEBIAN-SPARC64: "[[SYSROOT]]/usr/lib/gcc/sparc64-linux-gnu/4.9/../../../sparc64-linux-gnu{{/|\\\\}}crtn.o"
//
+// Check Gentoo Linux with GCC installed using arm*-hardfloat-linux-gnu* triples.
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: --target=armv7a-hardfloat-linux-gnueabi --rtlib=platform \
+// RUN: --gcc-toolchain="" \
+// RUN: --sysroot=%S/Inputs/gentoo_linux_gcc_armhf_tree \
+// RUN: | FileCheck --check-prefix=CHECK-LD-GENTOO-ARMHF %s
+// CHECK-LD-GENTOO-ARMHF-NOT: warning:
+// CHECK-LD-GENTOO-ARMHF: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
+// CHECK-LD-GENTOO-ARMHF: "--eh-frame-hdr"
+// CHECK-LD-GENTOO-ARMHF: "-m" "armelf_linux_eabi"
+// CHECK-LD-GENTOO-ARMHF: "-dynamic-linker" "/lib/ld-linux-armhf.so.3"
+// CHECK-LD-GENTOO-ARMHF: "{{.*}}/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.9.3/crtbegin.o"
+// CHECK-LD-GENTOO-ARMHF: "-L[[SYSROOT]]/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.9.3"
+// CHECK-LD-GENTOO-ARMHF: "-L[[SYSROOT]]/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.9.3/../../../../armv7a-hardfloat-linux-gnueabi/lib"
+// CHECK-LD-GENTOO-ARMHF: "-L[[SYSROOT]]/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.9.3/../../.."
+// CHECK-LD-GENTOO-ARMHF: "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed"
+// CHECK-LD-GENTOO-ARMHF: "-lc"
+// CHECK-LD-GENTOO-ARMHF: "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed"
+//
+// Check whether the standard ARM triples can find Gentoo gcc.
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: --target=armv7a-unknown-linux-gnueabihf --rtlib=platform \
+// RUN: --gcc-toolchain="" \
+// RUN: --sysroot=%S/Inputs/gentoo_linux_gcc_armhf_tree \
+// RUN: | FileCheck --check-prefix=CHECK-LD-GENTOO-ARMHF %s
+//
// Test linker invocation on Android.
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: --target=arm-linux-androideabi -rtlib=platform \
Index: lib/Driver/ToolChains.cpp
===================================================================
--- lib/Driver/ToolChains.cpp
+++ lib/Driver/ToolChains.cpp
@@ -1557,14 +1557,21 @@
static const char *const ARMLibDirs[] = {"/lib"};
static const char *const ARMTriples[] = {"arm-linux-gnueabi",
"arm-linux-androideabi"};
+ // arm*-hardfloat-* triples are used by Gentoo
static const char *const ARMHFTriples[] = {"arm-linux-gnueabihf",
+ "armv6j-hardfloat-linux-gnueabi",
+ "armv7a-hardfloat-linux-gnueabi",
"armv7hl-redhat-linux-gnueabi"};
static const char *const ARMebLibDirs[] = {"/lib"};
static const char *const ARMebTriples[] = {"armeb-linux-gnueabi",
"armeb-linux-androideabi"};
static const char *const ARMebHFTriples[] = {
"armeb-linux-gnueabihf", "armebv7hl-redhat-linux-gnueabi"};
+ static const char *const ARMHFMuslTriples[] = {
+ "armv6j-hardfloat-linux-musleabi",
+ "armv7a-hardfloat-linux-musleabi"};
+
static const char *const X86_64LibDirs[] = {"/lib64", "/lib"};
static const char *const X86_64Triples[] = {
"x86_64-linux-gnu", "x86_64-unknown-linux-gnu",
@@ -1664,6 +1671,8 @@
LibDirs.append(begin(ARMLibDirs), end(ARMLibDirs));
if (TargetTriple.getEnvironment() == llvm::Triple::GNUEABIHF) {
TripleAliases.append(begin(ARMHFTriples), end(ARMHFTriples));
+ } else if (TargetTriple.getEnvironment() == llvm::Triple::MuslEABIHF) {
+ TripleAliases.append(begin(ARMHFMuslTriples), end(ARMHFMuslTriples));
} else {
TripleAliases.append(begin(ARMTriples), end(ARMTriples));
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D25686.80118.patch
Type: text/x-patch
Size: 4011 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20161202/4ab94b51/attachment.bin>
More information about the cfe-commits
mailing list