Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
rustc_target: Avoid an inappropriate use of post_link_objects
  • Loading branch information
petrochenkov committed May 20, 2020
commit ed1297c92a77997178ad7aadb9d0cc087d15e0af
4 changes: 1 addition & 3 deletions src/librustc_target/spec/x86_64_fortanix_unknown_sgx.rs
Original file line number Diff line number Diff line change
@@ -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] = &[
Expand Down Expand Up @@ -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()
Expand Down
4 changes: 4 additions & 0 deletions src/libunwind/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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" {}