Skip to content

Commit 440554e

Browse files
committed
Test that core can be built with msan enabled
See rust-fuzz/cargo-fuzz#243 The test currently fails, since it highlights a regression. Reverting library/stdarch to <rust-lang/stdarch@718175b> (the problem commit being <rust-lang/stdarch@3fa0f6a>) makes it pass again.
1 parent a2cd91c commit 440554e

File tree

4 files changed

+30
-0
lines changed

4 files changed

+30
-0
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/Cargo.lock
2+
/target/
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[package]
2+
name = "foo"
3+
version = "0.1.0"
4+
edition = "2018"
5+
6+
[workspace]
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# needs-sanitizer-support
2+
# needs-sanitizer-memory
3+
4+
# This test builds a trivial program with memory sanitizer
5+
# and rebuilds part of the standard library
6+
7+
# -Clink-dead-code is a setting that sanitizer front-ends generally enable,
8+
# due to issues with certain linkers mangling sections used to track
9+
# coverage when trying to remove dead code
10+
# Linking dead code allows tracking more regressions generating code for the
11+
# standard library, eg for target features that are not currently enabled.
12+
13+
# -Ccodegen-units=1 is also enabled by the front-ends, to work around
14+
# misoptimisations with ThinLTO.
15+
16+
all:
17+
RUSTFLAGS="-Cpasses=sancov -Clink-dead-code -Zsanitizer=memory -Ccodegen-units=1" \
18+
cargo build --verbose --release -Zbuild-std=core --target $(TARGET)
19+
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
fn main() {
2+
println!("Hello, world!");
3+
}

0 commit comments

Comments
 (0)