Hi there, I am trying to build Zig locally from source on macOS with the given command in the wiki:
cmake .. -DZIG_STATIC_LLVM=ON -DZIG_STATIC_ZSTD=ON -DCMAKE_PREFIX_PATH="$(brew --prefix llvm@21);$(brew --prefix lld@21);$(brew --prefix zstd)/lib"
However, make install fails at the zig2 build stage.
ld: multiple errors: could not parse bitcode object file /opt/homebrew/opt/llvm/lib/libclangCodeGen.a(X86.cpp.o): 'Unknown attribute kind (102) (Producer: 'LLVM21.1.6' Reader: 'LLVM APPLE_1_1700.4.4.1_0')', using libLTO version 'LLVM version 17.0.0' in '/opt/homebrew/opt/llvm/lib/libclangCodeGen.a(X86.cpp.o)'; ...
It seems like the build script is not using Homebrew’s LLVM 21 LTO library. Is there an additional flag that I need to pass?
Edit: trying to use zig-bootstrap instead