Fix macOS fuzz: use Xcode clang instead of Homebrew LLVM

Homebrew LLVM 18's ASAN/libFuzzer runtimes contain weak-def symbols
for typed allocation operators (__ZnwmSt19__type_descriptor_t) that
don't exist in macOS 14's system libc++. Since the symbol is embedded
in the pre-built runtime dylibs (not our code), link-time flags cannot
fix it.

Switch to Apple's Xcode clang which ships its own libFuzzer and ASAN
runtime built against the system libc++ — no ABI mismatch possible.
No Homebrew LLVM install needed.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Alex Garcia 2026-03-03 10:44:39 -08:00
parent b93a669224
commit e4b1e264b5

View file

@ -63,20 +63,17 @@ jobs:
runs-on: macos-14 runs-on: macos-14
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Install LLVM 18 # Use Apple's Xcode clang (avoids Homebrew LLVM libc++ ABI issues
run: brew install llvm@18 # with __ZnwmSt19__type_descriptor_t on macOS 14).
- run: ./scripts/vendor.sh - run: ./scripts/vendor.sh
- name: Generate sqlite-vec.h - name: Generate sqlite-vec.h
run: make sqlite-vec.h run: make sqlite-vec.h
- name: Build fuzz targets - name: Build fuzz targets
run: | run: |
LLVM=/opt/homebrew/opt/llvm@18
make -C tests/fuzz all \ make -C tests/fuzz all \
FUZZ_CC=$LLVM/bin/clang \ FUZZ_CC=$(xcrun -f clang) \
FUZZ_LDFLAGS="-Wl,-ld_classic -nostdlib++ -L$LLVM/lib/c++ -lc++ -Wl,-rpath,$LLVM/lib/c++" FUZZ_LDFLAGS=""
- name: Run fuzz targets - name: Run fuzz targets
env:
DYLD_LIBRARY_PATH: "/opt/homebrew/opt/llvm@18/lib/c++:${{ env.DYLD_LIBRARY_PATH }}"
run: | run: |
DURATION=${{ github.event.inputs.duration || '60' }} DURATION=${{ github.event.inputs.duration || '60' }}
EXIT_CODE=0 EXIT_CODE=0