Skip to content

Commit 2609fab

Browse files
committed
Auto merge of rust-lang#90205 - mati865:link-modifiers-in-rustc, r=petrochenkov
Repace use of `static_nobundle` with `native_link_modifiers` within Rust codebase This fixes warnings when building Rust and running tests: ``` warning: library kind `static-nobundle` has been superseded by specifying `-bundle` on library kind `static`. Try `static:-bundle` warning: `rustc_llvm` (lib) generated 2 warnings (1 duplicate) ```
2 parents 9f13083 + 533247c commit 2609fab

File tree

6 files changed

+5
-11
lines changed

6 files changed

+5
-11
lines changed

Diff for: compiler/rustc_llvm/build.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ fn main() {
288288
let path = PathBuf::from(s);
289289
println!("cargo:rustc-link-search=native={}", path.parent().unwrap().display());
290290
if target.contains("windows") {
291-
println!("cargo:rustc-link-lib=static-nobundle={}", stdcppname);
291+
println!("cargo:rustc-link-lib=static:-bundle={}", stdcppname);
292292
} else {
293293
println!("cargo:rustc-link-lib=static={}", stdcppname);
294294
}
@@ -302,6 +302,6 @@ fn main() {
302302
// Libstdc++ depends on pthread which Rust doesn't link on MinGW
303303
// since nothing else requires it.
304304
if target.contains("windows-gnu") {
305-
println!("cargo:rustc-link-lib=static-nobundle=pthread");
305+
println!("cargo:rustc-link-lib=static:-bundle=pthread");
306306
}
307307
}

Diff for: compiler/rustc_llvm/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#![feature(nll)]
2-
#![feature(static_nobundle)]
2+
#![feature(native_link_modifiers)]
33
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
44

55
// NOTE: This crate only exists to allow linking on mingw targets.

Diff for: library/unwind/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
#![feature(native_link_modifiers_bundle)]
66
#![feature(nll)]
77
#![feature(staged_api)]
8-
#![feature(static_nobundle)]
98
#![feature(c_unwind)]
109
#![cfg_attr(not(target_env = "msvc"), feature(libc))]
1110

Diff for: src/test/run-make-fulldeps/foreign-exceptions/foo.rs

-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
// are caught by catch_unwind. Also tests that Rust panics can unwind through
33
// C++ code.
44

5-
// For linking libstdc++ on MinGW
6-
#![cfg_attr(all(windows, target_env = "gnu"), feature(static_nobundle))]
75
#![feature(c_unwind)]
86

97
use std::panic::{catch_unwind, AssertUnwindSafe};

Diff for: src/test/run-make-fulldeps/tools.mk

+2-2
Original file line numberDiff line numberDiff line change
@@ -117,10 +117,10 @@ else
117117
# that it is compiled with the expectation that pthreads is dynamically
118118
# linked as a DLL and will fail to link with a statically linked libpthread.
119119
#
120-
# So we end up with the following hack: we link use static-nobundle to only
120+
# So we end up with the following hack: we link use static:-bundle to only
121121
# link the parts of libstdc++ that we actually use, which doesn't include
122122
# the dependency on the pthreads DLL.
123-
EXTRARSCXXFLAGS := -l static-nobundle=stdc++
123+
EXTRARSCXXFLAGS := -l static:-bundle=stdc++ -Z unstable-options
124124
endif
125125
else
126126
ifeq ($(UNAME),Darwin)

Diff for: src/test/run-make/issue-36710/foo.rs

-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
// Tests that linking to C++ code with global destructors works.
22

3-
// For linking libstdc++ on MinGW
4-
#![cfg_attr(all(windows, target_env = "gnu"), feature(static_nobundle))]
5-
63
extern "C" {
74
fn get() -> u32;
85
}

0 commit comments

Comments
 (0)