[PATCH] D105091: [RISCV] Pass -u to linker correctly.
Kito Cheng via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Jun 30 23:34:58 PDT 2021
kito-cheng updated this revision to Diff 355783.
kito-cheng added a comment.
Address @MaskRay's comment
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D105091/new/
https://reviews.llvm.org/D105091
Files:
clang/lib/Driver/ToolChains/RISCVToolchain.cpp
clang/test/Driver/riscv-args.c
Index: clang/test/Driver/riscv-args.c
===================================================================
--- clang/test/Driver/riscv-args.c
+++ clang/test/Driver/riscv-args.c
@@ -5,3 +5,8 @@
// RUN: --gcc-toolchain= -Xlinker --defsym=FOO=10 -T a.lds %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK-LD %s
// CHECK-LD: {{.*}} "--defsym=FOO=10" {{.*}} "-T" "a.lds"
+
+// Make sure -u has passed to linker
+// RUN: %clang -### -target riscv32 --gcc-toolchain= -u foo %s 2>&1 \
+// RUN: | FileCheck -check-prefix=CHECK-U-LD %s
+// CHECK-U-LD: {{.*}} "-u" "foo"
Index: clang/lib/Driver/ToolChains/RISCVToolchain.cpp
===================================================================
--- clang/lib/Driver/ToolChains/RISCVToolchain.cpp
+++ clang/lib/Driver/ToolChains/RISCVToolchain.cpp
@@ -184,6 +184,7 @@
AddLinkerInputs(ToolChain, Inputs, Args, CmdArgs, JA);
Args.AddAllArgs(CmdArgs, options::OPT_L);
+ Args.AddAllArgs(CmdArgs, options::OPT_u);
ToolChain.AddFilePathLibArgs(Args, CmdArgs);
Args.AddAllArgs(CmdArgs,
{options::OPT_T_Group, options::OPT_e, options::OPT_s,
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D105091.355783.patch
Type: text/x-patch
Size: 1112 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210701/7f5be1f5/attachment.bin>
More information about the cfe-commits
mailing list