-
Notifications
You must be signed in to change notification settings - Fork 23
Support for using honggfuzz with gcc #263
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
base: main
Are you sure you want to change the base?
Support for using honggfuzz with gcc #263
Conversation
Using the latest mast commit since releases are very infrequent.
Co-authored-by: Simon Resch <simon.resch@code-intelligence.de>
|
Ping @stefanbucur. Is there any interest in adding this? |
Adds the flag --@rules_fuzzing//fuzzing:compiler_type with possible configurations "cmake" and "gcc". This allows running honggfuzz with a gcc toolchain which can be useful for code bases that don't compile with clang or where no clang toolchain is available. Co-authored-by: Markus Zoppelt <markus.zoppelt@code-intelligence.com>
| ) | ||
|
|
||
| config_setting( | ||
| name = "is_gcc", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could be replaced with the predefined settings in @rules_cc//cc/compiler. Then we don't need compiler_type at all as the choice will be determined by the C++ toolchain.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I originally attempted something based on @rules_cc//cc/compiler but got stuck on this error
ERROR: .../rules_fuzzing/examples/java/BUILD:31:15: On dependency edge //examples/java:EmptyFuzzTest_bin (3b35bd8) -|binary|-> //examples/java:EmptyFuzzTest_raw_: attempting to transition on '@@rules_cc+//cc/compiler:gcc' which is not a build setting
when adding @rules_cc//cc/compiler:gcc as an input to the fuzzing_binary_transition transition. Do you have an idea how to access the compiler type from the transition without it being an explicit flag?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I followed up on bazelbuild/rules_cc#435. If we had that, we could read the compiler from an implicit attribute of the fuzzing_binary rule.
Let's wait for a few days before we look into alternatives.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's in now, we would just need to update rules_cc.
Adds the flag
--@rules_fuzzing//fuzzing:compiler_typewith possible configurationscmakeandgcc. This allows running honggfuzz with a gcc toolchain which can be useful for code bases that don't compile with clang or where no clang toolchain is available.Example usage:
Invalid engine / compiler combination: