1 use crate::spec
::{LinkArgs, LinkerFlavor, TargetOptions}
;
2 use std
::default::Default
;
4 pub fn opts() -> TargetOptions
{
5 let mut late_link_args
= LinkArgs
::new();
9 // The illumos libc contains a stack unwinding implementation, as
10 // does libgcc_s. The latter implementation includes several
11 // additional symbols that are not always in base libc. To force
12 // the consistent use of just one unwinder, we ensure libc appears
13 // after libgcc_s in the NEEDED list for the resultant binary by
14 // ignoring any attempts to add it as a dynamic dependency until the
16 // FIXME: This should be replaced by a more complete and generic
17 // mechanism for controlling the order of library arguments passed
20 // LLVM will insert calls to the stack protector functions
21 // "__stack_chk_fail" and "__stack_chk_guard" into code in native
22 // object files. Some platforms include these symbols directly in
23 // libc, but at least historically these have been provided in
24 // libssp.so on illumos and Solaris systems.
30 os
: "illumos".to_string(),
31 dynamic_linking
: true,
34 families
: vec
!["unix".to_string()],
35 is_like_solaris
: true,
37 limit_rdylib_exports
: false, // Linker doesn't support this
38 eliminate_frame_pointer
: false,
39 eh_frame_header
: false,
42 // While we support ELF TLS, rust requires a way to register
43 // cleanup handlers (in C, this would be something along the lines of:
44 // void register_callback(void (*fn)(void *), void *arg);
45 // (see src/libstd/sys/unix/fast_thread_local.rs) that is currently
46 // missing in illumos. For now at least, we must fallback to using
47 // pthread_{get,set}specific.
50 // FIXME: Currently, rust is invoking cc to link, which ends up
51 // causing these to get included twice. We should eventually transition
52 // to having rustc invoke ld directly, in which case these will need to
55 // We want XPG6 behavior from libc and libm. See standards(5)
56 //pre_link_objects_exe: vec![
57 // "/usr/lib/amd64/values-Xc.o".to_string(),
58 // "/usr/lib/amd64/values-xpg6.o".to_string(),