Skip to content

Commit

Permalink
Make libunwind build hermetic
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
petrhosek committed May 29, 2020
1 parent 96dd469 commit 21abc88
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/libunwind/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ mod llvm_libunwind {
cfg.flag("-fstrict-aliasing");
cfg.flag("-funwind-tables");
cfg.flag("-fvisibility=hidden");
cfg.flag_if_supported("-fvisibility-global-new-delete-hidden");
cfg.define("_LIBUNWIND_DISABLE_VISIBILITY_ANNOTATIONS", None);
}

let mut unwind_sources = vec![
Expand Down

0 comments on commit 21abc88

Please sign in to comment.