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

Set RUSTDOCFLAGS to avoid issues with linkage for doctests. #143

Merged
merged 1 commit into from
Oct 22, 2018

Conversation

SingingTree
Copy link
Contributor

Per issue #142, cargo afl test and other commands that would run
doctests would encounter issues with linkage. This commit changes cargo afl to set RUSTDOCFLAGS so rustdoc will be able to find the required
libs. Further options are passed to ensure doctests are built and run in
as similar a fashion to other code. This avoids other gotchas like cfg
fuzzing being set for normal builds, but not for doctests.

Per issue rust-fuzz#142, `cargo afl test` and other commands that would run
doctests would encounter issues with linkage. This commit changes `cargo
afl` to set RUSTDOCFLAGS so rustdoc will be able to find the required
libs. Further options are passed to ensure doctests are built and run in
as similar a fashion to other code. This avoids other gotchas like cfg
fuzzing being set for normal builds, but not for doctests.
@SingingTree
Copy link
Contributor Author

#141 causes some pain while testing with this, since export RUSTFLAGS=-Clink-arg=-fuse-ld=gold won't be seen by rustdoc, you also need to do an export RUSTDOCFLAGS=-Clink-arg=-fuse-ld=gold to prevent the linking issue with rustdoc.

Copy link
Member

@frewsxcv frewsxcv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👏

@frewsxcv frewsxcv merged commit aab2fab into rust-fuzz:master Oct 22, 2018
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

Successfully merging this pull request may close these issues.

2 participants