Skip to content

Commit 8f8ff15

Browse files
authored
Rollup merge of #74167 - jclulow:illumos-linker-eh-frame-hdr-fix, r=petrochenkov
linker: illumos ld does not support --eh-frame-hdr As of #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 9614238 + 7fb421b commit 8f8ff15

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)