From 2e8f7051e4714f51ecc9e1eaeb5af878fbd5d262 Mon Sep 17 00:00:00 2001 From: Josh Triplett Date: Thu, 1 Oct 2020 11:13:13 -0700 Subject: [PATCH] Add comment explaining why libunwind doesn't need to link libgcc_eh --- library/unwind/src/lib.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/library/unwind/src/lib.rs b/library/unwind/src/lib.rs index d34abb7e73dba..e7fa37bc9db19 100644 --- a/library/unwind/src/lib.rs +++ b/library/unwind/src/lib.rs @@ -42,6 +42,9 @@ cfg_if::cfg_if! { #[link(name = "gcc_s", cfg(not(target_feature = "crt-static")))] extern "C" {} +// When building with crt-static, we get `gcc_eh` from the `libc` crate, since +// glibc needs it, and needs it listed later on the linker command line. We +// don't want to duplicate it here. #[cfg(all(target_os = "linux", target_env = "gnu", not(feature = "llvm-libunwind")))] #[link(name = "gcc_s", cfg(not(target_feature = "crt-static")))] extern "C" {}