Skip to content

Commit ed1297c

Browse files
committed
rustc_target: Avoid an inappropriate use of post_link_objects
1 parent f182c4a commit ed1297c

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/librustc_target/spec/x86_64_fortanix_unknown_sgx.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use std::iter;
22

3-
use super::{crt_objects, LinkerFlavor, LldFlavor, PanicStrategy, Target, TargetOptions};
3+
use super::{LinkerFlavor, LldFlavor, PanicStrategy, Target, TargetOptions};
44

55
pub fn target() -> Result<Target, String> {
66
const PRE_LINK_ARGS: &[&str] = &[
@@ -68,8 +68,6 @@ pub fn target() -> Result<Target, String> {
6868
PRE_LINK_ARGS.iter().cloned().map(String::from).collect(),
6969
))
7070
.collect(),
71-
// FIXME: libunwind is certainly not a CRT object, use some other option instead.
72-
post_link_objects: crt_objects::all("libunwind.a"),
7371
override_export_symbols: Some(EXPORT_SYMBOLS.iter().cloned().map(String::from).collect()),
7472
relax_elf_relocations: true,
7573
..Default::default()

src/libunwind/lib.rs

+4
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,7 @@ extern "C" {}
2727
#[link(name = "gcc_eh", kind = "static-nobundle", cfg(target_feature = "crt-static"))]
2828
#[link(name = "gcc_s", cfg(not(target_feature = "crt-static")))]
2929
extern "C" {}
30+
31+
#[cfg(all(target_vendor = "fortanix", target_env = "sgx"))]
32+
#[link(name = "unwind", kind = "static-nobundle")]
33+
extern "C" {}

0 commit comments

Comments
 (0)