From be15c6a8274d96827ac707e5075118d4c376940f Mon Sep 17 00:00:00 2001 From: Kostya Kortchinsky Date: Tue, 10 Jan 2017 21:13:08 +0000 Subject: [PATCH] [Driver] Add openSuse AArch64 Triple Summary: openSuse has AArch64 support, with images running on the Raspberry Pi 3. The libraries and headers live under the aarch64-suse-linux subdirectory, which is currently not in the AArch64 triples list. Address this by adding the corresponding string to AArch64Triples. Reviewers: chandlerc, bruno, bkramer, rengolin Subscribers: aemerson, rengolin, cfe-commits Differential Revision: https://reviews.llvm.org/D28238 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@291598 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Driver/ToolChains.cpp | 2 +- .../usr/lib64/crt1.o | 0 .../usr/lib64/crti.o | 0 .../usr/lib64/crtn.o | 0 .../gcc/aarch64-suse-linux/4.8/crtbegin.o | 0 .../lib64/gcc/aarch64-suse-linux/4.8/crtend.o | 0 test/Driver/linux-ld.c | 20 +++++++++++++++++++ 7 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 test/Driver/Inputs/opensuse_42.2_aarch64_tree/usr/lib64/crt1.o create mode 100644 test/Driver/Inputs/opensuse_42.2_aarch64_tree/usr/lib64/crti.o create mode 100644 test/Driver/Inputs/opensuse_42.2_aarch64_tree/usr/lib64/crtn.o create mode 100644 test/Driver/Inputs/opensuse_42.2_aarch64_tree/usr/lib64/gcc/aarch64-suse-linux/4.8/crtbegin.o create mode 100644 test/Driver/Inputs/opensuse_42.2_aarch64_tree/usr/lib64/gcc/aarch64-suse-linux/4.8/crtend.o diff --git a/lib/Driver/ToolChains.cpp b/lib/Driver/ToolChains.cpp index 547e660ae0..9bc9ae4f6a 100644 --- a/lib/Driver/ToolChains.cpp +++ b/lib/Driver/ToolChains.cpp @@ -1531,7 +1531,7 @@ bool Generic_GCC::GCCInstallationDetector::getBiarchSibling(Multilib &M) const { static const char *const AArch64LibDirs[] = {"/lib64", "/lib"}; static const char *const AArch64Triples[] = { "aarch64-none-linux-gnu", "aarch64-linux-gnu", "aarch64-linux-android", - "aarch64-redhat-linux"}; + "aarch64-redhat-linux", "aarch64-suse-linux"}; static const char *const AArch64beLibDirs[] = {"/lib"}; static const char *const AArch64beTriples[] = {"aarch64_be-none-linux-gnu", "aarch64_be-linux-gnu"}; diff --git a/test/Driver/Inputs/opensuse_42.2_aarch64_tree/usr/lib64/crt1.o b/test/Driver/Inputs/opensuse_42.2_aarch64_tree/usr/lib64/crt1.o new file mode 100644 index 0000000000..e69de29bb2 diff --git a/test/Driver/Inputs/opensuse_42.2_aarch64_tree/usr/lib64/crti.o b/test/Driver/Inputs/opensuse_42.2_aarch64_tree/usr/lib64/crti.o new file mode 100644 index 0000000000..e69de29bb2 diff --git a/test/Driver/Inputs/opensuse_42.2_aarch64_tree/usr/lib64/crtn.o b/test/Driver/Inputs/opensuse_42.2_aarch64_tree/usr/lib64/crtn.o new file mode 100644 index 0000000000..e69de29bb2 diff --git a/test/Driver/Inputs/opensuse_42.2_aarch64_tree/usr/lib64/gcc/aarch64-suse-linux/4.8/crtbegin.o b/test/Driver/Inputs/opensuse_42.2_aarch64_tree/usr/lib64/gcc/aarch64-suse-linux/4.8/crtbegin.o new file mode 100644 index 0000000000..e69de29bb2 diff --git a/test/Driver/Inputs/opensuse_42.2_aarch64_tree/usr/lib64/gcc/aarch64-suse-linux/4.8/crtend.o b/test/Driver/Inputs/opensuse_42.2_aarch64_tree/usr/lib64/gcc/aarch64-suse-linux/4.8/crtend.o new file mode 100644 index 0000000000..e69de29bb2 diff --git a/test/Driver/linux-ld.c b/test/Driver/linux-ld.c index 8fa71a507b..5d1001beb0 100644 --- a/test/Driver/linux-ld.c +++ b/test/Driver/linux-ld.c @@ -618,6 +618,26 @@ // CHECK-SUSE-10-3-PPC64: "-L[[SYSROOT]]/lib/../lib64" // CHECK-SUSE-10-3-PPC64: "-L[[SYSROOT]]/usr/lib/../lib64" // +// Check openSuse Leap 42.2 on AArch64 +// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +// RUN: --target=arm64-unknown-linux-gnu \ +// RUN: --gcc-toolchain="" \ +// RUN: --sysroot=%S/Inputs/opensuse_42.2_aarch64_tree \ +// RUN: | FileCheck --check-prefix=CHECK-OPENSUSE-42-2-AARCH64 %s +// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +// RUN: --target=aarch64-unknown-linux-gnu \ +// RUN: --gcc-toolchain="" \ +// RUN: --sysroot=%S/Inputs/opensuse_42.2_aarch64_tree \ +// RUN: | FileCheck --check-prefix=CHECK-OPENSUSE-42-2-AARCH64 %s +// CHECK-OPENSUSE-42-2-AARCH64: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" +// CHECK-OPENSUSE-42-2-AARCH64: "{{.*}}/usr/lib64/gcc/aarch64-suse-linux/4.8/../../../../lib64{{/|\\\\}}crt1.o" +// CHECK-OPENSUSE-42-2-AARCH64: "{{.*}}/usr/lib64/gcc/aarch64-suse-linux/4.8/../../../../lib64{{/|\\\\}}crti.o" +// CHECK-OPENSUSE-42-2-AARCH64: "{{.*}}/usr/lib64/gcc/aarch64-suse-linux/4.8{{/|\\\\}}crtbegin.o" +// CHECK-OPENSUSE-42-2-AARCH64: "-L[[SYSROOT]]/usr/lib64/gcc/aarch64-suse-linux/4.8" +// CHECK-OPENSUSE-42-2-AARCH64: "-L[[SYSROOT]]/usr/lib64/gcc/aarch64-suse-linux/4.8/../../../../lib64" +// 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 dynamic-linker for different archs // RUN: %clang %s -### -o %t.o 2>&1 \ // RUN: --target=arm-linux-gnueabi \ -- 2.40.0