tests/run-make/link-eh-frame-terminator/rmake.rs recipe fails during test run for link-eh-frame-terminator on riscv64 target in x86 QEMU environment
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 119k
- Forks
- 16.1k
- PR merge metrics
- PR metrics pending
Description
Description:
I am encountering an issue while running the official CI tests on a riscv64gc-unknown-linux-gnu target in an x86_64 QEMU environment. The test [run-make] tests/run-make/link-eh-frame-terminator fails during the linking stage with the error: Relocations in generic ELF (EM: 243) and error adding symbols: file in wrong format. The test fails when linking with cc.
Steps to Reproduce:
- Run the command:
python3 ./x.py --stage 2 test --host='' --target riscv64gc-unknown-linux-gnu tests/run-make/link-eh-frame-terminator/rmake.rsin a QEMU environment with an x86_64 host and ariscv64gc-unknown-linux-gnutarget. - Observe the error message during the test execution.
Error Output:
running 1 tests
test [run-make] tests/run-make/link-eh-frame-terminator ... FAILED
failures:
---- [run-make] tests/run-make/link-eh-frame-terminator stdout ----
error: rmake recipe failed to complete
status: exit status: 1
command: cd "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/link-eh-frame-terminator/rmake_out" && env -u RUSTFLAGS AR="riscv64-linux-gnu-ar" BUILD_ROOT="/checkout/obj/build/x86_64-unknown-linux-gnu" CARGO="/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-tools-bin/cargo" CC="riscv64-linux-gnu-gcc" CC_DEFAULT_FLAGS="-ffunction-sections -fdata-sections -fPIC -march=rv64gc -mabi=lp64d" CXX="riscv64-linux-gnu-g++" CXX_DEFAULT_FLAGS="-ffunction-sections -fdata-sections -fPIC -march=rv64gc -mabi=lp64d" HOST_RUSTC_DYLIB_PATH="/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib" LD_LIBRARY_PATH="/checkout/obj/build/x86_64-unknown-linux-gnu/bootstrap-tools/x86_64-unknown-linux-gnu/release/deps:/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/lib" LD_LIB_PATH_ENVVAR="LD_LIBRARY_PATH" LLVM_BIN_DIR="/checkout/obj/build/x86_64-unknown-linux-gnu/llvm/bin" LLVM_COMPONENTS="aarch64 aarch64asmparser aarch64codegen aarch64desc aarch64disassembler aarch64info aarch64utils aggressiveinstcombine all all-targets amdgpu amdgpuasmparser amdgpucodegen amdgpudesc amdgpudisassembler amdgpuinfo amdgputargetmca amdgpuutils analysis arm armasmparser armcodegen armdesc armdisassembler arminfo armutils asmparser asmprinter avr avrasmparser avrcodegen avrdesc avrdisassembler avrinfo binaryformat bitreader bitstreamreader bitwriter bpf bpfasmparser bpfcodegen bpfdesc bpfdisassembler bpfinfo cfguard cgdata codegen codegentypes core coroutines coverage csky cskyasmparser cskycodegen cskydesc cskydisassembler cskyinfo debuginfobtf debuginfocodeview debuginfodwarf debuginfogsym debuginfologicalview debuginfomsf debuginfopdb demangle dlltooldriver dwarflinker dwarflinkerclassic dwarflinkerparallel dwp engine executionengine extensions filecheck frontendatomic frontenddriver frontendhlsl frontendoffloading frontendopenacc frontendopenmp fuzzercli fuzzmutate globalisel hexagon hexagonasmparser hexagoncodegen hexagondesc hexagondisassembler hexagoninfo hipstdpar instcombine instrumentation interfacestub interpreter ipo irprinter irreader jitlink libdriver lineeditor linker loongarch loongarchasmparser loongarchcodegen loongarchdesc loongarchdisassembler loongarchinfo lto m68k m68kasmparser m68kcodegen m68kdesc m68kdisassembler m68kinfo mc mca mcdisassembler mcjit mcparser mips mipsasmparser mipscodegen mipsdesc mipsdisassembler mipsinfo mirparser msp430 msp430asmparser msp430codegen msp430desc msp430disassembler msp430info native nativecodegen nvptx nvptxcodegen nvptxdesc nvptxinfo objcarcopts objcopy object objectyaml option orcdebugging orcjit orcshared orctargetprocess passes powerpc powerpcasmparser powerpccodegen powerpcdesc powerpcdisassembler powerpcinfo profiledata remarks riscv riscvasmparser riscvcodegen riscvdesc riscvdisassembler riscvinfo riscvtargetmca runtimedyld sandboxir scalaropts selectiondag sparc sparcasmparser sparccodegen sparcdesc sparcdisassembler sparcinfo support symbolize systemz systemzasmparser systemzcodegen systemzdesc systemzdisassembler systemzinfo tablegen target targetparser telemetry textapi textapibinaryreader transformutils vectorize webassembly webassemblyasmparser webassemblycodegen webassemblydesc webassemblydisassembler webassemblyinfo webassemblyutils windowsdriver windowsmanifest x86 x86asmparser x86codegen x86desc x86disassembler x86info x86targetmca xray xtensa xtensaasmparser xtensacodegen xtensadesc xtensadisassembler xtensainfo" LLVM_FILECHECK="/checkout/obj/build/x86_64-unknown-linux-gnu/llvm/build/bin/FileCheck" PYTHON="/usr/bin/python3" REMOTE_TEST_CLIENT="/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/remote-test-client" RUSTC="/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" RUSTC_LINKER="riscv64-linux-gnu-gcc" RUSTDOC="/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustdoc" SOURCE_ROOT="/checkout" TARGET="riscv64gc-unknown-linux-gnu" TARGET_EXE_DYLIB_PATH="/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/riscv64gc-unknown-linux-gnu/lib" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/link-eh-frame-terminator/rmake"
stdout: none
--- stderr -------------------------------
command failed at line 16
Command { cmd: LD_LIBRARY_PATH="/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/link-eh-frame-terminator/rmake_out:/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib:/checkout/obj/build/x86_64-unknown-linux-gnu/bootstrap-tools/x86_64-unknown-linux-gnu/release/deps:/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/lib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/link-eh-frame-terminator/rmake_out" "eh_frame-terminator.rs" "--target=riscv64gc-unknown-linux-gnu", stdin_buf: None, stdin: None, stdout: None, stderr: None, drop_bomb: DropBomb { command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc", defused: true, armed_location: Location { file: "/checkout/tests/run-make/link-eh-frame-terminator/rmake.rs", line: 16, column: 5 } }, already_executed: true }
output status: exit status: 1
=== STDOUT ===
=== STDERR ===
error: linking with cc failed: exit status: 1
|
= note: "cc" "/tmp/rustcKqaLCI/symbols.o" "<2 object files omitted>" "-Wl,--as-needed" "-Wl,-Bstatic" "/lib/rustlib/riscv64gc-unknown-linux-gnu/lib/{libstd-,libpanic_unwind-,libobject-,libmemchr-,libaddr2line-,libgimli-,librustc_demangle-,libstd_detect-,libhashbrown-,librustc_std_workspace_alloc-,libminiz_oxide-,libadler2-,libunwind-,libcfg_if-,liblibc-,librustc_std_workspace_core-,liballoc-,libcore-,libcompiler_builtins-*}.rlib" "-Wl,-Bdynamic" "-lgcc_s" "-lutil" "-lrt" "-lpthread" "-lm" "-ldl" "-lc" "-L" "/tmp/rustcKqaLCI/raw-dylibs" "-Wl,--eh-frame-hdr" "-Wl,-z,noexecstack" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/link-eh-frame-terminator/rmake_out" "-L" "/lib/rustlib/riscv64gc-unknown-linux-gnu/lib" "-o" "eh_frame-terminator" "-Wl,--gc-sections" "-pie" "-Wl,-z,relro,-z,now" "-nodefaultlibs"
= note: some arguments are omitted. use --verbose to show all linker arguments
= note: /usr/bin/ld: eh_frame-terminator.eh_frame_terminator.de96000750278472-cgu.0.rcgu.o: Relocations in generic ELF (EM: 243)
...
Expected Behavior:
The test should pass successfully, and the linker should handle the target architecture properly.
Environment:
- Rust version: 1.88.0 (Lastet)
- Target architecture: riscv64gc-unknown-linux-gnu
- Host architecture: x86_64-unknown-linux-gnu (QEMU)
- Operating System: Ubuntu 20.04
Additional Information:
- When running the same test in a native
riscv64environment (not under QEMU), the test passes successfully without any errors. - This issue specifically occurs in the emulated QEMU environment when linking with
riscv64-linux-gnu-gcc.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with tests/run-make/link-eh-frame-terminator/rmake.rs and the eh_frame-terminator.rs invocation, then reproduce the provided x.py command in the x86_64 QEMU environment. Compare the failing riscv64gc cross-link with the native riscv64 run; done means the run-make test passes under QEMU using riscv64-linux-gnu-gcc.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- compilers, testing-qa
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100