Skip to content

Commit 69a4406

Browse files
committed
Update to the cc crate
This is the name the `gcc` crate has moved to
1 parent 534f11a commit 69a4406

File tree

20 files changed

+56
-56
lines changed

20 files changed

+56
-56
lines changed

src/Cargo.lock

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

src/bootstrap/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ cmake = "0.1.23"
3434
filetime = "0.1"
3535
num_cpus = "1.0"
3636
getopts = "0.2"
37-
gcc = "0.3.54"
37+
cc = "1.0"
3838
libc = "0.2"
3939
serde = "1.0.8"
4040
serde_derive = "1.0.8"

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
extern crate gcc;
11+
extern crate cc;
1212

1313
use std::env;
1414
use std::process::{self, Command};
@@ -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::Build::new();
21+
let mut cfg = cc::Build::new();
2222
cfg.cargo_metadata(false)
2323
.out_dir("/")
2424
.target(&target)

src/bootstrap/cc.rs renamed to src/bootstrap/cc_detect.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
//! 6. "cc"
2424
//!
2525
//! Some of this logic is implemented here, but much of it is farmed out to the
26-
//! `gcc` crate itself, so we end up having the same fallbacks as there.
26+
//! `cc` crate itself, so we end up having the same fallbacks as there.
2727
//! Similar logic is then used to find a C++ compiler, just some s/cc/c++/ is
2828
//! used.
2929
//!
@@ -35,7 +35,7 @@ use std::process::Command;
3535
use std::iter;
3636

3737
use build_helper::{cc2ar, output};
38-
use gcc;
38+
use cc;
3939

4040
use Build;
4141
use config::Target;
@@ -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::Build::new();
48+
let mut cfg = cc::Build::new();
4949
cfg.cargo_metadata(false).opt_level(0).warnings(false).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::Build::new();
70+
let mut cfg = cc::Build::new();
7171
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);
@@ -82,7 +82,7 @@ pub fn find(build: &mut Build) {
8282
}
8383
}
8484

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

