- Remove or consolidate macOS notes sprinkled throughout the doc into dedicated section
- Note that support for fuzzing on macOS is not maintained
- Provide best effort steps for fuzzing macOS
Closes #33731
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/33921.
See the guideline for information on the review process.
| Type | Reviewers |
|---|---|
| ACK | ismaelsadeeq, darosior |
| Concept ACK | l0rinc, brunoerg |
If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.
Possible typos and grammar issues:
drahtbot_id_5_m
7@@ -8,8 +8,6 @@ To quickly get started fuzzing Bitcoin Core using [libFuzzer](https://llvm.org/d
8 $ git clone https://github.com/bitcoin/bitcoin
9 $ cd bitcoin/
10 $ cmake --preset=libfuzzer
11-# macOS users: If you have problem with this step then make sure to read "macOS hints for
224-# Also, it might be required to run "afl-system-config" to adjust the shared
225-# memory parameters.
226 $ mkdir -p inputs/ outputs/
227 $ echo A > inputs/thin-air-input
228 $ FUZZ=bech32 ./AFLplusplus/afl-fuzz -i inputs/ -o outputs/ -- build_fuzz/bin/fuzz
229-# You may have to change a few kernel parameters to test optimally - afl-fuzz
197+Reproducing and debugging fuzz testcases on macOS is supported, by building the
198+fuzz binary without support for any specific fuzzing engine.
199
200-Using `lld` is required due to issues with Apple's `ld` and `LLVM`.
201+You may still be able to fuzz on macOS using the following steps (provided on
202+best effort basis, only aimed at the latest macOS version, may be outdated):
provided on best effort basis -> provided on a best-effort basis [missing article "a" and standard phrasing uses "best-effort" as a compound adjective]
208 $ brew install llvm lld
209-$ cmake --preset=libfuzzer \
210+$ cmake --preset=libfuzzer-nosan \
211 -DCMAKE_C_COMPILER="$(brew --prefix llvm)/bin/clang" \
212 -DCMAKE_CXX_COMPILER="$(brew --prefix llvm)/bin/clang++" \
213 -DCMAKE_EXE_LINKER_FLAGS="-fuse-ld=lld"
since this is an alternative to the above linux one and since the build directory is changed now, should we add
0 cmake --build build_fuzz_nosan -j$(nproc)
1 FUZZ=coins_view_db build_fuzz_nosan/bin/fuzz
after this?
205-
206-```sh
207+```
208 $ brew install llvm lld
209-$ cmake --preset=libfuzzer \
210+$ cmake --preset=libfuzzer-nosan \
As described in #32084 (comment) this doesn’t seem to be enough for me, I’m getting a lot of failures locally on my non-intel-based Mac.
It needs a few more parameters to avoid being tangled with local AppleClang:
0cmake --preset=libfuzzer-nosan \
1 -DCMAKE_C_COMPILER="$(brew --prefix llvm)/bin/clang" \
2 -DCMAKE_CXX_COMPILER="$(brew --prefix llvm)/bin/clang++" \
3 -DCMAKE_OSX_SYSROOT="$(xcrun --show-sdk-path)" \
4 -DCMAKE_EXE_LINKER_FLAGS="-fuse-ld=lld -L$(brew --prefix llvm)/lib/c++"
ACK 6e37b3b4861733ca97ec5d27d0bf52d187b6a2c9
nit: i think it would be good to have a sentence that fuzzing support is only maintained for Linux platforms as the first line of the document, so readers know what to expect. It’s fine if it’s also repeated in the “MacOS notes” section.