Support for using honggfuzz with gcc#263
Support for using honggfuzz with gcc#263simonresch wants to merge 3 commits intobazel-contrib:mainfrom
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.
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.
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.
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.
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: