Skip to content

Commit d4d1c46

Browse files
committed
CI: build with a single codegen unit
This is not ideal, but it does provide two things: 1. It fixes bizarre linker errors about missing `sancov` symbols. 2. It allows LLVM to do inlining that it otherwise refuses to do. For some reason, when sanitizers are enabled, LLVM refuses to inline across codegen units. This is a problem because trivial methods like `Vec::len` won't be inlined, resulting in 100x slowdowns. `cargo fuzz` already restricts its builds to a single codegen unit, so we might as well do the same thing in CI here.
1 parent 55faf5a commit d4d1c46

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

ci/script.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ pushd ./example
1111
cargo rustc \
1212
--release \
1313
-- \
14+
-Ccodegen-units=1 \
1415
-Cpasses=sancov-module \
1516
-Cllvm-args=-sanitizer-coverage-level=3 \
1617
-Cllvm-args=-sanitizer-coverage-trace-compares \
@@ -26,6 +27,7 @@ pushd ./example_arbitrary
2627
cargo rustc \
2728
--release \
2829
-- \
30+
-Ccodegen-units=1 \
2931
-Cpasses=sancov-module \
3032
-Cllvm-args=-sanitizer-coverage-level=3 \
3133
-Cllvm-args=-sanitizer-coverage-trace-compares \
@@ -46,6 +48,7 @@ pushd ./example_mutator
4648
cargo rustc \
4749
--release \
4850
-- \
51+
-Ccodegen-units=1 \
4952
-Cpasses=sancov-module \
5053
-Cllvm-args=-sanitizer-coverage-level=3 \
5154
-Cllvm-args=-sanitizer-coverage-trace-compares \

0 commit comments

Comments
 (0)