Skip to content

Conversation

@atharva-potdar
Copy link
Contributor

Regarding #3649, on macOS, linking libafl_libfuzzer fails when optional libfuzzer hook symbols are not provided, since the linker does not tolerate unresolved references even when the hooks are intended to be optional.

To fix this, I added weak fallback implementations for the custom mutator and crossover hooks into FuzzerInterceptors.cpp. They ensure that the symbols always exist at link time, and still allow for user-defined hooks to override them if they are present.
I also added a macOS-only CI job to build libafl_targets and libafl_libfuzzer to check if it works.

Let me know if there's anything else I should change!

On Windows, weak symbols aren't supported like they are on Linux.
So, we only add the __attribute__((weak)) if it is not on Windows.
It prevents the following error on Windows -
fatal error C1189: #error:  The C++ Standard Library forbids macroizing the keyword "false"
@atharva-potdar atharva-potdar marked this pull request as ready for review January 16, 2026 15:39
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.

1 participant