]> git.lizzy.rs Git - rust.git/commitdiff
std: Remove cfg(cargobuild) annotations
authorAlex Crichton <alex@alexcrichton.com>
Mon, 23 Jan 2017 23:55:35 +0000 (15:55 -0800)
committerAlex Crichton <alex@alexcrichton.com>
Mon, 6 Feb 2017 16:42:54 +0000 (08:42 -0800)
These are all now no longer needed that we've only got rustbuild in tree.

25 files changed:
CONTRIBUTING.md
src/liballoc_jemalloc/build.rs
src/liballoc_jemalloc/lib.rs
src/libflate/build.rs
src/libflate/lib.rs
src/libpanic_unwind/gcc.rs
src/librustc_llvm/build.rs
src/librustc_llvm/lib.rs
src/librustdoc/build.rs
src/librustdoc/html/markdown.rs
src/libstd/build.rs
src/libstd/lib.rs
src/libstd/panicking.rs
src/libstd/rtdeps.rs [deleted file]
src/libstd/sys/unix/args.rs
src/libstd/sys/unix/mod.rs
src/libstd/sys/unix/rand.rs
src/libstd/sys/windows/c.rs
src/libstd/sys_common/gnu/libbacktrace.rs
src/libstd/sys_common/mod.rs
src/libunwind/build.rs
src/libunwind/libunwind.rs
src/tools/compiletest/Cargo.toml
src/tools/compiletest/build.rs [deleted file]
src/tools/compiletest/src/main.rs

index cdbabeaddfba8a17ee886aff226ac3461328186a..429996126f92b6dd7d13fcfd1b0ce5d224842e98 100644 (file)
@@ -93,11 +93,6 @@ system internals, try asking in [`#rust-internals`][pound-rust-internals].
 
 [bootstrap]: https://github.com/rust-lang/rust/tree/master/src/bootstrap/
 
-> **Note**: the build system was recently rewritten from a jungle of makefiles
-> to the current incarnation you'll see in `src/bootstrap`. If you experience
-> bugs you can temporarily revert back to the makefiles with
-> `--disable-rustbuild` passed to `./configure`.
-
 ### Configuration
 
 Before you can start building the compiler you need to configure the build for
index cb7852995f3b19e9f2f4fb761f0b68d519edbed4..a3402bf399427be5dcc61f95f0f6df3b1f98831e 100644 (file)
@@ -21,7 +21,6 @@
 use build_helper::{run, rerun_if_changed_anything_in_dir, up_to_date};
 
 fn main() {
-    println!("cargo:rustc-cfg=cargobuild");
     println!("cargo:rerun-if-changed=build.rs");
 
     // FIXME: This is a hack to support building targets that don't
index fc8a5455d1d07406a8e4557fd260534f441c3859..8d81a09f5af0fbf947726145a61a7c8f42235e57 100644 (file)
 mod imp {
     use libc::{c_int, c_void, size_t};
 
-    // Linkage directives to pull in jemalloc and its dependencies.
-    //
-    // On some platforms we need to be sure to link in `pthread` which jemalloc
-    // depends on, and specifically on android we need to also link to libgcc.
-    // Currently jemalloc is compiled with gcc which will generate calls to
-    // intrinsics that are libgcc specific (e.g. those intrinsics aren't present in
-    // libcompiler-rt), so link that in to get that support.
-    #[link(name = "jemalloc", kind = "static")]
-    #[cfg_attr(target_os = "android", link(name = "gcc"))]
-    #[cfg_attr(all(not(windows),
-                   not(target_os = "android"),
-                   not(target_env = "musl")),
-               link(name = "pthread"))]
-    #[cfg(not(cargobuild))]
-    extern "C" {}
-
     // Note that the symbols here are prefixed by default on OSX and Windows (we
     // don't explicitly request it), and on Android and DragonFly we explicitly
     // request it as unprefixing cause segfaults (mismatches in allocators).
