[PATCH] D74399: [Driver][RISCV] Add RedHat Linux RISC-V triple
luismarques created this revision. luismarques added reviewers: lenary, asb, dlj. Herald added subscribers: cfe-commits, evandro, sameer.abuasal, s.egerton, Jim, benna, psnobl, PkmX, rkruppe, rogfer01, shiva0217, kito-cheng, simoncook. Herald added a project: clang. Adds the RedHat Linux triple to the list of 64-bit RISC-V triples. Without this the gcc libraries wouldn't be found by clang on a redhat/fedora system, as the search list included `/usr/lib/gcc/riscv64-redhat-linux-gnu` but the correct path didn't include the `-gnu` suffix. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D74399 Files: clang/lib/Driver/ToolChains/Gnu.cpp Index: clang/lib/Driver/ToolChains/Gnu.cpp === --- clang/lib/Driver/ToolChains/Gnu.cpp +++ clang/lib/Driver/ToolChains/Gnu.cpp @@ -2090,6 +2090,7 @@ static const char *const RISCV64Triples[] = {"riscv64-unknown-linux-gnu", "riscv64-linux-gnu", "riscv64-unknown-elf", + "riscv64-redhat-linux", "riscv64-suse-linux"}; static const char *const SPARCv8LibDirs[] = {"/lib32", "/lib"}; Index: clang/lib/Driver/ToolChains/Gnu.cpp === --- clang/lib/Driver/ToolChains/Gnu.cpp +++ clang/lib/Driver/ToolChains/Gnu.cpp @@ -2090,6 +2090,7 @@ static const char *const RISCV64Triples[] = {"riscv64-unknown-linux-gnu", "riscv64-linux-gnu", "riscv64-unknown-elf", + "riscv64-redhat-linux", "riscv64-suse-linux"}; static const char *const SPARCv8LibDirs[] = {"/lib32", "/lib"}; ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D74399: [Driver][RISCV] Add RedHat Linux RISC-V triple
lenary accepted this revision. lenary added a comment. This revision is now accepted and ready to land. LGTM! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D74399/new/ https://reviews.llvm.org/D74399 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D74399: [Driver][RISCV] Add RedHat Linux RISC-V triple
lebedev.ri added a comment. passing-by remark: tests missing Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D74399/new/ https://reviews.llvm.org/D74399 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D74399: [Driver][RISCV] Add RedHat Linux RISC-V triple
luismarques updated this revision to Diff 244187. luismarques added a comment. Herald added subscribers: apazos, pzheng, jocewei, the_o, brucehoult, MartinMosbeck, edward-jones, zzheng, niosHD, sabuasal, johnrusso, rbar. Adds a test (using the RISC-V Fedora 31 paths). CHANGES SINCE LAST ACTION https://reviews.llvm.org/D74399/new/ https://reviews.llvm.org/D74399 Files: clang/lib/Driver/ToolChains/Gnu.cpp clang/test/Driver/Inputs/fedora_31_riscv64_tree/usr/lib/gcc/riscv64-redhat-linux/9/crtbegin.o clang/test/Driver/Inputs/fedora_31_riscv64_tree/usr/lib/gcc/riscv64-redhat-linux/9/crtend.o clang/test/Driver/Inputs/fedora_31_riscv64_tree/usr/lib64/crt1.o clang/test/Driver/Inputs/fedora_31_riscv64_tree/usr/lib64/crti.o clang/test/Driver/Inputs/fedora_31_riscv64_tree/usr/lib64/crtn.o clang/test/Driver/linux-ld.c Index: clang/test/Driver/linux-ld.c === --- clang/test/Driver/linux-ld.c +++ clang/test/Driver/linux-ld.c @@ -769,6 +769,21 @@ // CHECK-FEDORA-21-AARCH64: "{{.*}}/usr/lib/gcc/aarch64-redhat-linux/4.9.0{{/|}}crtend.o" // CHECK-FEDORA-21-AARCH64: "{{.*}}/usr/lib/gcc/aarch64-redhat-linux/4.9.0/../../../../lib64{{/|}}crtn.o" // +// Check Fedora 31 on riscv64. +// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +// RUN: --target=riscv64-redhat-linux -rtlib=platform \ +// RUN: --gcc-toolchain="" \ +// RUN: --sysroot=%S/Inputs/fedora_31_riscv64_tree \ +// RUN: | FileCheck --check-prefix=CHECK-FEDORA-31-RISCV64 %s +// CHECK-FEDORA-31-RISCV64: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" +// CHECK-FEDORA-31-RISCV64: "{{.*}}/usr/lib/gcc/riscv64-redhat-linux/9/../../../../lib64{{/|}}crt1.o" +// CHECK-FEDORA-31-RISCV64: "{{.*}}/usr/lib/gcc/riscv64-redhat-linux/9/../../../../lib64{{/|}}crti.o" +// CHECK-FEDORA-31-RISCV64: "{{.*}}/usr/lib/gcc/riscv64-redhat-linux/9{{/|}}crtbegin.o" +// CHECK-FEDORA-31-RISCV64: "-L[[SYSROOT]]/usr/lib/gcc/riscv64-redhat-linux/9" +// CHECK-FEDORA-31-RISCV64: "-L[[SYSROOT]]/usr/lib/gcc/riscv64-redhat-linux/9/../../../../lib64" +// CHECK-FEDORA-31-RISCV64: "{{.*}}/usr/lib/gcc/riscv64-redhat-linux/9{{/|}}crtend.o" +// CHECK-FEDORA-31-RISCV64: "{{.*}}/usr/lib/gcc/riscv64-redhat-linux/9/../../../../lib64{{/|}}crtn.o" +// // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ // RUN: --target=arm-unknown-linux-gnueabi -rtlib=platform \ // RUN: --gcc-toolchain="" \ Index: clang/lib/Driver/ToolChains/Gnu.cpp === --- clang/lib/Driver/ToolChains/Gnu.cpp +++ clang/lib/Driver/ToolChains/Gnu.cpp @@ -2090,6 +2090,7 @@ static const char *const RISCV64Triples[] = {"riscv64-unknown-linux-gnu", "riscv64-linux-gnu", "riscv64-unknown-elf", + "riscv64-redhat-linux", "riscv64-suse-linux"}; static const char *const SPARCv8LibDirs[] = {"/lib32", "/lib"}; Index: clang/test/Driver/linux-ld.c === --- clang/test/Driver/linux-ld.c +++ clang/test/Driver/linux-ld.c @@ -769,6 +769,21 @@ // CHECK-FEDORA-21-AARCH64: "{{.*}}/usr/lib/gcc/aarch64-redhat-linux/4.9.0{{/|}}crtend.o" // CHECK-FEDORA-21-AARCH64: "{{.*}}/usr/lib/gcc/aarch64-redhat-linux/4.9.0/../../../../lib64{{/|}}crtn.o" // +// Check Fedora 31 on riscv64. +// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +// RUN: --target=riscv64-redhat-linux -rtlib=platform \ +// RUN: --gcc-toolchain="" \ +// RUN: --sysroot=%S/Inputs/fedora_31_riscv64_tree \ +// RUN: | FileCheck --check-prefix=CHECK-FEDORA-31-RISCV64 %s +// CHECK-FEDORA-31-RISCV64: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" +// CHECK-FEDORA-31-RISCV64: "{{.*}}/usr/lib/gcc/riscv64-redhat-linux/9/../../../../lib64{{/|}}crt1.o" +// CHECK-FEDORA-31-RISCV64: "{{.*}}/usr/lib/gcc/riscv64-redhat-linux/9/../../../../lib64{{/|}}crti.o" +// CHECK-FEDORA-31-RISCV64: "{{.*}}/usr/lib/gcc/riscv64-redhat-linux/9{{/|}}crtbegin.o" +// CHECK-FEDORA-31-RISCV64: "-L[[SYSROOT]]/usr/lib/gcc/riscv64-redhat-linux/9" +// CHECK-FEDORA-31-RISCV64: "-L[[SYSROOT]]/usr/lib/gcc/riscv64-redhat-linux/9/../../../../lib64" +// CHECK-FEDORA-31-RISCV64: "{{.*}}/usr/lib/gcc/riscv64-redhat-linux/9{{/|}}crtend.o" +// CHECK-FEDORA-31-RISCV64: "{{.*}}/usr/lib/gcc/riscv64-redhat-linux/9/../../../../lib64{{/|}}crtn.o" +// // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ // RUN: --target=arm-unknown-linux-gnueabi -rtlib=platform \ // RUN: --gcc-toolchain="" \ Index: clang/lib/Driver/ToolChains/Gnu.cpp === --- clang/lib/Driver/ToolChains/Gnu.cpp +++ clang/lib/Driver/ToolChains/Gnu.cpp @@ -2090,6 +2090,7 @@ st
[PATCH] D74399: [Driver][RISCV] Add RedHat Linux RISC-V triple
luismarques updated this revision to Diff 244211. luismarques added a comment. Correct paths. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D74399/new/ https://reviews.llvm.org/D74399 Files: clang/lib/Driver/ToolChains/Gnu.cpp clang/test/Driver/Inputs/fedora_31_riscv64_tree/usr/lib/gcc/riscv64-redhat-linux/9/crtbegin.o clang/test/Driver/Inputs/fedora_31_riscv64_tree/usr/lib/gcc/riscv64-redhat-linux/9/crtend.o clang/test/Driver/Inputs/fedora_31_riscv64_tree/usr/lib/gcc/riscv64-redhat-linux/9/crti.o clang/test/Driver/Inputs/fedora_31_riscv64_tree/usr/lib/gcc/riscv64-redhat-linux/9/crtn.o clang/test/Driver/Inputs/fedora_31_riscv64_tree/usr/lib64/crt1.o clang/test/Driver/linux-ld.c Index: clang/test/Driver/linux-ld.c === --- clang/test/Driver/linux-ld.c +++ clang/test/Driver/linux-ld.c @@ -769,6 +769,21 @@ // CHECK-FEDORA-21-AARCH64: "{{.*}}/usr/lib/gcc/aarch64-redhat-linux/4.9.0{{/|}}crtend.o" // CHECK-FEDORA-21-AARCH64: "{{.*}}/usr/lib/gcc/aarch64-redhat-linux/4.9.0/../../../../lib64{{/|}}crtn.o" // +// Check Fedora 31 on riscv64. +// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +// RUN: --target=riscv64-redhat-linux -rtlib=platform \ +// RUN: --gcc-toolchain="" \ +// RUN: --sysroot=%S/Inputs/fedora_31_riscv64_tree \ +// RUN: | FileCheck --check-prefix=CHECK-FEDORA-31-RISCV64 %s +// CHECK-FEDORA-31-RISCV64: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" +// CHECK-FEDORA-31-RISCV64: "{{.*}}/usr/lib/gcc/riscv64-redhat-linux/9/../../../../lib64{{/|}}crt1.o" +// CHECK-FEDORA-31-RISCV64: "{{.*}}/usr/lib/gcc/riscv64-redhat-linux/9{{/|}}crti.o" +// CHECK-FEDORA-31-RISCV64: "{{.*}}/usr/lib/gcc/riscv64-redhat-linux/9{{/|}}crtbegin.o" +// CHECK-FEDORA-31-RISCV64: "-L[[SYSROOT]]/usr/lib/gcc/riscv64-redhat-linux/9" +// CHECK-FEDORA-31-RISCV64: "-L[[SYSROOT]]/usr/lib/gcc/riscv64-redhat-linux/9/../../../../lib64" +// CHECK-FEDORA-31-RISCV64: "{{.*}}/usr/lib/gcc/riscv64-redhat-linux/9{{/|}}crtend.o" +// CHECK-FEDORA-31-RISCV64: "{{.*}}/usr/lib/gcc/riscv64-redhat-linux/9{{/|}}crtn.o" +// // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ // RUN: --target=arm-unknown-linux-gnueabi -rtlib=platform \ // RUN: --gcc-toolchain="" \ Index: clang/lib/Driver/ToolChains/Gnu.cpp === --- clang/lib/Driver/ToolChains/Gnu.cpp +++ clang/lib/Driver/ToolChains/Gnu.cpp @@ -2090,6 +2090,7 @@ static const char *const RISCV64Triples[] = {"riscv64-unknown-linux-gnu", "riscv64-linux-gnu", "riscv64-unknown-elf", + "riscv64-redhat-linux", "riscv64-suse-linux"}; static const char *const SPARCv8LibDirs[] = {"/lib32", "/lib"}; Index: clang/test/Driver/linux-ld.c === --- clang/test/Driver/linux-ld.c +++ clang/test/Driver/linux-ld.c @@ -769,6 +769,21 @@ // CHECK-FEDORA-21-AARCH64: "{{.*}}/usr/lib/gcc/aarch64-redhat-linux/4.9.0{{/|}}crtend.o" // CHECK-FEDORA-21-AARCH64: "{{.*}}/usr/lib/gcc/aarch64-redhat-linux/4.9.0/../../../../lib64{{/|}}crtn.o" // +// Check Fedora 31 on riscv64. +// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +// RUN: --target=riscv64-redhat-linux -rtlib=platform \ +// RUN: --gcc-toolchain="" \ +// RUN: --sysroot=%S/Inputs/fedora_31_riscv64_tree \ +// RUN: | FileCheck --check-prefix=CHECK-FEDORA-31-RISCV64 %s +// CHECK-FEDORA-31-RISCV64: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" +// CHECK-FEDORA-31-RISCV64: "{{.*}}/usr/lib/gcc/riscv64-redhat-linux/9/../../../../lib64{{/|}}crt1.o" +// CHECK-FEDORA-31-RISCV64: "{{.*}}/usr/lib/gcc/riscv64-redhat-linux/9{{/|}}crti.o" +// CHECK-FEDORA-31-RISCV64: "{{.*}}/usr/lib/gcc/riscv64-redhat-linux/9{{/|}}crtbegin.o" +// CHECK-FEDORA-31-RISCV64: "-L[[SYSROOT]]/usr/lib/gcc/riscv64-redhat-linux/9" +// CHECK-FEDORA-31-RISCV64: "-L[[SYSROOT]]/usr/lib/gcc/riscv64-redhat-linux/9/../../../../lib64" +// CHECK-FEDORA-31-RISCV64: "{{.*}}/usr/lib/gcc/riscv64-redhat-linux/9{{/|}}crtend.o" +// CHECK-FEDORA-31-RISCV64: "{{.*}}/usr/lib/gcc/riscv64-redhat-linux/9{{/|}}crtn.o" +// // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ // RUN: --target=arm-unknown-linux-gnueabi -rtlib=platform \ // RUN: --gcc-toolchain="" \ Index: clang/lib/Driver/ToolChains/Gnu.cpp === --- clang/lib/Driver/ToolChains/Gnu.cpp +++ clang/lib/Driver/ToolChains/Gnu.cpp @@ -2090,6 +2090,7 @@ static const char *const RISCV64Triples[] = {"riscv64-unknown-linux-gnu", "riscv64-linux-gnu", "riscv6
[PATCH] D74399: [Driver][RISCV] Add RedHat Linux RISC-V triple
This revision was automatically updated to reflect the committed changes. Closed by commit rG9816e726e747: [Driver][RISCV] Add RedHat Linux RISC-V triple (authored by luismarques). Herald added a subscriber: jrtc27. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D74399/new/ https://reviews.llvm.org/D74399 Files: clang/lib/Driver/ToolChains/Gnu.cpp clang/test/Driver/Inputs/fedora_31_riscv64_tree/usr/lib/gcc/riscv64-redhat-linux/9/crtbegin.o clang/test/Driver/Inputs/fedora_31_riscv64_tree/usr/lib/gcc/riscv64-redhat-linux/9/crtend.o clang/test/Driver/Inputs/fedora_31_riscv64_tree/usr/lib/gcc/riscv64-redhat-linux/9/crti.o clang/test/Driver/Inputs/fedora_31_riscv64_tree/usr/lib/gcc/riscv64-redhat-linux/9/crtn.o clang/test/Driver/Inputs/fedora_31_riscv64_tree/usr/lib64/crt1.o clang/test/Driver/linux-ld.c Index: clang/test/Driver/linux-ld.c === --- clang/test/Driver/linux-ld.c +++ clang/test/Driver/linux-ld.c @@ -769,6 +769,21 @@ // CHECK-FEDORA-21-AARCH64: "{{.*}}/usr/lib/gcc/aarch64-redhat-linux/4.9.0{{/|}}crtend.o" // CHECK-FEDORA-21-AARCH64: "{{.*}}/usr/lib/gcc/aarch64-redhat-linux/4.9.0/../../../../lib64{{/|}}crtn.o" // +// Check Fedora 31 on riscv64. +// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +// RUN: --target=riscv64-redhat-linux -rtlib=platform \ +// RUN: --gcc-toolchain="" \ +// RUN: --sysroot=%S/Inputs/fedora_31_riscv64_tree \ +// RUN: | FileCheck --check-prefix=CHECK-FEDORA-31-RISCV64 %s +// CHECK-FEDORA-31-RISCV64: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" +// CHECK-FEDORA-31-RISCV64: "{{.*}}/usr/lib/gcc/riscv64-redhat-linux/9/../../../../lib64{{/|}}crt1.o" +// CHECK-FEDORA-31-RISCV64: "{{.*}}/usr/lib/gcc/riscv64-redhat-linux/9{{/|}}crti.o" +// CHECK-FEDORA-31-RISCV64: "{{.*}}/usr/lib/gcc/riscv64-redhat-linux/9{{/|}}crtbegin.o" +// CHECK-FEDORA-31-RISCV64: "-L[[SYSROOT]]/usr/lib/gcc/riscv64-redhat-linux/9" +// CHECK-FEDORA-31-RISCV64: "-L[[SYSROOT]]/usr/lib/gcc/riscv64-redhat-linux/9/../../../../lib64" +// CHECK-FEDORA-31-RISCV64: "{{.*}}/usr/lib/gcc/riscv64-redhat-linux/9{{/|}}crtend.o" +// CHECK-FEDORA-31-RISCV64: "{{.*}}/usr/lib/gcc/riscv64-redhat-linux/9{{/|}}crtn.o" +// // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ // RUN: --target=arm-unknown-linux-gnueabi -rtlib=platform \ // RUN: --gcc-toolchain="" \ Index: clang/lib/Driver/ToolChains/Gnu.cpp === --- clang/lib/Driver/ToolChains/Gnu.cpp +++ clang/lib/Driver/ToolChains/Gnu.cpp @@ -2090,6 +2090,7 @@ static const char *const RISCV64Triples[] = {"riscv64-unknown-linux-gnu", "riscv64-linux-gnu", "riscv64-unknown-elf", + "riscv64-redhat-linux", "riscv64-suse-linux"}; static const char *const SPARCv8LibDirs[] = {"/lib32", "/lib"}; Index: clang/test/Driver/linux-ld.c === --- clang/test/Driver/linux-ld.c +++ clang/test/Driver/linux-ld.c @@ -769,6 +769,21 @@ // CHECK-FEDORA-21-AARCH64: "{{.*}}/usr/lib/gcc/aarch64-redhat-linux/4.9.0{{/|}}crtend.o" // CHECK-FEDORA-21-AARCH64: "{{.*}}/usr/lib/gcc/aarch64-redhat-linux/4.9.0/../../../../lib64{{/|}}crtn.o" // +// Check Fedora 31 on riscv64. +// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ +// RUN: --target=riscv64-redhat-linux -rtlib=platform \ +// RUN: --gcc-toolchain="" \ +// RUN: --sysroot=%S/Inputs/fedora_31_riscv64_tree \ +// RUN: | FileCheck --check-prefix=CHECK-FEDORA-31-RISCV64 %s +// CHECK-FEDORA-31-RISCV64: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" +// CHECK-FEDORA-31-RISCV64: "{{.*}}/usr/lib/gcc/riscv64-redhat-linux/9/../../../../lib64{{/|}}crt1.o" +// CHECK-FEDORA-31-RISCV64: "{{.*}}/usr/lib/gcc/riscv64-redhat-linux/9{{/|}}crti.o" +// CHECK-FEDORA-31-RISCV64: "{{.*}}/usr/lib/gcc/riscv64-redhat-linux/9{{/|}}crtbegin.o" +// CHECK-FEDORA-31-RISCV64: "-L[[SYSROOT]]/usr/lib/gcc/riscv64-redhat-linux/9" +// CHECK-FEDORA-31-RISCV64: "-L[[SYSROOT]]/usr/lib/gcc/riscv64-redhat-linux/9/../../../../lib64" +// CHECK-FEDORA-31-RISCV64: "{{.*}}/usr/lib/gcc/riscv64-redhat-linux/9{{/|}}crtend.o" +// CHECK-FEDORA-31-RISCV64: "{{.*}}/usr/lib/gcc/riscv64-redhat-linux/9{{/|}}crtn.o" +// // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ // RUN: --target=arm-unknown-linux-gnueabi -rtlib=platform \ // RUN: --gcc-toolchain="" \ Index: clang/lib/Driver/ToolChains/Gnu.cpp === --- clang/lib/Driver/ToolChains/Gnu.cpp +++ clang/lib/Driver/ToolChains/Gnu.cpp @@ -2090,6 +2090,7 @@ static const char *const RISCV64Triple