mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 14:55:26 +00:00
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?
This commit is contained in:
commit
0eba15220d
@ -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()
|
||||
|
@ -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" {}
|
||||
|
Loading…
Reference in New Issue
Block a user