Skip to content

Commit 12d84cc

Browse files
committed
update gcc crate
Use gcc::Build rather than deprecated gcc::Config. Fixes #43973
1 parent 204c0a4 commit 12d84cc

File tree

9 files changed

+29
-29
lines changed

9 files changed

+29
-29
lines changed

src/Cargo.lock

+18-18
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/bootstrap/bin/sccache-plus-cl.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ fn main() {
1818
// Locate the actual compiler that we're invoking
1919
env::remove_var("CC");
2020
env::remove_var("CXX");
21-
let mut cfg = gcc::Config::new();
21+
let mut cfg = gcc::Build::new();
2222
cfg.cargo_metadata(false)
2323
.out_dir("/")
2424
.target(&target)

src/bootstrap/cc.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ pub fn find(build: &mut Build) {
4545
// For all targets we're going to need a C compiler for building some shims
4646
// and such as well as for being a linker for Rust code.
4747
for target in build.targets.iter().chain(&build.hosts).cloned().chain(iter::once(build.build)) {
48-
let mut cfg = gcc::Config::new();
48+
let mut cfg = gcc::Build::new();
4949
cfg.cargo_metadata(false).opt_level(0).debug(false)
5050
.target(&target).host(&build.build);
5151

@@ -67,7 +67,7 @@ pub fn find(build: &mut Build) {
6767

6868
// For all host triples we need to find a C++ compiler as well
6969
for host in build.hosts.iter().cloned().chain(iter::once(build.build)) {
70-
let mut cfg = gcc::Config::new();
70+
let mut cfg = gcc::Build::new();
7171
cfg.cargo_metadata(false).opt_level(0).debug(false).cpp(true)
7272
.target(&host).host(&build.build);
7373
let config = build.config.target_config.get(&host);
@@ -82,7 +82,7 @@ pub fn find(build: &mut Build) {
8282
}
8383
}
8484

85-
fn set_compiler(cfg: &mut gcc::Config,
85+
fn set_compiler(cfg: &mut gcc::Build,
8686
gnu_compiler: &str,
8787
target: Interned<String>,
8888
config: Option<&Target>,

src/bootstrap/native.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ impl Step for TestHelpers {
289289
let _folder = build.fold_output(|| "build_test_helpers");
290290
println!("Building test helpers");
291291
t!(fs::create_dir_all(&dst));
292-
let mut cfg = gcc::Config::new();
292+
let mut cfg = gcc::Build::new();
293293

294294
// We may have found various cross-compilers a little differently due to our
295295
// extra configuration, so inform gcc of these compilers. Note, though, that

src/liballoc_jemalloc/build.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ fn main() {
6363
_ => return,
6464
};
6565

66-
let compiler = gcc::Config::new().get_compiler();
66+
let compiler = gcc::Build::new().get_compiler();
6767
// only msvc returns None for ar so unwrap is okay
6868
let ar = build_helper::cc2ar(compiler.path(), &target).unwrap();
6969
let cflags = compiler.args()
@@ -150,7 +150,7 @@ fn main() {
150150
// sure the symbols are available.
151151
if target.contains("androideabi") {
152152
println!("cargo:rerun-if-changed=pthread_atfork_dummy.c");
153-
gcc::Config::new()
153+
gcc::Build::new()
154154
.flag("-fvisibility=hidden")
155155
.file("pthread_atfork_dummy.c")
156156
.compile("libpthread_atfork_dummy.a");

src/libprofiler_builtins/build.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ use std::path::Path;
1919

2020
fn main() {
2121
let target = env::var("TARGET").expect("TARGET was not set");
22-
let cfg = &mut gcc::Config::new();
22+
let cfg = &mut gcc::Build::new();
2323

2424
let mut profile_sources = vec!["GCDAProfiling.c",
2525
"InstrProfiling.c",

src/librustc_llvm/build.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ fn main() {
136136
let mut cmd = Command::new(&llvm_config);
137137
cmd.arg("--cxxflags");
138138
let cxxflags = output(&mut cmd);
139-
let mut cfg = gcc::Config::new();
139+
let mut cfg = gcc::Build::new();
140140
for flag in cxxflags.split_whitespace() {
141141
// Ignore flags like `-m64` when we're doing a cross build
142142
if is_crossed && flag.starts_with("-m") {

src/librustdoc/build.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ extern crate gcc;
1414
fn main() {
1515
let src_dir = std::path::Path::new("../rt/hoedown/src");
1616
build_helper::rerun_if_changed_anything_in_dir(src_dir);
17-
let mut cfg = gcc::Config::new();
17+
let mut cfg = gcc::Build::new();
1818
cfg.file("../rt/hoedown/src/autolink.c")
1919
.file("../rt/hoedown/src/buffer.c")
2020
.file("../rt/hoedown/src/document.c")

src/libstd/build.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ fn main() {
7777
fn build_libbacktrace(host: &str, target: &str) -> Result<(), ()> {
7878
let native = native_lib_boilerplate("libbacktrace", "libbacktrace", "backtrace", ".libs")?;
7979

80-
let compiler = gcc::Config::new().get_compiler();
80+
let compiler = gcc::Build::new().get_compiler();
8181
// only msvc returns None for ar so unwrap is okay
8282
let ar = build_helper::cc2ar(compiler.path(), target).unwrap();
8383
let mut cflags = compiler.args().iter().map(|s| s.to_str().unwrap())

0 commit comments

Comments
 (0)