Skip to content

Commit 3bde54f

Browse files
committedNov 4, 2021
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 072d6de + fd331f6 commit 3bde54f

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
@@ -361,7 +361,12 @@ pub static CLOCK_THREAD_CPUTIME_ID: clockid_t =
361361

362362
#[cfg_attr(
363363
feature = "rustc-dep-of-std",
364-
link(name = "c", kind = "static", cfg(target_feature = "crt-static"))
364+
link(
365+
name = "c",
366+
kind = "static",
367+
modifiers = "-bundle",
368+
cfg(target_feature = "crt-static")
369+
)
365370
)]
366371
#[cfg_attr(
367372
feature = "rustc-dep-of-std",

0 commit comments

Comments
 (0)
Please sign in to comment.