Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

i686-unknown-uefi rust-lld error: symbols.o is not compatible with SEH #96498

Closed
nicholasbishop opened this issue Apr 28, 2022 · 3 comments · Fixed by #96523
Closed

i686-unknown-uefi rust-lld error: symbols.o is not compatible with SEH #96498

nicholasbishop opened this issue Apr 28, 2022 · 3 comments · Fixed by #96523
Labels
C-bug Category: This is a bug. P-medium Medium priority regression-untriaged Untriaged performance or correctness regression. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@nicholasbishop
Copy link
Contributor

nicholasbishop commented Apr 28, 2022

Code

I tried this code: https://github.com/nicholasbishop/uefi-ia32-bug-repro

Build with cargo +nightly build --target i686-unknown-uefi

With recent nighties it fails to link:

error: linking with `rust-lld` failed: exit status: 1
  |
  = note: "rust-lld" "-flavor" "link" "/NOLOGO" "/entry:efi_main" "/subsystem:efi_application" "/tmp/rustcY04Gup/symbols.o" "/var/home/nbishop/src/uefi-ia32-bug/target/i686-unknown-uefi/debug/deps/uefi_app-0f328129b38d8e14.35bawstz5fweo2rn.rcgu.o" "/var/home/nbishop/src/uefi-ia32-bug/target/i686-unknown-uefi/debug/deps/uefi_app-0f328129b38d8e14.majda6vvzvbpb73.rcgu.o" "/LIBPATH:/var/home/nbishop/src/uefi-ia32-bug/target/i686-unknown-uefi/debug/deps" "/LIBPATH:/var/home/nbishop/src/uefi-ia32-bug/target/debug/deps" "/LIBPATH:/var/home/nbishop/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/i686-unknown-uefi/lib" "/var/home/nbishop/src/uefi-ia32-bug/target/i686-unknown-uefi/debug/deps/libuefi_services-ecb3e66dfef8e74e.rlib" "/var/home/nbishop/src/uefi-ia32-bug/target/i686-unknown-uefi/debug/deps/libuefi-2ba71252a179d4d1.rlib" "/var/home/nbishop/src/uefi-ia32-bug/target/i686-unknown-uefi/debug/deps/liblog-38e253a051128d63.rlib" "/var/home/nbishop/src/uefi-ia32-bug/target/i686-unknown-uefi/debug/deps/libcfg_if-1cc9e79ab59a6754.rlib" "/var/home/nbishop/src/uefi-ia32-bug/target/i686-unknown-uefi/debug/deps/libbitflags-0b2f413d2b5a35a5.rlib" "/var/home/nbishop/src/uefi-ia32-bug/target/i686-unknown-uefi/debug/deps/libucs2-2bf73974fb6e0166.rlib" "/var/home/nbishop/src/uefi-ia32-bug/target/i686-unknown-uefi/debug/deps/libbit_field-064b526bc1b3300f.rlib" "/var/home/nbishop/src/uefi-ia32-bug/target/i686-unknown-uefi/debug/deps/liballoc-c018fd088d90b478.rlib" "/var/home/nbishop/src/uefi-ia32-bug/target/i686-unknown-uefi/debug/deps/librustc_std_workspace_core-ee7dd7b0b8b2aaf1.rlib" "/var/home/nbishop/src/uefi-ia32-bug/target/i686-unknown-uefi/debug/deps/libcore-05848db6c9136666.rlib" "/var/home/nbishop/src/uefi-ia32-bug/target/i686-unknown-uefi/debug/deps/libcompiler_builtins-399258b4cdd5a940.rlib" "/NXCOMPAT" "/LIBPATH:/var/home/nbishop/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/i686-unknown-uefi/lib" "/OUT:/var/home/nbishop/src/uefi-ia32-bug/target/i686-unknown-uefi/debug/deps/uefi_app-0f328129b38d8e14.efi" "/OPT:REF,NOICF" "/DEBUG" "/NODEFAULTLIB"
  = note: rust-lld: error: /safeseh: /tmp/rustcY04Gup/symbols.o is not compatible with SEH
          rust-lld: warning: section name .debug_frame is longer than 8 characters and will use a non-standard string table

This issue does not occur with x86_64-unknown-uefi or aarch64-unknown-uefi.

Bisect

searched nightlies: from nightly-2022-04-24 to nightly-2022-04-28
regressed nightly: nightly-2022-04-26
searched commit range: 18f314e...055bf4c
regressed commit: 18b53ce

bisected with cargo-bisect-rustc v0.6.3

Host triple: x86_64-unknown-linux-gnu
Reproduce with:

cargo bisect-rustc --with-src -- build --target i686-unknown-uefi 
@nicholasbishop nicholasbishop added C-bug Category: This is a bug. regression-untriaged Untriaged performance or correctness regression. labels Apr 28, 2022
@rustbot rustbot added the I-prioritize Issue: Indicates that prioritization has been requested for this issue. label Apr 28, 2022
@petrochenkov
Copy link
Contributor

petrochenkov commented Apr 28, 2022

cc @nbdd0121

This may potentially be reproducible with i686-pc-windows-msvc too.
UPD: It does reproduce on i686-pc-windows-msvc, even on hello-world, if LLD is used as a linker instead of link.exe.
UPD2: symbols.o needs to have one additional "feature-enabling" symbol on these targets, see feat00Flags in LLD sources.

@apiraino apiraino added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Apr 28, 2022
@apiraino
Copy link
Contributor

Assigning priority as discussed in the Zulip thread of the Prioritization Working Group.

@rustbot label -I-prioritize +P-medium

@rustbot rustbot added P-medium Medium priority and removed I-prioritize Issue: Indicates that prioritization has been requested for this issue. labels Apr 28, 2022
Dylan-DPC added a commit to Dylan-DPC/rust that referenced this issue Apr 29, 2022
Add `@feat.00` symbol to symbols.o for COFF

Fix rust-lang#96498

This is based on top of rust-lang#96444.

r? `@petrochenkov`
@bors bors closed this as completed in 48199e0 Apr 29, 2022
@nicholasbishop
Copy link
Contributor Author

Thanks for the quick fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. P-medium Medium priority regression-untriaged Untriaged performance or correctness regression. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants