mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-12-04 03:44:59 +00:00
[Driver] Wrap -lgcc_s in -z ignore/-z record on Solaris (#65487)
`clang` currently links `libgcc_s` unconditionally on Solaris, which is unnecessary. This patch wraps it in `-z ignore`/`-z record` instead. Tested on `amd64-pc-solaris2.11` and `x86_64-pc-linux-gnu`.
This commit is contained in:
parent
d1487670ee
commit
b084d10c28
@ -244,7 +244,9 @@ void solaris::Linker::ConstructJob(Compilation &C, const JobAction &JA,
|
||||
CmdArgs.push_back("-latomic");
|
||||
addAsNeededOption(getToolChain(), Args, CmdArgs, false);
|
||||
}
|
||||
addAsNeededOption(getToolChain(), Args, CmdArgs, true);
|
||||
CmdArgs.push_back("-lgcc_s");
|
||||
addAsNeededOption(getToolChain(), Args, CmdArgs, false);
|
||||
CmdArgs.push_back("-lc");
|
||||
if (!Args.hasArg(options::OPT_shared)) {
|
||||
CmdArgs.push_back("-lgcc");
|
||||
|
@ -22,7 +22,8 @@
|
||||
// CHECK-LD-SPARC32-SAME: "-L[[SYSROOT]]/usr/lib"
|
||||
// CHECK-LD: "-z" "ignore" "-latomic" "-z" "record"
|
||||
// CHECK-GLD: "--as-needed" "-latomic" "--no-as-needed"
|
||||
// CHECK-LD-SPARC32-SAME: "-lgcc_s"
|
||||
// CHECK-LD: "-z" "ignore" "-lgcc_s" "-z" "record"
|
||||
// CHECK-GLD: "--as-needed" "-lgcc_s" "--no-as-needed"
|
||||
// CHECK-LD-SPARC32-SAME: "-lc"
|
||||
// CHECK-LD-SPARC32-SAME: "-lgcc"
|
||||
// CHECK-LD-SPARC32-SAME: "-lm"
|
||||
|
Loading…
Reference in New Issue
Block a user