Closed
Description
When compiling for x86_64-unknown-hermit
, the resulting binaries should have the OS/ABI (EI_OSABI
) field in the ELF header set to Standalone (0xff
) as per the x86_64-unknown-hermit
LLVM target, which it did before nightly-2022-04-26
. Now, it is set to "UNIX - System V", which I only tested on Linux.
git-bisect
identified the introduction of synthetic object files for exported symbols 773f533 from #95604 to have changed this:
773f533eae25129cea7241b74e54f26ce5eebb62 is the first bad commit
commit 773f533eae25129cea7241b74e54f26ce5eebb62
Author: Gary Guo <[email protected]>
Date: Sat Apr 2 22:54:51 2022 +0100
Synthesis object file for `#[used]` and exported symbols
compiler/rustc_codegen_ssa/src/back/link.rs | 69 ++++++++++++++++++++++
compiler/rustc_codegen_ssa/src/back/linker.rs | 46 +++++++++++++++
compiler/rustc_codegen_ssa/src/back/metadata.rs | 2 +-
.../rustc_codegen_ssa/src/back/symbol_export.rs | 54 ++++++++++++++---
compiler/rustc_codegen_ssa/src/base.rs | 7 +++
compiler/rustc_codegen_ssa/src/lib.rs | 2 +
.../rustc_middle/src/middle/exported_symbols.rs | 10 ++++
7 files changed, 182 insertions(+), 8 deletions(-)
I did not have a deep dive into the code yet, but I assume the synthetic object file has the host's OS/ABI, which is prevalent over the other OS/ABI.
@nbdd0121, do you have any insight?
Related: hermit-os/hermit-rs#300