Skip to content
Snippets Groups Projects
Unverified Commit 9c17cad7 authored by Yuki Okushi's avatar Yuki Okushi Committed by GitHub
Browse files

Merge pull request #1899 from joshtriplett/support-static-glibc

parents b3f8975d 5bf6ee5d
No related branches found
No related tags found
No related merge requests found
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
// Attributes needed when building as part of the standard library // Attributes needed when building as part of the standard library
#![cfg_attr( #![cfg_attr(
feature = "rustc-dep-of-std", feature = "rustc-dep-of-std",
feature(cfg_target_vendor, link_cfg, no_core) feature(cfg_target_vendor, link_cfg, no_core, static_nobundle)
)] )]
#![cfg_attr(libc_thread_local, feature(thread_local))] #![cfg_attr(libc_thread_local, feature(thread_local))]
// Enable extra lints: // Enable extra lints:
......
...@@ -410,7 +410,6 @@ pub const SYS_pkey_alloc: ::c_long = 330; ...@@ -410,7 +410,6 @@ pub const SYS_pkey_alloc: ::c_long = 330;
pub const SYS_pkey_free: ::c_long = 331; pub const SYS_pkey_free: ::c_long = 331;
pub const SYS_statx: ::c_long = 332; pub const SYS_statx: ::c_long = 332;
#[link(name = "util")]
extern "C" { extern "C" {
pub fn sysctl( pub fn sysctl(
name: *mut ::c_int, name: *mut ::c_int,
......
...@@ -1362,7 +1362,6 @@ extern "C" { ...@@ -1362,7 +1362,6 @@ extern "C" {
) -> ::c_int; ) -> ::c_int;
} }
#[link(name = "util")]
extern "C" { extern "C" {
pub fn ioctl(fd: ::c_int, request: ::c_ulong, ...) -> ::c_int; pub fn ioctl(fd: ::c_int, request: ::c_ulong, ...) -> ::c_int;
pub fn backtrace(buf: *mut *mut ::c_void, sz: ::c_int) -> ::c_int; pub fn backtrace(buf: *mut *mut ::c_void, sz: ::c_int) -> ::c_int;
...@@ -1436,7 +1435,6 @@ extern "C" { ...@@ -1436,7 +1435,6 @@ extern "C" {
) -> ::c_int; ) -> ::c_int;
} }
#[link(name = "dl")]
extern "C" { extern "C" {
pub fn dlmopen( pub fn dlmopen(
lmid: Lmid_t, lmid: Lmid_t,
......
...@@ -298,6 +298,32 @@ cfg_if! { ...@@ -298,6 +298,32 @@ cfg_if! {
} else if #[cfg(feature = "std")] { } else if #[cfg(feature = "std")] {
// cargo build, don't pull in anything extra as the libstd dep // cargo build, don't pull in anything extra as the libstd dep
// already pulls in all libs. // already pulls in all libs.
} else if #[cfg(all(target_os = "linux",
target_env = "gnu",
feature = "rustc-dep-of-std"))] {
#[link(name = "util", kind = "static-nobundle",
cfg(target_feature = "crt-static"))]
#[link(name = "rt", kind = "static-nobundle",
cfg(target_feature = "crt-static"))]
#[link(name = "pthread", kind = "static-nobundle",
cfg(target_feature = "crt-static"))]
#[link(name = "m", kind = "static-nobundle",
cfg(target_feature = "crt-static"))]
#[link(name = "dl", kind = "static-nobundle",
cfg(target_feature = "crt-static"))]
#[link(name = "c", kind = "static-nobundle",
cfg(target_feature = "crt-static"))]
#[link(name = "gcc_eh", kind = "static-nobundle",
cfg(target_feature = "crt-static"))]
#[link(name = "gcc", kind = "static-nobundle",
cfg(target_feature = "crt-static"))]
#[link(name = "util", cfg(not(target_feature = "crt-static")))]
#[link(name = "rt", cfg(not(target_feature = "crt-static")))]
#[link(name = "pthread", cfg(not(target_feature = "crt-static")))]
#[link(name = "m", cfg(not(target_feature = "crt-static")))]
#[link(name = "dl", cfg(not(target_feature = "crt-static")))]
#[link(name = "c", cfg(not(target_feature = "crt-static")))]
extern {}
} else if #[cfg(target_env = "musl")] { } else if #[cfg(target_env = "musl")] {
#[cfg_attr(feature = "rustc-dep-of-std", #[cfg_attr(feature = "rustc-dep-of-std",
link(name = "c", kind = "static", link(name = "c", kind = "static",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment