[lld][ELF][Mips] Link MIPS n32 bitcode as ELF32 #18
Loading…
Reference in a new issue
No description provided.
Delete branch "lld-mips-n32-lto"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
PS2-194: LLVM
-fltofailed to link EE code. lld treated any 64-bit MIPS bitcode as ELF64 and never recognised it as n32, so every n32 LTO link failed with "is incompatible with".lld/ELF/InputFiles.cppgetBitcodeELFKind: bitcode with an n32 triple (isABIN32()) is ELF32lld/ELF/Arch/MipsArchTree.cppisN32Abi: bitcode reports n32 from its triple; before, only ELF headers were readlld/test/ELF/lto/mips-n32.ll-m elf32ltsmipn32, and next to an n32 object, in either orderThis is generic MIPS n32 code, not R5900-gated, so it is an exception to the fork rule in UPDATING.md. Upstream main and lld 22.1.8 have the same bug (all three test cases fail on stock lld 22.1.8).
For EE code, #20 adds the
mips64r5900el-ps2-elftriple, which implies n32 and the R5900, and ps2/ps2build#20 switches to it. Any other n32 triple (gnuabin32,muslabin32) also works with this PR alone.Tested: the sdk-core bench built with
-O2 -fltolinks (ELF32, abi2, 5900) and runs on the console rig with all 9 checksums matching the non-LTO build (runs 20261015T210020-0378 and 20261015T210043-0379, using an n32 triple and--plugin-opt=mcpu=r5900).🤖 Generated with Claude Code