Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix#84467 linker_args with --target=sparcv9-sun-solaris #84468

Merged
merged 1 commit into from
May 6, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions compiler/rustc_codegen_ssa/src/back/linker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -432,8 +432,6 @@ impl<'a> Linker for GccLinker<'a> {
// insert it here.
if self.sess.target.is_like_osx {
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
// has already done the best it can do, and we also don't want to
Expand Down Expand Up @@ -655,6 +653,10 @@ impl<'a> Linker for GccLinker<'a> {
fn add_as_needed(&mut self) {
if self.sess.target.linker_is_gnu {
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");
}
}
}
Expand Down