Skip to content

Commit 75486c8

Browse files
committed
doc: update fuzz instructions when on macOS
Default linker on macOS does not work with recent versions of LLVM. Updated the instructions for fuzzing to use lld instead.
1 parent 15717f0 commit 75486c8

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

doc/fuzzing.md

Lines changed: 5 additions & 2 deletions
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)