Skip to content

Commit 0c0a271

Browse files
committed
Merge bitcoin#31954: doc: update fuzz instructions when on macOS
75486c8 doc: update fuzz instructions when on macOS (Max Edwards) Pull request description: Fixes: bitcoin#31049 Updates the instructions for fuzzing on macOS to use `lld` instead of `ld`. Tested instructions on M1 Mac running 14.6.1 ACKs for top commit: l0rinc: ACK 75486c8 brunoerg: ACK 75486c8 hebasto: ACK 75486c8, tested on macOS 15.3.1 (Apple M1) + Clang 19.1.7. Tree-SHA512: 2c5645d78fce1644964dee55c8ca6a6549bfd4f4a9a5719bbe49264f7216f0267c27999e23402a47eecbc8502985d812b986bf6850a5d63d110bdb98769f23c2
2 parents a2ab2fa + 75486c8 commit 0c0a271

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

doc/fuzzing.md

+5-2
Original file line numberDiff line numberDiff line change
@@ -153,13 +153,16 @@ You may also need to take care of giving the correct path for `clang` and
153153
`clang++`, like `CC=/path/to/clang CXX=/path/to/clang++` if the non-systems
154154
`clang` does not come first in your path.
155155
156-
Full configuration step that was tested on macOS with `brew` installed `llvm`:
156+
Using `lld` is required due to issues with Apple's `ld` and `LLVM`.
157+
158+
Full configuration step for macOS:
157159
158160
```sh
161+
$ brew install llvm lld
159162
$ cmake --preset=libfuzzer \
160163
-DCMAKE_C_COMPILER="$(brew --prefix llvm)/bin/clang" \
161164
-DCMAKE_CXX_COMPILER="$(brew --prefix llvm)/bin/clang++" \
162-
-DAPPEND_LDFLAGS=-Wl,-no_warn_duplicate_libraries
165+
-DCMAKE_EXE_LINKER_FLAGS="-fuse-ld=lld"
163166
```
164167
165168
Read the [libFuzzer documentation](https://llvm.org/docs/LibFuzzer.html) for more information. This [libFuzzer tutorial](https://github.com/google/fuzzing/blob/master/tutorial/libFuzzerTutorial.md) might also be of interest.

0 commit comments

Comments
 (0)