-
Notifications
You must be signed in to change notification settings - Fork 12.5k
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
Build libunwind for pc-windows-gnullvm #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 |
Alternative to #121794
The changes in this PR:
pc-windows-gnullvm
targetsjoin()
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"
libunwind/src
, some of the includes are located insidesrc
and without this change the build fails with: