Skip to content

Commit 6c73e61

Browse files
authored
Rollup merge of rust-lang#74167 - jclulow:illumos-linker-eh-frame-hdr-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.
2 parents f728bb2 + 7fb421b commit 6c73e61

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/librustc_codegen_ssa/back/linker.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -621,9 +621,9 @@ impl<'a> Linker for GccLinker<'a> {
621621
// Some versions of `gcc` add it implicitly, some (e.g. `musl-gcc`) don't,
622622
// so we just always add it.
623623
fn add_eh_frame_header(&mut self) {
624-
// The condition here is "uses ELF" basically.
625624
if !self.sess.target.target.options.is_like_osx
626625
&& !self.sess.target.target.options.is_like_windows
626+
&& !self.sess.target.target.options.is_like_solaris
627627
&& self.sess.target.target.target_os != "uefi"
628628
{
629629
self.linker_arg("--eh-frame-hdr");

0 commit comments

Comments
 (0)