Skip to content

Commit e6c1f68

Browse files
committed
Auto merge of #122003 - mati865:gnullvm-build-libunwind, r=<try>
Build libunwind for pc-windows-gnullvm Alternative to #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 ```
2 parents bdde2a8 + fd2b23b commit e6c1f68

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/bootstrap/src/core/build_steps/compile.rs

+1
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,7 @@ fn copy_third_party_objects(
340340
}
341341

342342
if target == "x86_64-fortanix-unknown-sgx"
343+
|| target.contains("pc-windows-gnullvm")
343344
|| builder.config.llvm_libunwind(target) == LlvmLibunwind::InTree
344345
&& (target.contains("linux") || target.contains("fuchsia"))
345346
{

src/bootstrap/src/core/build_steps/llvm.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1237,7 +1237,7 @@ impl Step for Libunwind {
12371237
}
12381238

12391239
let out_dir = builder.native_dir(self.target).join("libunwind");
1240-
let root = builder.src.join("src/llvm-project/libunwind");
1240+
let root = builder.src.join("src").join("llvm-project").join("libunwind");
12411241

12421242
if up_to_date(&root, &out_dir.join("libunwind.a")) {
12431243
return out_dir;
@@ -1271,6 +1271,7 @@ impl Step for Libunwind {
12711271
cfg.flag("-fvisibility=hidden");
12721272
cfg.define("_LIBUNWIND_DISABLE_VISIBILITY_ANNOTATIONS", None);
12731273
cfg.include(root.join("include"));
1274+
cfg.include(root.join("src"));
12741275
cfg.cargo_metadata(false);
12751276
cfg.out_dir(&out_dir);
12761277

0 commit comments

Comments
 (0)