-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
link libunwind dynamically and allow controlling it via crt-static
on gnullvm targets
#122003
base: master
Are you sure you want to change the base?
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 Details
The 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. |
This works for downstream crates but breaks Rust's testsuite, probably because of the dynamic linking: @rustbot author |
Great! No need to apologize, there's no hurry. The updated changeset works perfectly for me (tested with commit libvips/build-win64-mxe@3235b79).
I've (finally) removed support for Windows ARM32 in my toolchain (see commit libvips/build-win64-mxe@7c5a368). Maintaining this (unsupported/untested) Windows target has become significantly more difficult, particularly when patching The main reason I continue using |
Yeah, this has been annoying and is second on my todo list, but I won't be able to fix it myself, so it's gonna take time. |
Co-authored-by: Kleis Auke Wolthuizen <[email protected]>
51b1136
to
d442cf5
Compare
crt-static
on gnullvm targetscrt-static
on gnullvm targets
I've been thinking of it, and I'm keen to default to dynamic libunwind. It's proved with other targets and the fact the tests otherwise failed with errors like:
means the previous approach might not have worked fully. @rustbot ready |
Alternative to #121794