From 6da988a43a27b0db272c05da50720782c54f5a85 Mon Sep 17 00:00:00 2001 From: Jorge Aparicio Date: Sun, 11 Dec 2016 16:18:43 -0500 Subject: [PATCH 1/2] by default, mark this crate as the #![compiler_builtins] crate as this is how most users will want to use this crate --- library/compiler-builtins/Cargo.toml | 4 ++++ library/compiler-builtins/ci/run.sh | 14 +++++++------- library/compiler-builtins/src/lib.rs | 2 +- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/library/compiler-builtins/Cargo.toml b/library/compiler-builtins/Cargo.toml index 58ce4513ca55..95364233e9d4 100644 --- a/library/compiler-builtins/Cargo.toml +++ b/library/compiler-builtins/Cargo.toml @@ -23,6 +23,10 @@ compiler-rt = { path = "compiler-rt" } [features] # Build the missing intrinsics from compiler-rt C source code c = [] +# Mark this crate as the #![compiler_builtins] crate +compiler-builtins = [] +default = ["compiler-builtins"] +rustbuild = ["compiler-builtins"] weak = ["rlibc/weak"] [workspace] diff --git a/library/compiler-builtins/ci/run.sh b/library/compiler-builtins/ci/run.sh index 0159e2389130..c9e0736c3d8d 100755 --- a/library/compiler-builtins/ci/run.sh +++ b/library/compiler-builtins/ci/run.sh @@ -7,8 +7,8 @@ case $1 in xargo build --target $1 --release ;; *) - cargo test --target $1 - cargo test --target $1 --release + cargo test --no-default-features --target $1 + cargo test --no-default-features --target $1 --release ;; esac @@ -18,7 +18,7 @@ case $1 in xargo build --features c --target $1 --bin intrinsics ;; *) - cargo build --features c --target $1 --bin intrinsics + cargo build --no-default-features --features c --target $1 --bin intrinsics ;; esac @@ -26,12 +26,12 @@ esac # TODO(#79) fix the undefined references problem for debug-assertions+lto case $1 in thumb*) - RUSTFLAGS="-C debug-assertions=no -C link-arg=-nostartfiles" xargo rustc --features c --target $1 --bin intrinsics -- -C lto - xargo rustc --features c --target $1 --bin intrinsics --release -- -C lto + RUSTFLAGS="-C debug-assertions=no -C link-arg=-nostartfiles" xargo rustc --no-default-features --features c --target $1 --bin intrinsics -- -C lto + xargo rustc --no-default-features --features c --target $1 --bin intrinsics --release -- -C lto ;; *) - RUSTFLAGS="-C debug-assertions=no" cargo rustc --features c --target $1 --bin intrinsics -- -C lto - cargo rustc --features c --target $1 --bin intrinsics --release -- -C lto + RUSTFLAGS="-C debug-assertions=no" cargo rustc --no-default-features --features c --target $1 --bin intrinsics -- -C lto + cargo rustc --no-default-features --features c --target $1 --bin intrinsics --release -- -C lto ;; esac diff --git a/library/compiler-builtins/src/lib.rs b/library/compiler-builtins/src/lib.rs index 0efb20b5dec8..dc8f4111d898 100644 --- a/library/compiler-builtins/src/lib.rs +++ b/library/compiler-builtins/src/lib.rs @@ -1,6 +1,6 @@ #![cfg_attr(not(stage0), deny(warnings))] #![cfg_attr(not(test), no_std)] -#![cfg_attr(rustbuild, compiler_builtins)] +#![cfg_attr(feature = "compiler-builtins", compiler_builtins)] #![crate_name = "compiler_builtins"] #![crate_type = "rlib"] #![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk.png", From 45ebf21c0b03f0e04b7714a521a71028ffd9cf68 Mon Sep 17 00:00:00 2001 From: Jorge Aparicio Date: Sun, 11 Dec 2016 16:54:41 -0500 Subject: [PATCH 2/2] fix appveyor --- library/compiler-builtins/appveyor.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/compiler-builtins/appveyor.yml b/library/compiler-builtins/appveyor.yml index f27347c338de..c05bfdfc2b60 100644 --- a/library/compiler-builtins/appveyor.yml +++ b/library/compiler-builtins/appveyor.yml @@ -16,5 +16,5 @@ build: false test_script: - cargo build --target %TARGET% - cargo build --release --target %TARGET% - - cargo test --target %TARGET% - - cargo test --release --target %TARGET% + - cargo test --no-default-features --target %TARGET% + - cargo test --no-default-features --release --target %TARGET%