#Can't build Zig on macOS (M1 Mac)

1 messages · Page 1 of 1 (latest)

river axle
#

Getting this build error when it goes to compile zig3:

MachO Flush... error(link): jump too big to encode as i28 displacement value
error(link):   (target - source) = displacement => 0x108c8510c - 0x100002508 = 0x8c82c04
error(link):   TODO implement branch islands to extend jump distance for arm64
thread 5309900 panic: attempt to unwrap error: TODOImplementBranchIslands

CMake was run as:
cmake .. -DCMAKE_PREFIX_PATH=$HOME/local/llvm15-release -DZIG_STATIC_LLVM=on

#

so found this

#

but i am building llvm myself using

cmake ../llvm \
  -DCMAKE_INSTALL_PREFIX=$HOME/local/llvm15-release \
  -DCMAKE_PREFIX_PATH=$HOME/local/llvm15-release \
  -DCMAKE_BUILD_TYPE=Release \
  -DLLVM_ENABLE_PROJECTS="lld;clang" \
  -DLLVM_ENABLE_LIBXML2=OFF \
  -DLLVM_ENABLE_TERMINFO=OFF \
  -DLLVM_ENABLE_LIBEDIT=OFF \
  -DLLVM_ENABLE_ASSERTIONS=ON \
  -G Ninja \
  -DLLVM_PARALLEL_LINK_JOBS=1
#

and LTO is not enabled

#

unless i have to disable lto?

#

and don't see a work around...

#

is there a way not build the self-hosting compiler?

#

there are up to date builds on the website, so something has to work here

robust hare
#

make zig1

river axle
# robust hare `make zig1`

thank you. that does produce the zig1 executable, but is there a make target where it will prepare the library and zig executable (i.e. make install), but uses the zig1 executable instead?

#

i guess another way of asking, is make install completely broken on M1 now?

robust hare
#

im not sure, i never use make install

glass shadow
#

interesting to see that I'm not the only one hitting this error, wasn't sure if it was related to my setup or not!

river axle
river axle