[PATCH] D128109: [Driver] Pass -X to ld for riscv64-openbsd
Brad Smith via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Jun 17 17:21:27 PDT 2022
brad updated this revision to Diff 438075.
brad added a comment.
Fix the test.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D128109/new/
https://reviews.llvm.org/D128109
Files:
clang/lib/Driver/ToolChains/OpenBSD.cpp
clang/test/Driver/openbsd.c
Index: clang/test/Driver/openbsd.c
===================================================================
--- clang/test/Driver/openbsd.c
+++ clang/test/Driver/openbsd.c
@@ -126,3 +126,8 @@
// RUN: FileCheck -check-prefix=UNWIND-TABLES %s
// UNWIND-TABLES: "-funwind-tables=2"
// NO-UNWIND-TABLES-NOT: "-funwind-tables=2"
+
+// Check that the -X flag is passed to the linker on riscv64
+// RUN: %clang --target=riscv64-unknown-openbsd -### %s 2>&1 \
+// RUN: | FileCheck -check-prefix=CHECK-RISCV64-FLAGS %s
+// CHECK-RISCV64-FLAGS: "-X"
Index: clang/lib/Driver/ToolChains/OpenBSD.cpp
===================================================================
--- clang/lib/Driver/ToolChains/OpenBSD.cpp
+++ clang/lib/Driver/ToolChains/OpenBSD.cpp
@@ -156,6 +156,9 @@
if (Args.hasArg(options::OPT_nopie) || Args.hasArg(options::OPT_pg))
CmdArgs.push_back("-nopie");
+ if (ToolChain.getArch() == llvm::Triple::riscv64)
+ CmdArgs.push_back("-X");
+
if (Output.isFilename()) {
CmdArgs.push_back("-o");
CmdArgs.push_back(Output.getFilename());
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D128109.438075.patch
Type: text/x-patch
Size: 1062 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220618/ca9e9fc6/attachment.bin>
More information about the cfe-commits
mailing list