mirror of
https://github.com/compiler-explorer/compiler-explorer.git
synced 2026-07-22 02:56:57 -04:00
## Summary - When multiarch compilers (Rust, Zig, etc.) target a non-host architecture (e.g. `--target=aarch64-unknown-linux-gnu`), GNU `objdump` fails because it cannot disassemble foreign-arch binaries, producing `<No output: objdump returned 1>` - Adds a `llvmObjdumper` config property that switches to `llvm-objdump` when the compilation targets a non-x86 instruction set, since `llvm-objdump` can auto-detect the target architecture from the binary itself - All multiarch compilers benefit from this generically via `BaseCompiler.getObjdumperForResult()` — no per-compiler special-casing needed ## Changes - **`types/compiler.interfaces.ts`** — Add `llvmObjdumper` to `CompilerInfo` - **`lib/compiler-finder.ts`** — Read `llvmObjdumper` from config - **`lib/base-compiler.ts`** — Add `getObjdumperForResult()` method and refactor `objdump()` to use it - **`etc/config/rust.defaults.properties`** — Set `llvmObjdumper=llvm-objdump` - **`etc/config/zig.defaults.properties`** — Set `llvmObjdumper=llvm-objdump` - **`test/objdumper-tests.ts`** — Add 6 tests for cross-architecture objdumper selection ## Test plan - [x] `npm run ts-check` passes - [x] `npm run lint` passes - [x] All related tests pass (301 tests across 27 files) - [x] Smoke test: configure a Rust compiler with `--target=aarch64-unknown-linux-gnu` and verify `llvm-objdump` is used instead of GNU `objdump` Fixes #5593