git: workaround new requirement to use common-main #7818
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Due to upstream changes, the Git fuzzers must now link against
common-main.o; however, this breaks the build in two ways:
Linking with common-main.o causes main() to have multiple
definitions, one in common-main.o and one from the fuzzing engine.
To avoid [infra] some changes #1, the Git Makefile specifically excludes common-main.o
from the fuzzer build rule.
To work around these issues, we can override FUZZ_CXXFLAGS (add
"-Wl,--allow-multiple-definition" to fix #1) and LIB_FUZZING_ENGINE (add
"common-main.o" to fix #2).
Once we can get a Makefile fix into Git's upstream, we can remove the
override for LIB_FUZZING_ENGINE.