Auto merge of #84468 - iladin:iladin/fix-84467, r=petrochenkov
Fix#84467 linker_args with --target=sparcv9-sun-solaris
Trying to cross-compile for sparcv9-sun-solaris
getting a error message for -zignore
Introduced when -z -ignore was seperated here
22d0ab0
No formatting done
Reproduce
``` bash
rustup target add sparcv9-sun-solaris
cargo new --bin hello && cd hello && cargo run --target=sparcv9-sun-solaris
```
config.toml
[target.sparcv9-sun-solaris]
linker = "gcc"
This commit is contained in:
commit
1d99508b52
1 changed files with 4 additions and 2 deletions
|
@ -432,8 +432,6 @@ impl<'a> Linker for GccLinker<'a> {
|
||||||
// insert it here.
|
// insert it here.
|
||||||
if self.sess.target.is_like_osx {
|
if self.sess.target.is_like_osx {
|
||||||
self.linker_arg("-dead_strip");
|
self.linker_arg("-dead_strip");
|
||||||
} else if self.sess.target.is_like_solaris {
|
|
||||||
self.linker_arg("-zignore");
|
|
||||||
|
|
||||||
// If we're building a dylib, we don't use --gc-sections because LLVM
|
// If we're building a dylib, we don't use --gc-sections because LLVM
|
||||||
// has already done the best it can do, and we also don't want to
|
// has already done the best it can do, and we also don't want to
|
||||||
|
@ -655,6 +653,10 @@ impl<'a> Linker for GccLinker<'a> {
|
||||||
fn add_as_needed(&mut self) {
|
fn add_as_needed(&mut self) {
|
||||||
if self.sess.target.linker_is_gnu {
|
if self.sess.target.linker_is_gnu {
|
||||||
self.linker_arg("--as-needed");
|
self.linker_arg("--as-needed");
|
||||||
|
} else if self.sess.target.is_like_solaris {
|
||||||
|
// -z ignore is the Solaris equivalent to the GNU ld --as-needed option
|
||||||
|
self.linker_arg("-z");
|
||||||
|
self.linker_arg("ignore");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue