-
-
Notifications
You must be signed in to change notification settings - Fork 14.3k
link libunwind dynamically and allow controlling it via crt-static on gnullvm targets
#122003
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
Conversation
|
rustbot has assigned @albertlarsan68. Use r? to explicitly pick a reviewer |
|
This PR changes how LLVM is built. Consider updating src/bootstrap/download-ci-llvm-stamp. |
|
Appears to work with both native toolchain and using @rustbot author |
|
Hello, |
|
Yes, this is intended. I want to try building from Linux host using Cargo's |
|
@bors try |
…try> Build libunwind for pc-windows-gnullvm Alternative to rust-lang#121794 The changes in this PR: - build libunwind for `pc-windows-gnullvm` targets - join paths with `join()` instead of slashes to avoid mixing slashes on windows, this changes it them from `"H:\\projects\\rust\\src/llvm-project/libunwind\\include"` to `"H:\\projects\\rust\\src\\llvm-project\\libunwind\\include"` - include `libunwind/src`, some of the includes are located inside `src` and without this change the build fails with: ``` running: "h:/msys64/clang64/bin/clang++.exe" "-O3" "-ffunction-sections" "-fdata-sections" "--target=x86_64-pc-windows-gnullvm" "-I" "H:\\projects\\rust\\src\\llvm-project\\libunwind\\include" "-nostdinc++" "-fno-exceptions" "-fno-rtti" "-fstrict-aliasing" "-funwind-tables" "-fvisibility=hidden" "-fvisibility-global-new-delete-hidden" "-D_LIBUNWIND_DISABLE_VISIBILITY_ANNOTATIONS" "-D_LIBUNWIND_HIDE_SYMBOLS=1" "-D_LIBUNWIND_IS_NATIVE_ONLY=1" "-o" "H:\\projects\\rust\\build\\x86_64-pc-windows-gnullvm\\native\\libunwind\\Unwind-EHABI.o" "-c" "\\\\?\\H:\\projects\\rust\\src\\llvm-project\\libunwind\\src\\Unwind-EHABI.cpp" cargo:warning=\\?\H:\projects\rust\src\llvm-project\libunwind\src\Unwind-EHABI.cpp:12:10: fatal error: 'Unwind-EHABI.h' file not found cargo:warning= 12 | #include "Unwind-EHABI.h" cargo:warning= | ^~~~~~~~~~~~~~~~ cargo:warning=1 error generated. exit code: 1 ```
|
☀️ Try build successful - checks-actions |
|
As expected libunwind is not built by Details
@kleisauke with this PR and #121712 Rust will ship prebuilt |
Just wondering, would
Great! I think that would be very useful.
Unfortunately, I'm still using |
I had thought of it previously but it feels hacky. System can provide both static and shared libunwind but this feature would have to be limited to shared only. Or maybe it's just my point of view?
I'll ask on Zulip to see if anybody has any idea but I want to test something first. |
If you use |
|
Sorry, I was a bit busy with other things. Thanks, indeed this was the case but apparently the problem was more complex. When I test with native gnullvm toolchain (built and installed with DetailsNote: this Cargo binary was built with Restoring Then I tried to cross compile (with DetailsNote: this Cargo binary is a bit older nightly: That wouldn't be big deal if the final binary was linked to target's std but somehow if host == target it gets linked to host's std (probably the prebuilt one in sysroot). Finally cross compiling from working windows-gnu toolchain gave the expected result: DetailsNote: Cargo is the same but Rustc prints all Logs from a working build are very different from the failing ones, so I've decided to run it with DetailsThe conclusion is there is some weirdness (hopefully caused by unknown difference between official dist and my setup) to What needs to be sorted out is whether we want to use |
|
Perhaps you should set
(untested, but noticed that for FreeBSD something similar was done in commit adce3fd) |
|
@mati865 any updates on this? thanks |
fd2b23b to
51b1136
Compare
crt-static on gnullvm targets
|
@kleisauke first off, sorry taking so long. #119229 had drained my battery for a while. I'm sure I have tested something similar to what you have posted, but it didn't work that time (maybe I have missed something back then). @rustbot ready |
|
These commits modify compiler targets. |
|
@rustbot r? compiler |
|
r? @petrochenkov (this modifies windows-gnullvm base spec, I think u might know a bit about this target) |
|
@bors r+ |
…=petrochenkov link libunwind dynamically and allow controlling it via `crt-static` on gnullvm targets Alternative to rust-lang#121794 ``` $ cargo b -r Finished `release` profile [optimized] target(s) in 0.38s $ ntldd target/release/hello.exe | rg unwind libunwind.dll => H:\msys64\clang64\bin\libunwind.dll (0x0000020c35df0000) $ RUSTFLAGS="-C target-feature=+crt-static" cargo b -r Finished `release` profile [optimized] target(s) in 0.23s $ ntldd target/release/hello.exe | rg unwind ```
…llaumeGomez Rollup of 8 pull requests Successful merges: - rust-lang#122003 (link libunwind dynamically and allow controlling it via `crt-static` on gnullvm targets) - rust-lang#133122 (Add unpolished, experimental support for AFIDT (async fn in dyn trait)) - rust-lang#133859 (Move some alloc tests to the alloctests crate) - rust-lang#134095 ([CI] Use a lockfile for installing the `datadog` package) - rust-lang#134155 (Forbid `unsafe_op_in_unsafe_fn` for Hurd) - rust-lang#134173 (allow `symbol_intern_string_literal` lint in test modules) - rust-lang#134178 (Stabilize the Rust 2024 prelude) - rust-lang#134179 (Remove outdated consteval note from `<*mut T>::align_offset` docs.) r? `@ghost` `@rustbot` modify labels: rollup
…=petrochenkov link libunwind dynamically and allow controlling it via `crt-static` on gnullvm targets Alternative to rust-lang#121794 ``` $ cargo b -r Finished `release` profile [optimized] target(s) in 0.38s $ ntldd target/release/hello.exe | rg unwind libunwind.dll => H:\msys64\clang64\bin\libunwind.dll (0x0000020c35df0000) $ RUSTFLAGS="-C target-feature=+crt-static" cargo b -r Finished `release` profile [optimized] target(s) in 0.23s $ ntldd target/release/hello.exe | rg unwind ```
Rollup of 13 pull requests Successful merges: - rust-lang#122003 (link libunwind dynamically and allow controlling it via `crt-static` on gnullvm targets) - rust-lang#133122 (Add unpolished, experimental support for AFIDT (async fn in dyn trait)) - rust-lang#133859 (Move some alloc tests to the alloctests crate) - rust-lang#134070 (Some asm! diagnostic adjustments and a papercut fix) - rust-lang#134095 ([CI] Use a lockfile for installing the `datadog` package) - rust-lang#134144 (Properly consider APITs for never type fallback ascription fix) - rust-lang#134152 (Simplify `rustc_mir_dataflow::abs_domain`.) - rust-lang#134154 (suppress field expr with generics error message if it's a method) - rust-lang#134155 (Forbid `unsafe_op_in_unsafe_fn` for Hurd) - rust-lang#134173 (allow `symbol_intern_string_literal` lint in test modules) - rust-lang#134178 (Stabilize the Rust 2024 prelude) - rust-lang#134179 (Remove outdated consteval note from `<*mut T>::align_offset` docs.) - rust-lang#134187 (Remove `PErr`.) r? `@ghost` `@rustbot` modify labels: rollup
…iaskrgr Rollup of 11 pull requests Successful merges: - rust-lang#122003 (link libunwind dynamically and allow controlling it via `crt-static` on gnullvm targets) - rust-lang#133859 (Move some alloc tests to the alloctests crate) - rust-lang#134070 (Some asm! diagnostic adjustments and a papercut fix) - rust-lang#134144 (Properly consider APITs for never type fallback ascription fix) - rust-lang#134152 (Simplify `rustc_mir_dataflow::abs_domain`.) - rust-lang#134154 (suppress field expr with generics error message if it's a method) - rust-lang#134155 (Forbid `unsafe_op_in_unsafe_fn` for Hurd) - rust-lang#134173 (allow `symbol_intern_string_literal` lint in test modules) - rust-lang#134178 (Stabilize the Rust 2024 prelude) - rust-lang#134179 (Remove outdated consteval note from `<*mut T>::align_offset` docs.) - rust-lang#134187 (Remove `PErr`.) r? `@ghost` `@rustbot` modify labels: rollup
Alternative to #121794