[PATCH] D128109: [Driver] Pass -X to ld for riscv64-openbsd

Brad Smith via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Jun 18 14:59:38 PDT 2022


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG119a13199a91: [Driver] Pass -X to ld for riscv64-openbsd (authored by brad).

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.438154.patch
Type: text/x-patch
Size: 1062 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220618/effd01a1/attachment.bin>


More information about the cfe-commits mailing list