index 245c705dfcc2a41c657ec505d62107fdf94f30b6..12016980a2c656be8c5ace4d6ea27285865ca26a 100644 (file)
@@ -11,7 +11,6 @@
 extern crate gcc;
 
 fn main() {
-    println!("cargo:rustc-cfg=cargobuild");
     gcc::Config::new()
         .file("../rt/miniz.c")
         .compile("libminiz.a");
index 8365e9db2a947c3e85199d92d751ee318440afef..dedec7b1609fadaea92cdaf9e1d970f42dfe4dd9 100644 (file)
@@ -74,10 +74,6 @@ fn drop(&mut self) {
     }
 }
 
-#[link(name = "miniz", kind = "static")]
-#[cfg(not(cargobuild))]
-extern "C" {}
-
 extern "C" {
     /// Raw miniz compression function.
     fn tdefl_compress_mem_to_heap(psrc_buf: *const c_void,
index e8b3a9a42c292033dc4889f7b5c6e562f687abea..84abc6bc4a5132e248470e31ad231cf1e12b8aa5 100644 (file)
@@ -301,10 +301,6 @@ unsafe fn find_eh_action(context: *mut uw::_Unwind_Context) -> EHAction {
 // with any GCC runtime.
 #[cfg(all(target_os="windows", target_arch = "x86", target_env="gnu"))]
 pub mod eh_frame_registry {
-    #[link(name = "gcc_eh")]
-    #[cfg(not(cargobuild))]
-    extern "C" {}
-
     extern "C" {
         fn __register_frame_info(eh_frame_begin: *const u8, object: *mut u8);
         fn __deregister_frame_info(eh_frame_begin: *const u8, object: *mut u8);
index 2ee4cc49435611316e1a7e1d3b717dae609c8574..c74a9308e4eba4913aff70e4d598d8babf7d9c8b 100644 (file)
@@ -47,8 +47,6 @@ fn detect_llvm_link(llvm_config: &Path) -> (&'static str, Option<&'static str>)
 }
 
 fn main() {
-    println!("cargo:rustc-cfg=cargobuild");
-
     let target = env::var("TARGET").expect("TARGET was not set");
     let llvm_config = env::var_os("LLVM_CONFIG")
         .map(PathBuf::from)
index b1615b9e38bde11e25ad248d82363734bebc10c7..f300bf16145a736c92f95768eb911ada60f24c3e 100644 (file)
@@ -422,13 +422,3 @@ fn drop(&mut self) {
         }
     }
 }
-
-// The module containing the native LLVM dependencies, generated by the build system
-// Note that this must come after the rustllvm extern declaration so that
-// parts of LLVM that rustllvm depends on aren't thrown away by the linker.
-// Works to the above fix for #15460 to ensure LLVM dependencies that
-// are only used by rustllvm don't get stripped by the linker.
-#[cfg(not(cargobuild))]
-mod llvmdeps {
-    include! { env!("CFG_LLVM_LINKAGE_FILE") }
-}
index 171954f325a5e5dbcafd82003efb2283109cd06d..fcb7af11dce2f061d2abbfd0bcc1e0af72ee6ad0 100644 (file)
@@ -11,7 +11,6 @@
 extern crate gcc;
 
 fn main() {
-    println!("cargo:rustc-cfg=cargobuild");
     let mut cfg = gcc::Config::new();
     cfg.file("../rt/hoedown/src/autolink.c")
        .file("../rt/hoedown/src/buffer.c")
index e8ff8930bdd7d32eb16557c3bbfce9822eccca34..a0f4a3a87434845c7f464723bea9f47f4842c985 100644 (file)
@@ -162,11 +162,6 @@ struct hoedown_buffer {
     unit: libc::size_t,
 }
 
-// hoedown FFI
-#[link(name = "hoedown", kind = "static")]
-#[cfg(not(cargobuild))]
-extern {}
-
 extern {
     fn hoedown_html_renderer_new(render_flags: libc::c_uint,
                                  nesting_level: libc::c_int)
index a0844821709378f4cefb96ac46936af458330867..0fca374f6e6d1035381faf7ba96498965663378b 100644 (file)
@@ -21,7 +21,6 @@
 use build_helper::{run, rerun_if_changed_anything_in_dir, up_to_date};
 
 fn main() {
-    println!("cargo:rustc-cfg=cargobuild");
     println!("cargo:rerun-if-changed=build.rs");
 
     let target = env::var("TARGET").expect("TARGET was not set");
index 9bcecebf693d2e73265285260c3e9317bde5a7b6..4279db7754a81de60b5e7345aa813e54aa4e7d48 100644 (file)
 mod rand;
 mod memchr;
 
-// This module just defines per-platform native library dependencies
-mod rtdeps;
-
 // The runtime entry point and a few unstable public functions used by the
 // compiler
 pub mod rt;
index e5edea241e1990654e10d0113cc1dae57440363c..d76e8816ca45f3932b37baf92a35fcdf8fca5028 100644 (file)
@@ -311,12 +311,12 @@ pub fn line(&self) -> u32 {
 }
 
 fn default_hook(info: &PanicInfo) {
-    #[cfg(any(not(cargobuild), feature = "backtrace"))]
+    #[cfg(feature = "backtrace")]
     use sys_common::backtrace;
 
     // If this is a double panic, make sure that we print a backtrace
     // for this panic. Otherwise only print it if logging is enabled.
-    #[cfg(any(not(cargobuild), feature = "backtrace"))]
+    #[cfg(feature = "backtrace")]
     let log_backtrace = {
         let panics = update_panic_count(0);
 
@@ -341,7 +341,7 @@ fn default_hook(info: &PanicInfo) {
         let _ = writeln!(err, "thread '{}' panicked at '{}', {}:{}",
                          name, msg, file, line);
 
-        #[cfg(any(not(cargobuild), feature = "backtrace"))]
+        #[cfg(feature = "backtrace")]
         {
             use sync::atomic::{AtomicBool, Ordering};
 
diff --git a/src/libstd/rtdeps.rs b/src/libstd/rtdeps.rs
deleted file mode 100644 (file)
index 5dc6ee2..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-// Copyright 2013-2015 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-//! This module contains the linkage attributes to all runtime dependencies of
-//! the standard library This varies per-platform, but these libraries are
-//! necessary for running libstd.
-
-#![cfg(not(cargobuild))]
-
-// LLVM implements the `frem` instruction as a call to `fmod`, which lives in
-// libm. Hence, we must explicitly link to it.
-//
-// On Linux, librt and libdl are indirect dependencies via std,
-// and binutils 2.22+ won't add them automatically
-#[cfg(all(target_os = "linux", not(target_env = "musl")))]
-#[link(name = "dl")]
-#[link(name = "pthread")]
-extern {}
-
-#[cfg(target_os = "android")]
-#[link(name = "dl")]
-#[link(name = "log")]
-extern {}
-
-#[cfg(target_os = "freebsd")]
-#[link(name = "execinfo")]
-#[link(name = "pthread")]
-extern {}
-
-#[cfg(any(target_os = "dragonfly",
-          target_os = "bitrig",
-          target_os = "netbsd",
-          target_os = "openbsd"))]
-#[link(name = "pthread")]
-extern {}
-
-#[cfg(target_os = "solaris")]
-#[link(name = "socket")]
-#[link(name = "posix4")]
-#[link(name = "pthread")]
-extern {}
-
-// For PNaCl targets, nacl_io is a Pepper wrapper for some IO functions
-// missing (ie always error) in Newlib.
-#[cfg(all(target_os = "nacl", not(test)))]
-#[link(name = "nacl_io", kind = "static")]
-#[link(name = "c++", kind = "static")] // for `nacl_io` and EH.
-#[link(name = "pthread", kind = "static")]
-extern {}
-
-#[cfg(target_os = "macos")]
-#[link(name = "System")]
-extern {}
-
-#[cfg(target_os = "ios")]
-#[link(name = "System")]
-extern {}
-
-#[cfg(target_os = "haiku")]
-#[link(name = "network")]
-extern {}
index 0f447ff4ec452c96b5df9a356e42882f2755fdf0..6e35a472792c464de35268ebcd4897bb91d333eb 100644 (file)
@@ -189,11 +189,6 @@ pub fn args() -> Args {
             fn objc_msgSend_ul(obj: NsId, sel: Sel, ...) -> NsId;
         }
 
-        #[link(name = "Foundation", kind = "framework")]
-        #[link(name = "objc")]
-        #[cfg(not(cargobuild))]
-        extern {}
-
         type Sel = *const libc::c_void;
         type NsId = *const libc::c_void;
 
index fd7dc17cccd8cbf36d3a24684215adebeb41326f..c57751a01d7c1b6f0293da4c000cd33b51e0dab4 100644 (file)
@@ -33,7 +33,7 @@
 
 pub mod args;
 pub mod android;
-#[cfg(any(not(cargobuild), feature = "backtrace"))]
+#[cfg(feature = "backtrace")]
 pub mod backtrace;
 pub mod condvar;
 pub mod env;
index 9b1cf6ffd0e2200a4b395e45ffc3c5948e2ffe07..77ebad4e344c24adbcef0ae199fee1c7a9c8168b 100644 (file)
@@ -257,10 +257,6 @@ enum SecRandom {}
     #[allow(non_upper_case_globals)]
     const kSecRandomDefault: *const SecRandom = ptr::null();
 
-    #[link(name = "Security", kind = "framework")]
-    #[cfg(not(cargobuild))]
-    extern {}
-
     extern {
         fn SecRandomCopyBytes(rnd: *const SecRandom,
                               count: size_t, bytes: *mut u8) -> c_int;
index 850d6f49612ee3b7626e6f11bd9d5972c8050aea..e5010ca356449cfcf1c56e2145c3aab7c6c44f22 100644 (file)
@@ -833,13 +833,6 @@ pub struct CONSOLE_READCONSOLE_CONTROL {
 }
 pub type PCONSOLE_READCONSOLE_CONTROL = *mut CONSOLE_READCONSOLE_CONTROL;
 
-#[link(name = "ws2_32")]
-#[link(name = "userenv")]
-#[link(name = "shell32")]
-#[link(name = "advapi32")]
-#[cfg(not(cargobuild))]
-extern {}
-
 extern "system" {
     pub fn WSAStartup(wVersionRequested: WORD,
                       lpWSAData: LPWSADATA) -> c_int;
index d464a13ad1d3f67484d986c6976af6099347bcea..0bdbeddb112121b0a015925bc83fc866e4dd0b31 100644 (file)
@@ -39,9 +39,6 @@ pub fn print(w: &mut Write, idx: isize, addr: *mut libc::c_void,
                       msg: *const libc::c_char,
                       errnum: libc::c_int);
     enum backtrace_state {}
-    #[link(name = "backtrace", kind = "static")]
-    #[cfg(all(not(test), not(cargobuild)))]
-    extern {}
 
     extern {
         fn backtrace_create_state(filename: *const libc::c_char,
index 634d6258885e864e7f040233fb883c134e446481..d4d3365dc0198a8129d08c6d10c28f0e85573de3 100644 (file)
@@ -29,7 +29,7 @@
 use sys;
 
 pub mod at_exit_imp;
-#[cfg(any(not(cargobuild), feature = "backtrace"))]
+#[cfg(feature = "backtrace")]
 pub mod backtrace;
 pub mod condvar;
 pub mod io;
@@ -50,7 +50,7 @@
 #[cfg(not(target_os = "redox"))]
 pub mod net;
 
-#[cfg(any(not(cargobuild), feature = "backtrace"))]
+#[cfg(feature = "backtrace")]
 #[cfg(any(all(unix, not(any(target_os = "macos", target_os = "ios", target_os = "emscripten"))),
           all(windows, target_env = "gnu")))]
 pub mod gnu;
index db41a368a1680ed67e5e5f1eec05fcc47f9ac03b..f18b694d3d0c70e5feb861718c31b1cee5f161ba 100644 (file)
@@ -11,8 +11,6 @@
 use std::env;
 
 fn main() {
-    println!("cargo:rustc-cfg=cargobuild");
-
     let target = env::var("TARGET").expect("TARGET was not set");
 
     if target.contains("linux") {
index 269c2d65b632706f71d8f304ab4eb51987622d2d..7fb58373251a515be8a104da34b7af5829918597 100644 (file)
@@ -240,34 +240,3 @@ pub unsafe fn _Unwind_RaiseException(exc: *mut _Unwind_Exception) -> _Unwind_Rea
     }
 }
 } // cfg_if!
-
-#[cfg_attr(any(all(target_os = "linux", not(target_env = "musl")),
-               target_os = "freebsd",
-               target_os = "solaris",
-               target_os = "haiku",
-               all(target_os = "linux",
-                   target_env = "musl",
-                   not(target_arch = "x86"),
-                   not(target_arch = "x86_64"))),
-           link(name = "gcc_s"))]
-#[cfg_attr(all(target_os = "linux",
-               target_env = "musl",
-               any(target_arch = "x86", target_arch = "x86_64"),
-               not(test)),
-           link(name = "unwind", kind = "static"))]
-#[cfg_attr(target_os = "fuchsia",
-           link(name = "unwind"))]
-#[cfg_attr(any(target_os = "android", target_os = "openbsd"),
-           link(name = "gcc"))]
-#[cfg_attr(all(target_os = "netbsd", not(target_vendor = "rumprun")),
-           link(name = "gcc"))]
-#[cfg_attr(all(target_os = "netbsd", target_vendor = "rumprun"),
-           link(name = "unwind"))]
-#[cfg_attr(target_os = "dragonfly",
-           link(name = "gcc_pic"))]
-#[cfg_attr(target_os = "bitrig",
-           link(name = "c++abi"))]
-#[cfg_attr(all(target_os = "windows", target_env = "gnu"),
-           link(name = "gcc_eh"))]
-#[cfg(not(cargobuild))]
-extern "C" {}
index 2982f29f931c326087a89540866dc2e084a4819e..3049875e86ea30cea6eee671de9187277e4e3b03 100644 (file)
@@ -2,7 +2,6 @@
 authors = ["The Rust Project Developers"]
 name = "compiletest"
 version = "0.0.0"
-build = "build.rs"
 
 [dependencies]
 log = "0.3"
diff --git a/src/tools/compiletest/build.rs b/src/tools/compiletest/build.rs
deleted file mode 100644 (file)
index d5164b9..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-fn main() {
-    println!("cargo:rustc-cfg=cargobuild");
-}
index 43d02479fb17de8442e823b401c537707c5a2966..c2997c8c160ef1c4b12dac9c796d0819ee371d90 100644 (file)
 extern crate libc;
 extern crate test;
 extern crate getopts;
-
-#[cfg(cargobuild)]
 extern crate rustc_serialize;
-#[cfg(not(cargobuild))]
-extern crate serialize as rustc_serialize;
-
 #[macro_use]
 extern crate log;
-
-#[cfg(cargobuild)]
 extern crate env_logger;
 
 use std::env;
 mod uidiff;
 
 fn main() {
-    #[cfg(cargobuild)]
-    fn log_init() { env_logger::init().unwrap(); }
-    #[cfg(not(cargobuild))]
-    fn log_init() {}
-    log_init();
+    env_logger::init().unwrap();
 
     let config = parse_config(env::args().collect());