about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2020-06-03 12:20:45 +0000
committerbors <bors@rust-lang.org>2020-06-03 12:20:45 +0000
commit6f4888845674837fd4b55adb66d9322e1973d7db (patch)
tree921e7c32c06a3fa3b5c443d13397a8e01385e92c
parentff4aff6ce0f216c8cb8d40f432efaacdaca8095b (diff)
parent21abc8879cddd0002ca1da2eaa0f8e27ef09fa99 (diff)
downloadrust-6f4888845674837fd4b55adb66d9322e1973d7db.tar.gz
rust-6f4888845674837fd4b55adb66d9322e1973d7db.zip
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.
-rw-r--r--src/libunwind/build.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/libunwind/build.rs b/src/libunwind/build.rs
index 1462639259c..00749d93d55 100644
--- a/src/libunwind/build.rs
+++ b/src/libunwind/build.rs
@@ -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![