Enable Static Builds for FreeBSD
Enable crt-static for FreeBSD to enable statically compiled binaries.
This commit is contained in:
parent
d73bd3fb3b
commit
adce3fd99b
@ -6,6 +6,7 @@ pub fn opts() -> TargetOptions {
|
|||||||
dynamic_linking: true,
|
dynamic_linking: true,
|
||||||
families: cvs!["unix"],
|
families: cvs!["unix"],
|
||||||
has_rpath: true,
|
has_rpath: true,
|
||||||
|
crt_static_respected: true,
|
||||||
position_independent_executables: true,
|
position_independent_executables: true,
|
||||||
relro_level: RelroLevel::Full,
|
relro_level: RelroLevel::Full,
|
||||||
abi_return_struct_as_int: true,
|
abi_return_struct_as_int: true,
|
||||||
|
@ -121,10 +121,16 @@
|
|||||||
#[link(name = "unwind", kind = "static", modifiers = "-bundle")]
|
#[link(name = "unwind", kind = "static", modifiers = "-bundle")]
|
||||||
extern "C" {}
|
extern "C" {}
|
||||||
|
|
||||||
#[cfg(any(target_os = "freebsd", target_os = "netbsd"))]
|
#[cfg(target_os = "netbsd")]
|
||||||
#[link(name = "gcc_s")]
|
#[link(name = "gcc_s")]
|
||||||
extern "C" {}
|
extern "C" {}
|
||||||
|
|
||||||
|
#[cfg(target_os = "freebsd")]
|
||||||
|
#[link(name = "gcc", kind = "static", modifiers = "-bundle", cfg(target_feature = "crt-static"))]
|
||||||
|
#[link(name = "gcc_eh", kind = "static", modifiers = "-bundle", cfg(target_feature = "crt-static"))]
|
||||||
|
#[link(name = "gcc_s", cfg(not(target_feature = "crt-static")))]
|
||||||
|
extern "C" {}
|
||||||
|
|
||||||
#[cfg(all(target_os = "openbsd", target_arch = "sparc64"))]
|
#[cfg(all(target_os = "openbsd", target_arch = "sparc64"))]
|
||||||
#[link(name = "gcc")]
|
#[link(name = "gcc")]
|
||||||
extern "C" {}
|
extern "C" {}
|
||||||
|
Loading…
Reference in New Issue
Block a user