src/bootstrap/lib.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ extern crate lazy_static;
126126
extern crate serde_json;
127127
extern crate cmake;
128128
extern crate filetime;
129-
extern crate gcc;
129+
extern crate cc;
130130
extern crate getopts;
131131
extern crate num_cpus;
132132
extern crate toml;
@@ -148,7 +148,7 @@ use build_helper::{run_silent, run_suppressed, try_run_silent, try_run_suppresse
148148

149149
use util::{exe, libdir, OutputFolder, CiEnv};
150150

151-
mod cc;
151+
mod cc_detect;
152152
mod channel;
153153
mod check;
154154
mod clean;
@@ -241,9 +241,9 @@ pub struct Build {
241241

242242
// Runtime state filled in later on
243243
// target -> (cc, ar)
244-
cc: HashMap<Interned<String>, (gcc::Tool, Option<PathBuf>)>,
244+
cc: HashMap<Interned<String>, (cc::Tool, Option<PathBuf>)>,
245245
// host -> (cc, ar)
246-
cxx: HashMap<Interned<String>, gcc::Tool>,
246+
cxx: HashMap<Interned<String>, cc::Tool>,
247247
crates: HashMap<Interned<String>, Crate>,
248248
is_sudo: bool,
249249
ci_env: CiEnv,
@@ -350,7 +350,7 @@ impl Build {
350350
}
351351

352352
self.verbose("finding compilers");
353-
cc::find(self);
353+
cc_detect::find(self);
354354
self.verbose("running sanity check");
355355
sanity::check(self);
356356
// If local-rust is the same major.minor as the current version, then force a local-rebuild
@@ -619,7 +619,7 @@ impl Build {
619619
/// specified.
620620
fn cflags(&self, target: Interned<String>) -> Vec<String> {
621621
// Filter out -O and /O (the optimization flags) that we picked up from
622-
// gcc-rs because the build scripts will determine that for themselves.
622+
// cc-rs because the build scripts will determine that for themselves.
623623
let mut base = self.cc[&target].0.args().iter()
624624
.map(|s| s.to_string_lossy().into_owned())
625625
.filter(|s| !s.starts_with("-O") && !s.starts_with("/O"))

src/bootstrap/native.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ use std::process::Command;
2727

2828
use build_helper::output;
2929
use cmake;
30-
use gcc;
30+
use cc;
3131

3232
use Build;
3333
use util;
@@ -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::Build::new();
292+
let mut cfg = cc::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/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ libc = { path = "../rustc/libc_shim" }
1919

2020
[build-dependencies]
2121
build_helper = { path = "../build_helper" }
22-
gcc = "0.3.50"
22+
cc = "1.0"
2323

2424
[features]
2525
debug = []

src/liballoc_jemalloc/build.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#![deny(warnings)]
1212

1313
extern crate build_helper;
14-
extern crate gcc;
14+
extern crate cc;
1515

1616
use std::env;
1717
use std::path::PathBuf;
@@ -63,7 +63,7 @@ fn main() {
6363
_ => return,
6464
};
6565

66-
let compiler = gcc::Build::new().get_compiler();
66+
let compiler = cc::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::Build::new()
153+
cc::Build::new()
154154
.flag("-fvisibility=hidden")
155155
.file("pthread_atfork_dummy.c")
156156
.compile("libpthread_atfork_dummy.a");

src/libprofiler_builtins/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ doc = false
1515
core = { path = "../libcore" }
1616

1717
[build-dependencies]
18-
gcc = "0.3.50"
18+
cc = "1.0"

src/libprofiler_builtins/build.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@
1212
//!
1313
//! See the build.rs for libcompiler_builtins crate for details.
1414
15-
extern crate gcc;
15+
extern crate cc;
1616

1717
use std::env;
1818
use std::path::Path;
1919

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

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

src/librustc/session/config.rs

+14-14
Original file line numberDiff line numberDiff line change
@@ -1373,20 +1373,20 @@ pub fn rustc_optgroups() -> Vec<RustcOptGroup> {
13731373
always = always colorize output;
13741374
never = never colorize output", "auto|always|never"),
13751375

1376-
opt::flagopt("", "pretty",
1377-
"Pretty-print the input instead of compiling;
1378-
valid types are: `normal` (un-annotated source),
1379-
`expanded` (crates expanded), or
1380-
`expanded,identified` (fully parenthesized, AST nodes with IDs).",
1381-
"TYPE"),
1382-
opt::flagopt("", "unpretty",
1383-
"Present the input source, unstable (and less-pretty) variants;
1384-
valid types are any of the types for `--pretty`, as well as:
1385-
`flowgraph=<nodeid>` (graphviz formatted flowgraph for node),
1386-
`everybody_loops` (all function bodies replaced with `loop {}`),
1387-
`hir` (the HIR), `hir,identified`, or
1388-
`hir,typed` (HIR with types for each node).",
1389-
"TYPE"),
1376+
opt::opt("", "pretty",
1377+
"Pretty-print the input instead of compiling;
1378+
valid types are: `normal` (un-annotated source),
1379+
`expanded` (crates expanded), or
1380+
`expanded,identified` (fully parenthesized, AST nodes with IDs).",
1381+
"TYPE"),
1382+
opt::opt("", "unpretty",
1383+
"Present the input source, unstable (and less-pretty) variants;
1384+
valid types are any of the types for `--pretty`, as well as:
1385+
`flowgraph=<nodeid>` (graphviz formatted flowgraph for node),
1386+
`everybody_loops` (all function bodies replaced with `loop {}`),
1387+
`hir` (the HIR), `hir,identified`, or
1388+
`hir,typed` (HIR with types for each node).",
1389+
"TYPE"),
13901390
]);
13911391
opts
13921392
}

src/librustc_llvm/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ rustc_cratesio_shim = { path = "../librustc_cratesio_shim" }
1818

1919
[build-dependencies]
2020
build_helper = { path = "../build_helper" }
21-
gcc = "0.3.50"
21+
cc = "1.0"

src/librustc_llvm/build.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
extern crate gcc;
11+
extern crate cc;
1212
extern crate build_helper;
1313

1414
use std::process::Command;
@@ -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::Build::new();
139+
let mut cfg = cc::Build::new();
140140
cfg.warnings(false);
141141
for flag in cxxflags.split_whitespace() {
142142
// Ignore flags like `-m64` when we're doing a cross build

src/librustc_trans/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,4 @@ syntax = { path = "../libsyntax" }
3232
syntax_pos = { path = "../libsyntax_pos" }
3333

3434
[target."cfg(windows)".dependencies]
35-
gcc = "0.3.50"
35+
cc = "1.0"

src/librustc_trans/back/link.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ pub fn get_linker(sess: &Session) -> (String, Command, Vec<(OsString, OsString)>
136136

137137
#[cfg(windows)]
138138
pub fn msvc_link_exe_cmd(sess: &Session) -> (Command, Vec<(OsString, OsString)>) {
139-
use gcc::windows_registry;
139+
use cc::windows_registry;
140140

141141
let target = &sess.opts.target_triple;
142142
let tool = windows_registry::find_tool(target, "link.exe");

src/librustc_trans/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ extern crate syntax_pos;
6060
extern crate rustc_errors as errors;
6161
extern crate serialize;
6262
#[cfg(windows)]
63-
extern crate gcc; // Used to locate MSVC, not gcc :)
63+
extern crate cc; // Used to locate MSVC
6464

6565
pub use base::trans_crate;
6666

src/librustdoc/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ html-diff = "0.0.4"
1818

1919
[build-dependencies]
2020
build_helper = { path = "../build_helper" }
21-
gcc = "0.3.50"
21+
cc = "1.0"

src/librustdoc/build.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@
99
// except according to those terms.
1010

1111
extern crate build_helper;
12-
extern crate gcc;
12+
extern crate cc;
1313

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::Build::new();
17+
let mut cfg = cc::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/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ rustc_tsan = { path = "../librustc_tsan" }
3636

3737
[build-dependencies]
3838
build_helper = { path = "../build_helper" }
39-
gcc = "0.3.50"
39+
cc = "1.0"
4040

4141
[features]
4242
backtrace = []

src/libstd/build.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#![deny(warnings)]
1212

1313
extern crate build_helper;
14-
extern crate gcc;
14+
extern crate cc;
1515

1616
use std::env;
1717
use std::process::Command;
@@ -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::Build::new().get_compiler();
80+
let compiler = cc::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)