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

git: workaround new requirement to use common-main #7818

Merged
merged 1 commit into from
Jul 16, 2022

Conversation

steadmon
Copy link
Contributor

@steadmon steadmon commented Jun 7, 2022

Due to upstream changes, the Git fuzzers must now link against
common-main.o; however, this breaks the build in two ways:

  1. Linking with common-main.o causes main() to have multiple
    definitions, one in common-main.o and one from the fuzzing engine.

  2. 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.

Due to upstream changes, the Git fuzzers must now link against
common-main.o; however, this breaks the build in two ways:

1) Linking with common-main.o causes main() to have multiple
definitions, one in common-main.o and one from the fuzzing engine.

2) To avoid google#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 google#1) and LIB_FUZZING_ENGINE (add
"common-main.o" to fix google#2).

Once we can get a Makefile fix into Git's upstream, we can remove the
override for LIB_FUZZING_ENGINE.

However, this change causes `check_build` to fail for honggfuzz, and we
have not yet been able to diagnose the reason. So for now, we also need
to limit our engines to afl and libfuzzer.
@DavidKorczynski DavidKorczynski merged commit 930fa57 into google:master Jul 16, 2022
MartinPetkov pushed a commit to MartinPetkov/oss-fuzz that referenced this pull request Aug 15, 2022
Due to upstream changes, the Git fuzzers must now link against
common-main.o; however, this breaks the build in two ways:

1) Linking with common-main.o causes main() to have multiple
definitions, one in common-main.o and one from the fuzzing engine.

2) To avoid google#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 google#1) and LIB_FUZZING_ENGINE (add
"common-main.o" to fix google#2).

Once we can get a Makefile fix into Git's upstream, we can remove the
override for LIB_FUZZING_ENGINE.

However, this change causes `check_build` to fail for honggfuzz, and we
have not yet been able to diagnose the reason. So for now, we also need
to limit our engines to afl and libfuzzer.
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