diff options
| author | Ralf Jung <post@ralfj.de> | 2020-05-22 08:54:51 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-05-22 08:54:51 +0200 |
| commit | 0eba15220d339f91f9cb01fdfa68d7d7caf85d13 (patch) | |
| tree | 4e41547e5b4598e7a9587938147069a076be9e94 | |
| parent | 715f1e84787b0e7a1d8b751eeece53f1afb848b4 (diff) | |
| parent | ed1297c92a77997178ad7aadb9d0cc087d15e0af (diff) | |
| download | rust-0eba15220d339f91f9cb01fdfa68d7d7caf85d13.tar.gz rust-0eba15220d339f91f9cb01fdfa68d7d7caf85d13.zip | |
Rollup merge of #72304 - petrochenkov:sgxunwind, r=nikomatsakis,jethrogb,dingelish
rustc_target: Avoid an inappropriate use of `post_link_objects` It isn't supposed to be used for linking libraries. Also linking libunwind unconditionally (and not together with the `src/libunwind` crate) is suspicious. @jethrogb @VardhanThigle Could you verify that it works as expected?
| -rw-r--r-- | src/librustc_target/spec/x86_64_fortanix_unknown_sgx.rs | 4 | ||||
| -rw-r--r-- | src/libunwind/lib.rs | 4 |
2 files changed, 5 insertions, 3 deletions
diff --git a/src/librustc_target/spec/x86_64_fortanix_unknown_sgx.rs b/src/librustc_target/spec/x86_64_fortanix_unknown_sgx.rs index d26efc09859..475a33af29c 100644 --- a/src/librustc_target/spec/x86_64_fortanix_unknown_sgx.rs +++ b/src/librustc_target/spec/x86_64_fortanix_unknown_sgx.rs @@ -1,6 +1,6 @@ use std::iter; -use super::{crt_objects, LinkerFlavor, LldFlavor, PanicStrategy, Target, TargetOptions}; +use super::{LinkerFlavor, LldFlavor, PanicStrategy, Target, TargetOptions}; pub fn target() -> Result<Target, String> { const PRE_LINK_ARGS: &[&str] = &[ @@ -68,8 +68,6 @@ pub fn target() -> Result<Target, String> { PRE_LINK_ARGS.iter().cloned().map(String::from).collect(), )) .collect(), - // FIXME: libunwind is certainly not a CRT object, use some other option instead. - post_link_objects: crt_objects::all("libunwind.a"), override_export_symbols: Some(EXPORT_SYMBOLS.iter().cloned().map(String::from).collect()), relax_elf_relocations: true, ..Default::default() diff --git a/src/libunwind/lib.rs b/src/libunwind/lib.rs index 18d41be7739..cc025da1af5 100644 --- a/src/libunwind/lib.rs +++ b/src/libunwind/lib.rs @@ -27,3 +27,7 @@ extern "C" {} #[link(name = "gcc_eh", kind = "static-nobundle", cfg(target_feature = "crt-static"))] #[link(name = "gcc_s", cfg(not(target_feature = "crt-static")))] extern "C" {} + +#[cfg(all(target_vendor = "fortanix", target_env = "sgx"))] +#[link(name = "unwind", kind = "static-nobundle")] +extern "C" {} |
