Skip to content

Commit 56b669c

Browse files
committed
Disable libunwind cross-architecture unwinding
Building with _LIBUNWIND_IS_NATIVE_ONLY disables code for cross-architecture unwinding it is disabled by default in LLVM [1], replicate the cmake behavior in bootstrap process It also enables some additional code that handles PAC-specific unwind info it helps compiling with the -mbranch-protection=pac or -mbranch-protection=standard flags This fixes build with clang/musl on aarch64 [1] llvm/llvm-project@85624c5 Signed-off-by: Khem Raj <[email protected]>
1 parent 45f256d commit 56b669c

File tree

1 file changed

+1
-2
lines changed
  • src/bootstrap/src/core/build_steps

1 file changed

+1
-2
lines changed

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1430,6 +1430,7 @@ impl Step for Libunwind {
14301430
cfg.flag("-funwind-tables");
14311431
cfg.flag("-fvisibility=hidden");
14321432
cfg.define("_LIBUNWIND_DISABLE_VISIBILITY_ANNOTATIONS", None);
1433+
cfg.define("_LIBUNWIND_IS_NATIVE_ONLY", "1");
14331434
cfg.include(root.join("include"));
14341435
cfg.cargo_metadata(false);
14351436
cfg.out_dir(&out_dir);
@@ -1447,12 +1448,10 @@ impl Step for Libunwind {
14471448
cfg.define("__NO_STRING_INLINES", None);
14481449
cfg.define("__NO_MATH_INLINES", None);
14491450
cfg.define("_LIBUNWIND_IS_BAREMETAL", None);
1450-
cfg.define("__LIBUNWIND_IS_NATIVE_ONLY", None);
14511451
cfg.define("NDEBUG", None);
14521452
}
14531453
if self.target.is_windows() {
14541454
cfg.define("_LIBUNWIND_HIDE_SYMBOLS", "1");
1455-
cfg.define("_LIBUNWIND_IS_NATIVE_ONLY", "1");
14561455
}
14571456
}
14581457

0 commit comments

Comments
 (0)