Skip to content

Commit 3484b2b

Browse files
author
Jorge Aparicio
committed
by default, mark this crate as the #![compiler_builtins] crate
as this is how most users will want to use this crate
1 parent 8bb7795 commit 3484b2b

File tree

3 files changed

+12
-8
lines changed

3 files changed

+12
-8
lines changed

Cargo.toml

+4
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ compiler-rt = { path = "compiler-rt" }
2323
[features]
2424
# Build the missing intrinsics from compiler-rt C source code
2525
c = []
26+
# Mark this crate as the #![compiler_builtins] crate
27+
compiler-builtins = []
28+
default = ["compiler-builtins"]
29+
rustbuild = ["compiler-builtins"]
2630
weak = ["rlibc/weak"]
2731

2832
[workspace]

ci/run.sh

+7-7
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ case $1 in
77
xargo build --target $1 --release
88
;;
99
*)
10-
cargo test --target $1
11-
cargo test --target $1 --release
10+
cargo test --no-default-features --target $1
11+
cargo test --no-default-features --target $1 --release
1212
;;
1313
esac
1414

@@ -18,20 +18,20 @@ case $1 in
1818
xargo build --features c --target $1 --bin intrinsics
1919
;;
2020
*)
21-
cargo build --features c --target $1 --bin intrinsics
21+
cargo build --no-default-features --features c --target $1 --bin intrinsics
2222
;;
2323
esac
2424

2525
# Verify that there are no undefined symbols to `panic` within our implementations
2626
# TODO(#79) fix the undefined references problem for debug-assertions+lto
2727
case $1 in
2828
thumb*)
29-
RUSTFLAGS="-C debug-assertions=no -C link-arg=-nostartfiles" xargo rustc --features c --target $1 --bin intrinsics -- -C lto
30-
xargo rustc --features c --target $1 --bin intrinsics --release -- -C lto
29+
RUSTFLAGS="-C debug-assertions=no -C link-arg=-nostartfiles" xargo rustc --no-default-features --features c --target $1 --bin intrinsics -- -C lto
30+
xargo rustc --no-default-features --features c --target $1 --bin intrinsics --release -- -C lto
3131
;;
3232
*)
33-
RUSTFLAGS="-C debug-assertions=no" cargo rustc --features c --target $1 --bin intrinsics -- -C lto
34-
cargo rustc --features c --target $1 --bin intrinsics --release -- -C lto
33+
RUSTFLAGS="-C debug-assertions=no" cargo rustc --no-default-features --features c --target $1 --bin intrinsics -- -C lto
34+
cargo rustc --no-default-features --features c --target $1 --bin intrinsics --release -- -C lto
3535
;;
3636
esac
3737

src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#![cfg_attr(not(stage0), deny(warnings))]
22
#![cfg_attr(not(test), no_std)]
3-
#![cfg_attr(rustbuild, compiler_builtins)]
3+
#![cfg_attr(feature = "compiler-builtins", compiler_builtins)]
44
#![crate_name = "compiler_builtins"]
55
#![crate_type = "rlib"]
66
#![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk.png",

0 commit comments

Comments
 (0)