Skip to content

Commit

Permalink
Rollup merge of rust-lang#74167 - jclulow:illumos-linker-eh-frame-hdr…
Browse files Browse the repository at this point in the history
…-fix, r=petrochenkov

linker: illumos ld does not support --eh-frame-hdr

As of rust-lang#73564, the --eh-frame-hdr flag is unconditionally
passed to linkers on many platforms.  The illumos link editor does not
currently support this flag.

The linker machinery in the Rust toolchain currently seems to use the
(potentially cross-compiled) target to choose linker flags, rather than
looking at what might be running on the build system.  Disabling the
flag for all illumos/Solaris targets seems like the best we can do for
now without more serious surgery.
  • Loading branch information
Manishearth committed Jul 10, 2020
2 parents 8821c49 + 7fb421b commit fdb5f7c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/librustc_codegen_ssa/back/linker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -621,9 +621,9 @@ impl<'a> Linker for GccLinker<'a> {
// Some versions of `gcc` add it implicitly, some (e.g. `musl-gcc`) don't,
// so we just always add it.
fn add_eh_frame_header(&mut self) {
// The condition here is "uses ELF" basically.
if !self.sess.target.target.options.is_like_osx
&& !self.sess.target.target.options.is_like_windows
&& !self.sess.target.target.options.is_like_solaris
&& self.sess.target.target.target_os != "uefi"
{
self.linker_arg("--eh-frame-hdr");
Expand Down

0 comments on commit fdb5f7c

Please sign in to comment.