Skip to content

A number of tests fails with undefined references to rust_eh_unwind_resume when codegen-units > 1 #43095

Closed
@petrochenkov

Description

#42899 looks like a likely reason
cc @alexcrichton @japaric

Affected run-pass tests (there are also failing tests in other groups):

    [run-pass] run-pass\debuginfo-lto.rs
    [run-pass] run-pass\panic-runtime\lto-abort.rs
    [run-pass] run-pass\panic-runtime\lto-unwind.rs
    [run-pass] run-pass\sepcomp-lib-lto.rs

Failures look like this:

---- [run-pass] run-pass\sepcomp-lib-lto.rs stdout ----

error: compilation failed!
status: exit code: 101
command: PATH="blahblahblah" C:\msys64\home\we\rust\build\build\x86_64-pc-windows-gnu\stage2\bin\rustc.exe C:/msys64/home/we/rust\src/test\run-pass\sepcomp-lib-lto.rs -L C:\msys64\home\we\rust\build\build\x86_64-pc-windows-gnu\test\run-pass --target=x86_64-pc-windows-gnu -L C:\msys64\home\we\rust\build\build\x86_64-pc-windows-gnu\test\run-pass\sepcomp-lib-lto.stage2-x86_64-pc-windows-gnu.run-pass.libaux -o C:\msys64\home\we\rust\build\build\x86_64-pc-windows-gnu\test\run-pass\sepcomp-lib-lto.stage2-x86_64-pc-windows-gnu.exe -Crpath -O -Lnative=C:\msys64\home\we\rust\build\build\x86_64-pc-windows-gnu\native\rust-test-helpers -C lto -g
stdout:
------------------------------------------

------------------------------------------
stderr:
------------------------------------------
error: linking with `gcc` failed: exit code: 1
  |
  = note: "gcc" "-Wl,--enable-long-section-names" "-fno-use-linker-plugin" "-Wl,--nxcompat" "-nostdlib" "-m64" "C:\\msys64\\home\\we\\rust\\build\\build\\x86_64-pc-windows-gnu\\stage2\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\crt2.o" "C:\\msys64\\home\\we\\rust\\build\\build\\x86_64-pc-windows-gnu\\stage2\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\rsbegin.o" "-L" "C:\\msys64\\home\\we\\rust\\build\\build\\x86_64-pc-windows-gnu\\stage2\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib" "C:\\msys64\\home\\we\\rust\\build\\build\\x86_64-pc-windows-gnu\\test\\run-pass\\sepcomp-lib-lto.0.o" "-o" "C:\\msys64\\home\\we\\rust\\build\\build\\x86_64-pc-windows-gnu\\test\\run-pass\\sepcomp-lib-lto.stage2-x86_64-pc-windows-gnu.exe" "-Wl,--gc-sections" "-nodefaultlibs" "-L" "C:\\msys64\\home\\we\\rust\\build\\build\\x86_64-pc-windows-gnu\\test\\run-pass" "-L" "C:\\msys64\\home\\we\\rust\\build\\build\\x86_64-pc-windows-gnu\\test\\run-pass\\sepcomp-lib-lto.stage2-x86_64-pc-windows-gnu.run-pass.libaux" "-L" "C:\\msys64\\home\\we\\rust\\build\\build\\x86_64-pc-windows-gnu\\native\\rust-test-helpers" "-L" "C:\\msys64\\home\\we\\rust\\build\\build\\x86_64-pc-windows-gnu\\stage2\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib" "-Wl,-Bstatic" "C:\\Users\\we\\AppData\\Local\\Temp\\rustc.awTF0ygPNTLw\\libstd-0159a69b5420bf5d.rlib" "C:\\msys64\\home\\we\\rust\\build\\build\\x86_64-pc-windows-gnu\\stage2\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\libcompiler_builtins-9fc12bc5201b06f7.rlib" "-Wl,-Bdynamic" "-l" "advapi32" "-l" "ws2_32" "-l" "userenv" "-l" "shell32" "-Wl,-Bstatic" "-l" "gcc_eh" "-l" "pthread" "-Wl,-Bdynamic" "-lmingwex" "-lmingw32" "-lgcc" "-lmsvcrt" "-luser32" "-lkernel32" "C:\\msys64\\home\\we\\rust\\build\\build\\x86_64-pc-windows-gnu\\stage2\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\rsend.o"
  = note: C:\msys64\home\we\rust\build\build\x86_64-pc-windows-gnu\stage2\lib\rustlib\x86_64-pc-windows-gnu\lib\libcompiler_builtins-9fc12bc5201b06f7.rlib(compiler_builtins-9fc12bc5201b06f7.0.o):(.text+0xd3): undefined reference to `rust_eh_unwind_resume'
          C:\msys64\home\we\rust\build\build\x86_64-pc-windows-gnu\stage2\lib\rustlib\x86_64-pc-windows-gnu\lib\libcompiler_builtins-9fc12bc5201b06f7.rlib(compiler_builtins-9fc12bc5201b06f7.0.o):(.text+0x105): undefined reference to `rust_eh_unwind_resume'
          C:\msys64\home\we\rust\build\build\x86_64-pc-windows-gnu\stage2\lib\rustlib\x86_64-pc-windows-gnu\lib\libcompiler_builtins-9fc12bc5201b06f7.rlib(compiler_builtins-9fc12bc5201b06f7.0.o):(.text+0x200): undefined reference to `rust_eh_unwind_resume'
          C:\msys64\home\we\rust\build\build\x86_64-pc-windows-gnu\stage2\lib\rustlib\x86_64-pc-windows-gnu\lib\libcompiler_builtins-9fc12bc5201b06f7.rlib(compiler_builtins-9fc12bc5201b06f7.0.o):(.text+0x242): undefined reference to `rust_eh_unwind_resume'
          C:\msys64\home\we\rust\build\build\x86_64-pc-windows-gnu\stage2\lib\rustlib\x86_64-pc-windows-gnu\lib\libcompiler_builtins-9fc12bc5201b06f7.rlib(compiler_builtins-9fc12bc5201b06f7.0.o):(.text+0x339): undefined reference to `rust_eh_unwind_resume'
          C:\msys64\home\we\rust\build\build\x86_64-pc-windows-gnu\stage2\lib\rustlib\x86_64-pc-windows-gnu\lib\libcompiler_builtins-9fc12bc5201b06f7.rlib(compiler_builtins-9fc12bc5201b06f7.0.o):(.text+0x37e): more undefined references to `rust_eh_unwind_resume' follow
          collect2.exe: error: ld returned 1 exit status


error: aborting due to previous error


------------------------------------------

thread '[run-pass] run-pass\sepcomp-lib-lto.rs' panicked at 'explicit panic', C:\msys64\home\we\rust\src\tools\compiletest\src\runtest.rs:2473:8

This happens on Windows/GNU (which seems to be the only target using rust_eh_unwind_resume).

Metadata

Assignees

No one assigned

    Labels

    T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-nightlyPerformance or correctness regression from stable to nightly.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions