rust icon indicating copy to clipboard operation
rust copied to clipboard

Linker is still invoked with target BPF

Open LucasSte opened this issue 1 year ago • 1 comments

When we compile a project for the SBF target, we still invoke the linker, assuming the BPF target.

Them seems to be related to the following line:

https://github.com/anza-xyz/rust/blob/696ef741a6b654a4fe9f46bc47b502049e919aa9/compiler/rustc_codegen_ssa/src/back/metadata.rs#L214

However, changing it to Architecture::Sbf crashes the linker, as we try to put together files compiled for both the BPF and the SBF target.

We are either invoking the compiler for both targets or writing the incorrect architecture in the file header.

LucasSte avatar Jul 15 '24 17:07 LucasSte

We are still writing EM_BPF in the ELF object: https://github.com/anza-xyz/llvm-project/blob/bda98722f7b7806d037185b4891b9419feee720c/llvm/lib/Target/SBF/MCTargetDesc/SBFELFObjectWriter.cpp#L53

LucasSte avatar Jul 29 '24 13:07 LucasSte

Fixed in #99

LucasSte avatar Jan 24 '25 13:01 LucasSte