Skip to content

Commit 6f48888

Browse files
committed
Auto merge of #72746 - petrhosek:libunwind-hermetic, r=tmandry
Make libunwind build hermetic We want to avoid exporting any symbols from Rust's version of libunwind, and to do so we need to disable visibility annotations to make sure that the -fvisibility=hidden has effect, and also hide global new/delete. This matches the CMake build of libunwind.
2 parents ff4aff6 + 21abc88 commit 6f48888

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/libunwind/build.rs

+2
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,8 @@ mod llvm_libunwind {
9090
cfg.flag("-fstrict-aliasing");
9191
cfg.flag("-funwind-tables");
9292
cfg.flag("-fvisibility=hidden");
93+
cfg.flag_if_supported("-fvisibility-global-new-delete-hidden");
94+
cfg.define("_LIBUNWIND_DISABLE_VISIBILITY_ANNOTATIONS", None);
9395
}
9496

9597
let mut unwind_sources = vec![

0 commit comments

Comments
 (0)