summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--clang/lib/Driver/ToolChains/Gnu.cpp4
-rw-r--r--clang/test/Driver/Inputs/opensuse_tumbleweed_ppc_tree/usr/lib/crt1.o0
-rw-r--r--clang/test/Driver/Inputs/opensuse_tumbleweed_ppc_tree/usr/lib/crti.o0
-rw-r--r--clang/test/Driver/Inputs/opensuse_tumbleweed_ppc_tree/usr/lib/crtn.o0
-rw-r--r--clang/test/Driver/Inputs/opensuse_tumbleweed_ppc_tree/usr/lib/gcc/powerpc64-suse-linux/9/crtbegin.o0
-rw-r--r--clang/test/Driver/Inputs/opensuse_tumbleweed_ppc_tree/usr/lib/gcc/powerpc64-suse-linux/9/crtend.o0
-rw-r--r--clang/test/Driver/linux-ld.c15
7 files changed, 18 insertions, 1 deletions
diff --git a/clang/lib/Driver/ToolChains/Gnu.cpp b/clang/lib/Driver/ToolChains/Gnu.cpp
index eb84a99a16b..4c6956d54b7 100644
--- a/clang/lib/Driver/ToolChains/Gnu.cpp
+++ b/clang/lib/Driver/ToolChains/Gnu.cpp
@@ -2057,7 +2057,9 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
static const char *const PPCLibDirs[] = {"/lib32", "/lib"};
static const char *const PPCTriples[] = {
"powerpc-linux-gnu", "powerpc-unknown-linux-gnu", "powerpc-linux-gnuspe",
- "powerpc-suse-linux", "powerpc-montavista-linuxspe"};
+ // On 32-bit PowerPC systems running SUSE Linux, gcc is configured as a
+ // 64-bit compiler which defaults to "-m32", hence "powerpc64-suse-linux".
+ "powerpc64-suse-linux", "powerpc-montavista-linuxspe"};
static const char *const PPC64LibDirs[] = {"/lib64", "/lib"};
static const char *const PPC64Triples[] = {
"powerpc64-linux-gnu", "powerpc64-unknown-linux-gnu",
diff --git a/clang/test/Driver/Inputs/opensuse_tumbleweed_ppc_tree/usr/lib/crt1.o b/clang/test/Driver/Inputs/opensuse_tumbleweed_ppc_tree/usr/lib/crt1.o
new file mode 100644
index 00000000000..e69de29bb2d
--- /dev/null
+++ b/clang/test/Driver/Inputs/opensuse_tumbleweed_ppc_tree/usr/lib/crt1.o
diff --git a/clang/test/Driver/Inputs/opensuse_tumbleweed_ppc_tree/usr/lib/crti.o b/clang/test/Driver/Inputs/opensuse_tumbleweed_ppc_tree/usr/lib/crti.o
new file mode 100644
index 00000000000..e69de29bb2d
--- /dev/null
+++ b/clang/test/Driver/Inputs/opensuse_tumbleweed_ppc_tree/usr/lib/crti.o
diff --git a/clang/test/Driver/Inputs/opensuse_tumbleweed_ppc_tree/usr/lib/crtn.o b/clang/test/Driver/Inputs/opensuse_tumbleweed_ppc_tree/usr/lib/crtn.o
new file mode 100644
index 00000000000..e69de29bb2d
--- /dev/null
+++ b/clang/test/Driver/Inputs/opensuse_tumbleweed_ppc_tree/usr/lib/crtn.o
diff --git a/clang/test/Driver/Inputs/opensuse_tumbleweed_ppc_tree/usr/lib/gcc/powerpc64-suse-linux/9/crtbegin.o b/clang/test/Driver/Inputs/opensuse_tumbleweed_ppc_tree/usr/lib/gcc/powerpc64-suse-linux/9/crtbegin.o
new file mode 100644
index 00000000000..e69de29bb2d
--- /dev/null
+++ b/clang/test/Driver/Inputs/opensuse_tumbleweed_ppc_tree/usr/lib/gcc/powerpc64-suse-linux/9/crtbegin.o
diff --git a/clang/test/Driver/Inputs/opensuse_tumbleweed_ppc_tree/usr/lib/gcc/powerpc64-suse-linux/9/crtend.o b/clang/test/Driver/Inputs/opensuse_tumbleweed_ppc_tree/usr/lib/gcc/powerpc64-suse-linux/9/crtend.o
new file mode 100644
index 00000000000..e69de29bb2d
--- /dev/null
+++ b/clang/test/Driver/Inputs/opensuse_tumbleweed_ppc_tree/usr/lib/gcc/powerpc64-suse-linux/9/crtend.o
diff --git a/clang/test/Driver/linux-ld.c b/clang/test/Driver/linux-ld.c
index 7aba660d51f..51227550b52 100644
--- a/clang/test/Driver/linux-ld.c
+++ b/clang/test/Driver/linux-ld.c
@@ -879,6 +879,21 @@
// CHECK-OPENSUSE-TW-RISCV64: "{{.*}}/usr/lib64/gcc/riscv64-suse-linux/9{{/|\\\\}}crtend.o"
// CHECK-OPENSUSE-TW-RISCV64: "{{.*}}/usr/lib64/gcc/riscv64-suse-linux/9/../../../../lib64{{/|\\\\}}crtn.o"
//
+// Check openSUSE Tumbleweed on ppc
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: --target=powerpc-unknown-linux-gnu -rtlib=platform \
+// RUN: --gcc-toolchain="" \
+// RUN: --sysroot=%S/Inputs/opensuse_tumbleweed_ppc_tree \
+// RUN: | FileCheck --check-prefix=CHECK-OPENSUSE-TW-PPC %s
+// CHECK-OPENSUSE-TW-PPC: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
+// CHECK-OPENSUSE-TW-PPC: "{{.*}}/usr/lib/gcc/powerpc64-suse-linux/9/../../..{{/|\\\\}}crt1.o"
+// CHECK-OPENSUSE-TW-PPC: "{{.*}}/usr/lib/gcc/powerpc64-suse-linux/9/../../..{{/|\\\\}}crti.o"
+// CHECK-OPENSUSE-TW-PPC: "{{.*}}/usr/lib/gcc/powerpc64-suse-linux/9{{/|\\\\}}crtbegin.o"
+// CHECK-OPENSUSE-TW-PPC: "-L[[SYSROOT]]/usr/lib/gcc/powerpc64-suse-linux/9"
+// CHECK-OPENSUSE-TW-PPC: "-L[[SYSROOT]]/usr/lib/gcc/powerpc64-suse-linux/9/../../.."
+// CHECK-OPENSUSE-TW-PPC: "{{.*}}/usr/lib/gcc/powerpc64-suse-linux/9{{/|\\\\}}crtend.o"
+// CHECK-OPENSUSE-TW-PPC: "{{.*}}/usr/lib/gcc/powerpc64-suse-linux/9/../../..{{/|\\\\}}crtn.o"
+//
// Check dynamic-linker for different archs
// RUN: %clang %s -### -o %t.o 2>&1 \
// RUN: --target=arm-linux-gnueabi \
OpenPOWER on IntegriCloud