forked from OSchip/llvm-project
[Driver][Fuchsia] -r: imply -nostdlib like GCC
Similar to D116843. Reviewed By: phosek Differential Revision: https://reviews.llvm.org/D116844
This commit is contained in:
parent
1661c8cfcd
commit
e289561205
|
@ -109,7 +109,8 @@ void fuchsia::Linker::ConstructJob(Compilation &C, const JobAction &JA,
|
|||
CmdArgs.push_back("-o");
|
||||
CmdArgs.push_back(Output.getFilename());
|
||||
|
||||
if (!Args.hasArg(options::OPT_nostdlib, options::OPT_nostartfiles)) {
|
||||
if (!Args.hasArg(options::OPT_nostdlib, options::OPT_nostartfiles,
|
||||
options::OPT_r)) {
|
||||
if (!Args.hasArg(options::OPT_shared)) {
|
||||
CmdArgs.push_back(Args.MakeArgString(ToolChain.GetFilePath("Scrt1.o")));
|
||||
}
|
||||
|
@ -131,7 +132,8 @@ void fuchsia::Linker::ConstructJob(Compilation &C, const JobAction &JA,
|
|||
AddLinkerInputs(ToolChain, Inputs, Args, CmdArgs, JA);
|
||||
ToolChain.addProfileRTLibs(Args, CmdArgs);
|
||||
|
||||
if (!Args.hasArg(options::OPT_nostdlib, options::OPT_nodefaultlibs)) {
|
||||
if (!Args.hasArg(options::OPT_nostdlib, options::OPT_nodefaultlibs,
|
||||
options::OPT_r)) {
|
||||
if (Args.hasArg(options::OPT_static))
|
||||
CmdArgs.push_back("-Bdynamic");
|
||||
|
||||
|
|
|
@ -72,6 +72,8 @@
|
|||
// CHECK-RELOCATABLE-NOT: "-pie"
|
||||
// CHECK-RELOCATABLE-NOT: "--build-id"
|
||||
// CHECK-RELOCATABLE: "-r"
|
||||
// CHECK-RELOCATABLE-NOT: "-l
|
||||
// CHECK-RELOCATABLE-NOT: crt{{[^.]+}}.o
|
||||
|
||||
// RUN: %clang %s -### --target=x86_64-unknown-fuchsia -nodefaultlibs -fuse-ld=lld 2>&1 \
|
||||
// RUN: -resource-dir=%S/Inputs/resource_dir_with_per_target_subdir \
|
||||
|
|
Loading…
Reference in New Issue