mirror of
https://github.com/ziglang/zig.git
synced 2024-11-24 13:20:14 +00:00
Updated Troubleshooting Build Issues (markdown)
parent
9831d82999
commit
a1055ff3ea
@ -14,6 +14,10 @@ different one, for example GCC vs clang.
|
||||
|
||||
LLVM, Clang, and Zig must all be compiled with the same C++ compiler.
|
||||
|
||||
## Undefined references in `liblldELF.a`
|
||||
|
||||
Building with LLVM 14 has `zlib` as a new requirement. If your system has static `zlib` then `-DZIG_STATIC_ZLIB=ON` needs to be specified to use it.
|
||||
|
||||
## Building stage2 and stage3
|
||||
|
||||
After successful building stage1, you build stage2 (or the same with stage3).
|
||||
@ -86,8 +90,6 @@ On M1 Macs, static linking with homebrew LLVM does not seem to work. Omit `-DZIG
|
||||
|
||||
For similar reasons, you should also dynamically link to clang. This can be done by specifying `-DZIG_PREFER_CLANG_CPP_DYLIB=true`. Static linking is default for clang, dynamic linking is default for LLVM.
|
||||
|
||||
Building with LLVM 14 has `zlib` as a new requirement. `zlib` can be installed with homebrew, but must be configured for static linking using `-DZIG_STATIC_ZLIB=ON`
|
||||
|
||||
Final command for dynamically linking to homebrew LLVM/Clang on M1 Macs:
|
||||
```
|
||||
cmake .. -DCMAKE_PREFIX_PATH=$(brew --prefix llvm) -DZIG_PREFER_CLANG_CPP_DYLIB=true -DZIG_STATIC_ZLIB=ON
|
||||
|
Loading…
Reference in New Issue
Block a user