[PATCH] D100615: [RISCV][Driver] Make the ordering of CmdArgs consistent between RISCV::Linker and baremetal::Linker
ShihPo Hung via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Sun Apr 18 19:06:20 PDT 2021
This revision was automatically updated to reflect the committed changes.
Closed by commit rG27edaee84e3e: [RISCV][Driver] Make the ordering of CmdArgs consistent between RISCV::Linker… (authored by arcbbb).
Changed prior to commit:
https://reviews.llvm.org/D100615?vs=338004&id=338410#toc
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D100615/new/
https://reviews.llvm.org/D100615
Files:
clang/lib/Driver/ToolChains/RISCVToolchain.cpp
clang/test/Driver/riscv-args.c
Index: clang/test/Driver/riscv-args.c
===================================================================
--- /dev/null
+++ clang/test/Driver/riscv-args.c
@@ -0,0 +1,7 @@
+// Check the arguments are correctly passed
+
+// Make sure -T is the last with gcc-toolchain option
+// RUN: %clang -### -target riscv32 \
+// 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"
Index: clang/lib/Driver/ToolChains/RISCVToolchain.cpp
===================================================================
--- clang/lib/Driver/ToolChains/RISCVToolchain.cpp
+++ clang/lib/Driver/ToolChains/RISCVToolchain.cpp
@@ -181,14 +181,14 @@
CmdArgs.push_back(Args.MakeArgString(ToolChain.GetFilePath(crtbegin)));
}
+ AddLinkerInputs(ToolChain, Inputs, Args, CmdArgs, JA);
+
Args.AddAllArgs(CmdArgs, options::OPT_L);
ToolChain.AddFilePathLibArgs(Args, CmdArgs);
Args.AddAllArgs(CmdArgs,
{options::OPT_T_Group, options::OPT_e, options::OPT_s,
options::OPT_t, options::OPT_Z_Flag, options::OPT_r});
- AddLinkerInputs(ToolChain, Inputs, Args, CmdArgs, JA);
-
// TODO: add C++ includes and libs if compiling C++.
if (!Args.hasArg(options::OPT_nostdlib) &&
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D100615.338410.patch
Type: text/x-patch
Size: 1318 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210419/d28d5b58/attachment.bin>
More information about the cfe-commits
mailing list