Skip to content

Commit f9389bc

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 95314f2 + 7fb421b commit f9389bc

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
@@ -619,9 +619,9 @@ impl<'a> Linker for GccLinker<'a> {
619619
// Some versions of `gcc` add it implicitly, some (e.g. `musl-gcc`) don't,
620620
// so we just always add it.
621621
fn add_eh_frame_header(&mut self) {
622-
// The condition here is "uses ELF" basically.
623622
if !self.sess.target.target.options.is_like_osx
624623
&& !self.sess.target.target.options.is_like_windows
624+
&& !self.sess.target.target.options.is_like_solaris
625625
&& self.sess.target.target.target_os != "uefi"
626626
{
627627
self.linker_arg("--eh-frame-hdr");

0 commit comments

Comments
 (0)