[clang] 7c5957a - [Driver] Pass -X to ld for riscv64-fuchsia
Brad Smith via cfe-commits
cfe-commits at lists.llvm.org
Mon Jun 20 18:05:34 PDT 2022
Author: Brad Smith
Date: 2022-06-20T21:05:01-04:00
New Revision: 7c5957aedb75f381cd9996f9eba96f3add16a721
URL: https://github.com/llvm/llvm-project/commit/7c5957aedb75f381cd9996f9eba96f3add16a721
DIFF: https://github.com/llvm/llvm-project/commit/7c5957aedb75f381cd9996f9eba96f3add16a721.diff
LOG: [Driver] Pass -X to ld for riscv64-fuchsia
D127826, add support for Fuchsia which uses lld on riscv64
Reviewed By: MaskRay, phosek
Differential Revision: https://reviews.llvm.org/D128134
Added:
Modified:
clang/lib/Driver/ToolChains/Fuchsia.cpp
clang/test/Driver/fuchsia.c
Removed:
################################################################################
diff --git a/clang/lib/Driver/ToolChains/Fuchsia.cpp b/clang/lib/Driver/ToolChains/Fuchsia.cpp
index e81c40c74fdbf..03ff9fe894c88 100644
--- a/clang/lib/Driver/ToolChains/Fuchsia.cpp
+++ b/clang/lib/Driver/ToolChains/Fuchsia.cpp
@@ -114,6 +114,9 @@ void fuchsia::Linker::ConstructJob(Compilation &C, const JobAction &JA,
CmdArgs.push_back(Args.MakeArgString(Dyld));
}
+ if (ToolChain.getArch() == llvm::Triple::riscv64)
+ CmdArgs.push_back("-X");
+
CmdArgs.push_back("-o");
CmdArgs.push_back(Output.getFilename());
diff --git a/clang/test/Driver/fuchsia.c b/clang/test/Driver/fuchsia.c
index 996f5862bbd47..99c43f4cecabd 100644
--- a/clang/test/Driver/fuchsia.c
+++ b/clang/test/Driver/fuchsia.c
@@ -43,6 +43,7 @@
// CHECK: "--hash-style=gnu"
// CHECK-AARCH64: "--fix-cortex-a53-843419"
// CHECK: "-dynamic-linker" "ld.so.1"
+// CHECK-RISCV64: "-X"
// CHECK: Scrt1.o
// CHECK-NOT: crti.o
// CHECK-NOT: crtbegin.o
More information about the cfe-commits
mailing list