Currently the linker is invoked more than 150 times when compiling with --enable-fuzz
. This is problematic for several reasons:
- It wastes disk space north of 20 GB, as all libraries and sanitizers are linked more than 150 times
- It wastes CPU time, as the link step can practically not be cached (similar to ccache for object files)
- It makes it a blocker to compile the fuzz tests by default for non-fuzz builds #19388, for the aforementioned reasons
- The build file is several thousand lines of code, without doing anything meaningful except listing each fuzz target in a highly verbose manner
- It makes writing new fuzz tests unnecessarily hard, as build system knowledge is required; Compare that to boost unit tests, which can be added by simply editing an existing cpp file
- It encourages fuzz tests that re-use the
buffer
or assume thebuffer
to be concatenations of seeds, which increases complexity of seeds and complexity for the fuzz engine to explore; Thus reducing the effectiveness of the affected fuzz targets
Fixes #20088