[PATCH] D32347: Add support for openSUSE ARM Triples
ismail created this revision. Herald added a subscriber: aemerson. Add support for armv6hl-suse-linux-gnueabi and armv7hl-suse-linux-gnueabi triples used by openSUSE/SUSE. https://reviews.llvm.org/D32347 Files: lib/Driver/ToolChains/Gnu.cpp test/Driver/Inputs/opensuse_tumbleweed_armv6hl_tree/usr/lib/crt1.o test/Driver/Inputs/opensuse_tumbleweed_armv6hl_tree/usr/lib/crti.o test/Driver/Inputs/opensuse_tumbleweed_armv6hl_tree/usr/lib/crtn.o test/Driver/Inputs/opensuse_tumbleweed_armv6hl_tree/usr/lib/gcc/armv6hl-suse-linux-gnueabi/5/crtbegin.o test/Driver/Inputs/opensuse_tumbleweed_armv6hl_tree/usr/lib/gcc/armv6hl-suse-linux-gnueabi/5/crtend.o test/Driver/Inputs/opensuse_tumbleweed_armv7hl_tree/usr/lib/crt1.o test/Driver/Inputs/opensuse_tumbleweed_armv7hl_tree/usr/lib/crti.o test/Driver/Inputs/opensuse_tumbleweed_armv7hl_tree/usr/lib/crtn.o test/Driver/Inputs/opensuse_tumbleweed_armv7hl_tree/usr/lib/gcc/armv7hl-suse-linux-gnueabi/5/crtbegin.o test/Driver/Inputs/opensuse_tumbleweed_armv7hl_tree/usr/lib/gcc/armv7hl-suse-linux-gnueabi/5/crtend.o test/Driver/linux-ld.c Index: test/Driver/linux-ld.c === --- test/Driver/linux-ld.c +++ test/Driver/linux-ld.c @@ -638,6 +638,46 @@ // CHECK-OPENSUSE-42-2-AARCH64: "{{.*}}/usr/lib64/gcc/aarch64-suse-linux/4.8{{/|}}crtend.o" // CHECK-OPENSUSE-42-2-AARCH64: "{{.*}}/usr/lib64/gcc/aarch64-suse-linux/4.8/../../../../lib64{{/|}}crtn.o" // +// Check openSUSE Tumbleweed on armv6hl +// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +// RUN: --target=armv6hl-suse-linux-gnueabi \ +// RUN: --gcc-toolchain="" \ +// RUN: --sysroot=%S/Inputs/opensuse_tumbleweed_armv6hl_tree \ +// RUN: | FileCheck --check-prefix=CHECK-OPENSUSE-TW-ARMV6HL %s +// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +// RUN: --target=armv6hl-suse-linux-gnueabi \ +// RUN: --gcc-toolchain="" \ +// RUN: --sysroot=%S/Inputs/opensuse_tumbleweed_armv6hl_tree \ +// RUN: | FileCheck --check-prefix=CHECK-OPENSUSE-TW-ARMV6HL %s +// CHECK-OPENSUSE-TW-ARMV6HL: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" +// CHECK-OPENSUSE-TW-ARMV6HL: "{{.*}}/usr/lib/gcc/armv6hl-suse-linux-gnueabi/5/../../../../lib{{/|}}crt1.o" +// CHECK-OPENSUSE-TW-ARMV6HL: "{{.*}}/usr/lib/gcc/armv6hl-suse-linux-gnueabi/5/../../../../lib{{/|}}crti.o" +// CHECK-OPENSUSE-TW-ARMV6HL: "{{.*}}/usr/lib/gcc/armv6hl-suse-linux-gnueabi/5{{/|}}crtbegin.o" +// CHECK-OPENSUSE-TW-ARMV6HL: "-L[[SYSROOT]]/usr/lib/gcc/armv6hl-suse-linux-gnueabi/5" +// CHECK-OPENSUSE-TW-ARMV6HL: "-L[[SYSROOT]]/usr/lib/gcc/armv6hl-suse-linux-gnueabi/5/../../../../lib" +// CHECK-OPENSUSE-TW-ARMV6HL: "{{.*}}/usr/lib/gcc/armv6hl-suse-linux-gnueabi/5{{/|}}crtend.o" +// CHECK-OPENSUSE-TW-ARMV6HL: "{{.*}}/usr/lib/gcc/armv6hl-suse-linux-gnueabi/5/../../../../lib{{/|}}crtn.o" +// +// Check openSUSE Tumbleweed on armv7hl +// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +// RUN: --target=armv7hl-suse-linux-gnueabi \ +// RUN: --gcc-toolchain="" \ +// RUN: --sysroot=%S/Inputs/opensuse_tumbleweed_armv7hl_tree \ +// RUN: | FileCheck --check-prefix=CHECK-OPENSUSE-TW-ARMV7HL %s +// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +// RUN: --target=armv7hl-suse-linux-gnueabi \ +// RUN: --gcc-toolchain="" \ +// RUN: --sysroot=%S/Inputs/opensuse_tumbleweed_armv7hl_tree \ +// RUN: | FileCheck --check-prefix=CHECK-OPENSUSE-TW-ARMV7HL %s +// CHECK-OPENSUSE-TW-ARMV7HL: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" +// CHECK-OPENSUSE-TW-ARMV7HL: "{{.*}}/usr/lib/gcc/armv7hl-suse-linux-gnueabi/5/../../../../lib{{/|}}crt1.o" +// CHECK-OPENSUSE-TW-ARMV7HL: "{{.*}}/usr/lib/gcc/armv7hl-suse-linux-gnueabi/5/../../../../lib{{/|}}crti.o" +// CHECK-OPENSUSE-TW-ARMV7HL: "{{.*}}/usr/lib/gcc/armv7hl-suse-linux-gnueabi/5{{/|}}crtbegin.o" +// CHECK-OPENSUSE-TW-ARMV7HL: "-L[[SYSROOT]]/usr/lib/gcc/armv7hl-suse-linux-gnueabi/5" +// CHECK-OPENSUSE-TW-ARMV7HL: "-L[[SYSROOT]]/usr/lib/gcc/armv7hl-suse-linux-gnueabi/5/../../../../lib" +// CHECK-OPENSUSE-TW-ARMV7HL: "{{.*}}/usr/lib/gcc/armv7hl-suse-linux-gnueabi/5{{/|}}crtend.o" +// CHECK-OPENSUSE-TW-ARMV7HL: "{{.*}}/usr/lib/gcc/armv7hl-suse-linux-gnueabi/5/../../../../lib{{/|}}crtn.o" +// // Check dynamic-linker for different archs // RUN: %clang %s -### -o %t.o 2>&1 \ // RUN: --target=arm-linux-gnueabi \ Index: lib/Driver/ToolChains/Gnu.cpp === --- lib/Driver/ToolChains/Gnu.cpp +++ lib/Driver/ToolChains/Gnu.cpp @@ -1747,7 +1747,9 @@ static const char *const ARMTriples[] = {"arm-linux-gnueabi", "arm-linux-androideabi"}; static const char *const ARMHFTriples[] = {"arm-linux-gnueabihf", - "armv7hl-redhat-linux-gnueabi"}; +
[PATCH] D32347: Add support for openSUSE ARM Triples
ismail added a comment. In https://reviews.llvm.org/D32347#733474, @rengolin wrote: > Nothing new here, pretty much standard. No "gnueabihf"? Yes openSUSE prefers the "hl" prefix to mean HardFloat. https://reviews.llvm.org/D32347 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D32347: Add support for openSUSE ARM Triples
ismail added a comment. In https://reviews.llvm.org/D32347#733476, @rengolin wrote: > In https://reviews.llvm.org/D32347#733475, @ismail wrote: > > > Yes openSUSE prefers the "hl" prefix to mean HardFloat. > > > I'm not sure that'll do what you expect it, though. Having the "hf" at the > end of the triple has some magical effect on the Triple class. Indeed it doesn't hence we set the correct CFLAGS/CXXFLAGS separately for the moment. > But at the very least, you should make sure that `float-abi` is indeed `hard`. Yes I'll work on that next. This is just to get the triple correct, which lets me bootstrap the compiler. https://reviews.llvm.org/D32347 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D32427: Fix float abi for SUSE ARM triples
ismail created this revision. Herald added a subscriber: aemerson. SUSE's ARM triples always ends with -gnueabi but all the targets are hard-float https://reviews.llvm.org/D32427 Files: lib/Driver/ToolChains/Arch/ARM.cpp test/Driver/linux-as.c Index: test/Driver/linux-as.c === --- test/Driver/linux-as.c +++ test/Driver/linux-as.c @@ -174,3 +174,9 @@ // RUN: -no-integrated-as -c %s 2>&1 \ // RUN: | FileCheck -check-prefix=CHECK-Z-ARCH-Z196 %s // CHECK-Z-ARCH-Z196: as{{.*}} "-march=z196" +// +// RUN: %clang -target armv7hl-suse-linux-gnueabi -### \ +// RUN: -no-integrated-as -c %s 2>&1 \ +// RUN: | FileCheck -check-prefix=CHECK-SUSE-ARMV7 %s +// CHECK-SUSE-ARMV7: as{{.*}}" "-mfloat-abi=hard" + Index: lib/Driver/ToolChains/Arch/ARM.cpp === --- lib/Driver/ToolChains/Arch/ARM.cpp +++ lib/Driver/ToolChains/Arch/ARM.cpp @@ -227,6 +227,10 @@ } } + // SUSE triples ends with -gnueabi but all targets are hard-float + if (Triple.getVendor() == llvm::Triple::SUSE) + ABI = FloatABI::Hard; + assert(ABI != FloatABI::Invalid && "must select an ABI"); return ABI; } Index: test/Driver/linux-as.c === --- test/Driver/linux-as.c +++ test/Driver/linux-as.c @@ -174,3 +174,9 @@ // RUN: -no-integrated-as -c %s 2>&1 \ // RUN: | FileCheck -check-prefix=CHECK-Z-ARCH-Z196 %s // CHECK-Z-ARCH-Z196: as{{.*}} "-march=z196" +// +// RUN: %clang -target armv7hl-suse-linux-gnueabi -### \ +// RUN: -no-integrated-as -c %s 2>&1 \ +// RUN: | FileCheck -check-prefix=CHECK-SUSE-ARMV7 %s +// CHECK-SUSE-ARMV7: as{{.*}}" "-mfloat-abi=hard" + Index: lib/Driver/ToolChains/Arch/ARM.cpp === --- lib/Driver/ToolChains/Arch/ARM.cpp +++ lib/Driver/ToolChains/Arch/ARM.cpp @@ -227,6 +227,10 @@ } } + // SUSE triples ends with -gnueabi but all targets are hard-float + if (Triple.getVendor() == llvm::Triple::SUSE) + ABI = FloatABI::Hard; + assert(ABI != FloatABI::Invalid && "must select an ABI"); return ABI; } ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D32427: Fix float abi for SUSE ARM triples
ismail updated this revision to Diff 96382. ismail added a comment. Fix typo https://reviews.llvm.org/D32427 Files: lib/Driver/ToolChains/Arch/ARM.cpp test/Driver/linux-as.c Index: test/Driver/linux-as.c === --- test/Driver/linux-as.c +++ test/Driver/linux-as.c @@ -174,3 +174,9 @@ // RUN: -no-integrated-as -c %s 2>&1 \ // RUN: | FileCheck -check-prefix=CHECK-Z-ARCH-Z196 %s // CHECK-Z-ARCH-Z196: as{{.*}} "-march=z196" +// +// RUN: %clang -target armv7hl-suse-linux-gnueabi -### \ +// RUN: -no-integrated-as -c %s 2>&1 \ +// RUN: | FileCheck -check-prefix=CHECK-SUSE-ARMV7 %s +// CHECK-SUSE-ARMV7: as{{.*}}" "-mfloat-abi=hard" + Index: lib/Driver/ToolChains/Arch/ARM.cpp === --- lib/Driver/ToolChains/Arch/ARM.cpp +++ lib/Driver/ToolChains/Arch/ARM.cpp @@ -227,6 +227,10 @@ } } + // SUSE triples end with -gnueabi but all targets are hard-float + if (Triple.getVendor() == llvm::Triple::SUSE) + ABI = FloatABI::Hard; + assert(ABI != FloatABI::Invalid && "must select an ABI"); return ABI; } Index: test/Driver/linux-as.c === --- test/Driver/linux-as.c +++ test/Driver/linux-as.c @@ -174,3 +174,9 @@ // RUN: -no-integrated-as -c %s 2>&1 \ // RUN: | FileCheck -check-prefix=CHECK-Z-ARCH-Z196 %s // CHECK-Z-ARCH-Z196: as{{.*}} "-march=z196" +// +// RUN: %clang -target armv7hl-suse-linux-gnueabi -### \ +// RUN: -no-integrated-as -c %s 2>&1 \ +// RUN: | FileCheck -check-prefix=CHECK-SUSE-ARMV7 %s +// CHECK-SUSE-ARMV7: as{{.*}}" "-mfloat-abi=hard" + Index: lib/Driver/ToolChains/Arch/ARM.cpp === --- lib/Driver/ToolChains/Arch/ARM.cpp +++ lib/Driver/ToolChains/Arch/ARM.cpp @@ -227,6 +227,10 @@ } } + // SUSE triples end with -gnueabi but all targets are hard-float + if (Triple.getVendor() == llvm::Triple::SUSE) + ABI = FloatABI::Hard; + assert(ABI != FloatABI::Invalid && "must select an ABI"); return ABI; } ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D32427: Fix float abi for SUSE ARM triples
ismail added a comment. I am open to suggestions on how to do this correctly. The problem as stated is all SUSE ARM triples end with -gnueabi but they are all hard-float. Environment handling in LLVM seems to only check for the last part of the triple and not the whole string. https://reviews.llvm.org/D32427 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D32427: Fix float abi for SUSE ARM triples
ismail abandoned this revision. ismail added a comment. compnerd has a better fix. https://reviews.llvm.org/D32427 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits