[PATCH] D63497: Add support for openSUSE RISC-V triple

Sam Elliott via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 1 07:25:46 PDT 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rL367565: Add support for openSUSE RISC-V triple (authored by lenary, committed by ).
Herald added a subscriber: s.egerton.

Changed prior to commit:
  https://reviews.llvm.org/D63497?vs=206423&id=212814#toc

Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D63497/new/

https://reviews.llvm.org/D63497

Files:
  cfe/trunk/lib/Driver/ToolChains/Gnu.cpp
  cfe/trunk/test/Driver/Inputs/opensuse_tumbleweed_riscv64_tree/usr/lib64/crt1.o
  cfe/trunk/test/Driver/Inputs/opensuse_tumbleweed_riscv64_tree/usr/lib64/crti.o
  cfe/trunk/test/Driver/Inputs/opensuse_tumbleweed_riscv64_tree/usr/lib64/crtn.o
  cfe/trunk/test/Driver/Inputs/opensuse_tumbleweed_riscv64_tree/usr/lib64/gcc/riscv64-suse-linux/9/crtbegin.o
  cfe/trunk/test/Driver/Inputs/opensuse_tumbleweed_riscv64_tree/usr/lib64/gcc/riscv64-suse-linux/9/crtend.o
  cfe/trunk/test/Driver/linux-ld.c
  llvm/trunk/unittests/ADT/TripleTest.cpp


Index: llvm/trunk/unittests/ADT/TripleTest.cpp
===================================================================
--- llvm/trunk/unittests/ADT/TripleTest.cpp
+++ llvm/trunk/unittests/ADT/TripleTest.cpp
@@ -330,6 +330,12 @@
   EXPECT_EQ(Triple::FreeBSD, T.getOS());
   EXPECT_EQ(Triple::UnknownEnvironment, T.getEnvironment());
 
+  T = Triple("riscv64-suse-linux");
+  EXPECT_EQ(Triple::riscv64, T.getArch());
+  EXPECT_EQ(Triple::SUSE, T.getVendor());
+  EXPECT_EQ(Triple::Linux, T.getOS());
+  EXPECT_EQ(Triple::UnknownEnvironment, T.getEnvironment());
+
   T = Triple("armv7hl-suse-linux-gnueabi");
   EXPECT_EQ(Triple::arm, T.getArch());
   EXPECT_EQ(Triple::SUSE, T.getVendor());
Index: cfe/trunk/lib/Driver/ToolChains/Gnu.cpp
===================================================================
--- cfe/trunk/lib/Driver/ToolChains/Gnu.cpp
+++ cfe/trunk/lib/Driver/ToolChains/Gnu.cpp
@@ -2017,7 +2017,8 @@
   static const char *const RISCV64LibDirs[] = {"/lib64", "/lib"};
   static const char *const RISCV64Triples[] = {"riscv64-unknown-linux-gnu",
                                                "riscv64-linux-gnu",
-                                               "riscv64-unknown-elf"};
+                                               "riscv64-unknown-elf",
+                                               "riscv64-suse-linux"};
 
   static const char *const SPARCv8LibDirs[] = {"/lib32", "/lib"};
   static const char *const SPARCv8Triples[] = {"sparc-linux-gnu",
Index: cfe/trunk/test/Driver/linux-ld.c
===================================================================
--- cfe/trunk/test/Driver/linux-ld.c
+++ cfe/trunk/test/Driver/linux-ld.c
@@ -859,6 +859,26 @@
 // 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 openSUSE Tumbleweed on riscv64
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN:     --target=riscv64-suse-linux -rtlib=platform \
+// RUN:     --gcc-toolchain="" \
+// RUN:     --sysroot=%S/Inputs/opensuse_tumbleweed_riscv64_tree \
+// RUN:   | FileCheck --check-prefix=CHECK-OPENSUSE-TW-RISCV64 %s
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN:     --target=riscv64-suse-linux -rtlib=platform \
+// RUN:     --gcc-toolchain="" \
+// RUN:     --sysroot=%S/Inputs/opensuse_tumbleweed_riscv64_tree \
+// RUN:   | FileCheck --check-prefix=CHECK-OPENSUSE-TW-RISCV64 %s
+// CHECK-OPENSUSE-TW-RISCV64: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
+// CHECK-OPENSUSE-TW-RISCV64: "{{.*}}/usr/lib64/gcc/riscv64-suse-linux/9/../../../../lib64{{/|\\\\}}crt1.o"
+// CHECK-OPENSUSE-TW-RISCV64: "{{.*}}/usr/lib64/gcc/riscv64-suse-linux/9/../../../../lib64{{/|\\\\}}crti.o"
+// CHECK-OPENSUSE-TW-RISCV64: "{{.*}}/usr/lib64/gcc/riscv64-suse-linux/9{{/|\\\\}}crtbegin.o"
+// CHECK-OPENSUSE-TW-RISCV64: "-L[[SYSROOT]]/usr/lib64/gcc/riscv64-suse-linux/9"
+// CHECK-OPENSUSE-TW-RISCV64: "-L[[SYSROOT]]/usr/lib64/gcc/riscv64-suse-linux/9/../../../../lib64"
+// 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 dynamic-linker for different archs
 // RUN: %clang %s -### -o %t.o 2>&1 \
 // RUN:     --target=arm-linux-gnueabi \


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D63497.212814.patch
Type: text/x-patch
Size: 3424 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190801/cabad598/attachment.bin>


More information about the llvm-commits mailing list