Skip to content

Commit 3b1f0ba

Browse files
committed
Auto merge of #2272 - 12101111:musl-bundle, r=Amanieu
Use link modifiers -bundle on musl and wasi target Implement rust-lang/rust#72274 Fix: - rust-lang/wg-cargo-std-aware#66 - rust-lang/rust#89626 TODO: - [x] Implement rustbuild side change: rust-lang/rust#90527
2 parents d5401c9 + fd331f6 commit 3b1f0ba

File tree

3 files changed

+17
-12
lines changed

3 files changed

+17
-12
lines changed

src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
#![cfg_attr(feature = "rustc-dep-of-std", no_core)]
2727
#![cfg_attr(
2828
any(feature = "rustc-dep-of-std", target_os = "redox"),
29-
feature(static_nobundle)
29+
feature(static_nobundle, native_link_modifiers, native_link_modifiers_bundle)
3030
)]
3131
#![cfg_attr(libc_const_extern_fn, feature(const_extern_fn))]
3232

src/unix/mod.rs

+10-10
Original file line numberDiff line numberDiff line change
@@ -305,21 +305,21 @@ cfg_if! {
305305
} else if #[cfg(all(target_os = "linux",
306306
any(target_env = "gnu", target_env = "uclibc"),
307307
feature = "rustc-dep-of-std"))] {
308-
#[link(name = "util", kind = "static-nobundle",
308+
#[link(name = "util", kind = "static", modifiers = "-bundle",
309309
cfg(target_feature = "crt-static"))]
310-
#[link(name = "rt", kind = "static-nobundle",
310+
#[link(name = "rt", kind = "static", modifiers = "-bundle",
311311
cfg(target_feature = "crt-static"))]
312-
#[link(name = "pthread", kind = "static-nobundle",
312+
#[link(name = "pthread", kind = "static", modifiers = "-bundle",
313313
cfg(target_feature = "crt-static"))]
314-
#[link(name = "m", kind = "static-nobundle",
314+
#[link(name = "m", kind = "static", modifiers = "-bundle",
315315
cfg(target_feature = "crt-static"))]
316-
#[link(name = "dl", kind = "static-nobundle",
316+
#[link(name = "dl", kind = "static", modifiers = "-bundle",
317317
cfg(target_feature = "crt-static"))]
318-
#[link(name = "c", kind = "static-nobundle",
318+
#[link(name = "c", kind = "static", modifiers = "-bundle",
319319
cfg(target_feature = "crt-static"))]
320-
#[link(name = "gcc_eh", kind = "static-nobundle",
320+
#[link(name = "gcc_eh", kind = "static", modifiers = "-bundle",
321321
cfg(target_feature = "crt-static"))]
322-
#[link(name = "gcc", kind = "static-nobundle",
322+
#[link(name = "gcc", kind = "static", modifiers = "-bundle",
323323
cfg(target_feature = "crt-static"))]
324324
#[link(name = "util", cfg(not(target_feature = "crt-static")))]
325325
#[link(name = "rt", cfg(not(target_feature = "crt-static")))]
@@ -330,7 +330,7 @@ cfg_if! {
330330
extern {}
331331
} else if #[cfg(target_env = "musl")] {
332332
#[cfg_attr(feature = "rustc-dep-of-std",
333-
link(name = "c", kind = "static",
333+
link(name = "c", kind = "static", modifiers = "-bundle",
334334
cfg(target_feature = "crt-static")))]
335335
#[cfg_attr(feature = "rustc-dep-of-std",
336336
link(name = "c", cfg(not(target_feature = "crt-static"))))]
@@ -372,7 +372,7 @@ cfg_if! {
372372
extern {}
373373
} else if #[cfg(target_os = "redox")] {
374374
#[cfg_attr(feature = "rustc-dep-of-std",
375-
link(name = "c", kind = "static-nobundle",
375+
link(name = "c", kind = "static", modifiers = "-bundle",
376376
cfg(target_feature = "crt-static")))]
377377
#[cfg_attr(feature = "rustc-dep-of-std",
378378
link(name = "c", cfg(not(target_feature = "crt-static"))))]

src/wasi.rs

+6-1
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,12 @@ pub const _SC_SYMLOOP_MAX: c_int = 173;
344344

345345
#[cfg_attr(
346346
feature = "rustc-dep-of-std",
347-
link(name = "c", kind = "static", cfg(target_feature = "crt-static"))
347+
link(
348+
name = "c",
349+
kind = "static",
350+
modifiers = "-bundle",
351+
cfg(target_feature = "crt-static")
352+
)
348353
)]
349354
#[cfg_attr(
350355
feature = "rustc-dep-of-std",

0 commit comments

Comments
 (0)