Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot build fuzz targets in release mode: __sancov_guards has both ordered and unordered sections #161

Closed
ebarnard opened this issue Oct 8, 2018 · 3 comments

Comments

@ebarnard
Copy link

ebarnard commented Oct 8, 2018

Running cargo fuzz run -O TARGET results in

/usr/bin/ld: __sancov_guards has both ordered [`__sancov_guards' in /home/me/rust-plist/fuzz/target/x86_64-unknown-linux-gnu/release/deps/binary_reader-f85fd5bec5488622.binary_reader.7pvxwz2b-cgu.1.rcgu.o] and unordered [`__sancov_guards' in /home/me/rust-plist/fuzz/target/x86_64-unknown-linux-gnu/release/deps/binary_reader-f85fd5bec5488622.binary_reader.7pvxwz2b-cgu.10.rcgu.o] sections

/usr/bin/ld: final link failed: Bad value

This can be worked around by forcing a single codegen unit i.e.

RUSTFLAGS='-C codegen-units=1' cargo +nightly fuzz run -O TARGET

so it is presumably related to thinlto.

Running:
Ubuntu 16.04 x86_64
rustc 1.31.0-nightly (b2d6ea98b 2018-10-07)
cargo-fuzz 0.5.2

@frewsxcv
Copy link
Member

frewsxcv commented Oct 8, 2018

rust-lang/rust#53945

@barrbrain
Copy link

Is this issue resolved by #215?

@ebarnard
Copy link
Author

I haven't had any issues with cargo-fuzz recently so I presume so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants