Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Repace use of static_nobundle with native_link_modifiers within Rust codebase #90205

Merged
merged 2 commits into from
Oct 30, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions compiler/rustc_llvm/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ fn main() {
let path = PathBuf::from(s);
println!("cargo:rustc-link-search=native={}", path.parent().unwrap().display());
if target.contains("windows") {
println!("cargo:rustc-link-lib=static-nobundle={}", stdcppname);
println!("cargo:rustc-link-lib=static:-bundle={}", stdcppname);
} else {
println!("cargo:rustc-link-lib=static={}", stdcppname);
}
Expand All @@ -302,6 +302,6 @@ fn main() {
// Libstdc++ depends on pthread which Rust doesn't link on MinGW
// since nothing else requires it.
if target.contains("windows-gnu") {
println!("cargo:rustc-link-lib=static-nobundle=pthread");
println!("cargo:rustc-link-lib=static:-bundle=pthread");
}
}
2 changes: 1 addition & 1 deletion compiler/rustc_llvm/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#![feature(nll)]
#![feature(static_nobundle)]
#![feature(native_link_modifiers)]
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]

// NOTE: This crate only exists to allow linking on mingw targets.
Expand Down
1 change: 0 additions & 1 deletion library/unwind/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#![feature(native_link_modifiers_bundle)]
#![feature(nll)]
#![feature(staged_api)]
#![feature(static_nobundle)]
#![feature(c_unwind)]
#![cfg_attr(not(target_env = "msvc"), feature(libc))]

Expand Down
2 changes: 0 additions & 2 deletions src/test/run-make-fulldeps/foreign-exceptions/foo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
// are caught by catch_unwind. Also tests that Rust panics can unwind through
// C++ code.

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

use std::panic::{catch_unwind, AssertUnwindSafe};
Expand Down
4 changes: 2 additions & 2 deletions src/test/run-make-fulldeps/tools.mk
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,10 @@ else
# that it is compiled with the expectation that pthreads is dynamically
# linked as a DLL and will fail to link with a statically linked libpthread.
#
# So we end up with the following hack: we link use static-nobundle to only
# So we end up with the following hack: we link use static:-bundle to only
# link the parts of libstdc++ that we actually use, which doesn't include
# the dependency on the pthreads DLL.
EXTRARSCXXFLAGS := -l static-nobundle=stdc++
EXTRARSCXXFLAGS := -l static:-bundle=stdc++ -Z unstable-options
endif
else
ifeq ($(UNAME),Darwin)
Expand Down
3 changes: 0 additions & 3 deletions src/test/run-make/issue-36710/foo.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
// Tests that linking to C++ code with global destructors works.

// For linking libstdc++ on MinGW
#![cfg_attr(all(windows, target_env = "gnu"), feature(static_nobundle))]

extern "C" {
fn get() -> u32;
}
Expand Down