Skip to content

Commit 3681220

Browse files
committed
Auto merge of #43975 - RalfJung:gcc, r=alexcrichton
use gcc::Build rather than deprecated gcc::Config I did `cargo update -p gcc` to upgrade only this package. Is there further process that should be follwoed when updating a build dependency from crates.io? r? @alexcrichton Fixes #43973
2 parents a209539 + 13cf229 commit 3681220

File tree

9 files changed

+34
-31
lines changed

9 files changed

+34
-31
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

+2-1
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,13 @@ 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)
2525
.host(&target)
2626
.opt_level(0)
27+
.warnings(false)
2728
.debug(false);
2829
let compiler = cfg.get_compiler();
2930

src/bootstrap/cc.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ 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();
49-
cfg.cargo_metadata(false).opt_level(0).debug(false)
48+
let mut cfg = gcc::Build::new();
49+
cfg.cargo_metadata(false).opt_level(0).warnings(false).debug(false)
5050
.target(&target).host(&build.build);
5151

5252
let config = build.config.target_config.get(&target);
@@ -67,8 +67,8 @@ 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();
71-
cfg.cargo_metadata(false).opt_level(0).debug(false).cpp(true)
70+
let mut cfg = gcc::Build::new();
71+
cfg.cargo_metadata(false).opt_level(0).warnings(false).debug(false).cpp(true)
7272
.target(&host).host(&build.build);
7373
let config = build.config.target_config.get(&host);
7474
if let Some(cxx) = config.and_then(|c| c.cxx.as_ref()) {
@@ -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

+2-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
@@ -306,6 +306,7 @@ impl Step for TestHelpers {
306306
.target(&target)
307307
.host(&build.build)
308308
.opt_level(0)
309+
.warnings(false)
309310
.debug(false)
310311
.file(build.src.join("src/rt/rust_test_helpers.c"))
311312
.compile("librust_test_helpers.a");

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

+2-1
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,8 @@ 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();
140+
cfg.warnings(false);
140141
for flag in cxxflags.split_whitespace() {
141142
// Ignore flags like `-m64` when we're doing a cross build
142143
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)