44set -eu
55
66TARGET=" $1 " # Example: riscv64-linux-gnu
7- MCPU=" $2 " # Examples: `baseline`, `native`, `generic+v7a`, or `arm1176jzf_s`
7+ MCPU=" $2 " # Examples: `baseline`, `native`, `generic+v7a`, or `arm1176jzf_s`
88
99ROOTDIR=" $( pwd) "
1010ZIG_VERSION=" 0.16.0-dev.660+27aba2d77"
@@ -14,12 +14,12 @@ TARGET_OS_AND_ABI=${TARGET#*-} # Example: linux-gnu
1414# Here we map the OS from the target triple to the value that CMake expects.
1515TARGET_OS_CMAKE=${TARGET_OS_AND_ABI% -* } # Example: linux
1616case $TARGET_OS_CMAKE in
17- macos* ) TARGET_OS_CMAKE=" Darwin" ;;
18- freebsd* ) TARGET_OS_CMAKE=" FreeBSD" ;;
19- netbsd* ) TARGET_OS_CMAKE=" NetBSD" ;;
20- windows* ) TARGET_OS_CMAKE=" Windows" ;;
21- linux* ) TARGET_OS_CMAKE=" Linux" ;;
22- native) TARGET_OS_CMAKE=" " ;;
17+ macos* ) TARGET_OS_CMAKE=" Darwin" ;;
18+ freebsd* ) TARGET_OS_CMAKE=" FreeBSD" ;;
19+ netbsd* ) TARGET_OS_CMAKE=" NetBSD" ;;
20+ windows* ) TARGET_OS_CMAKE=" Windows" ;;
21+ linux* ) TARGET_OS_CMAKE=" Linux" ;;
22+ native) TARGET_OS_CMAKE=" " ;;
2323esac
2424
2525# First build the libraries for Zig to link against, as well as native `llvm-tblgen`.
@@ -29,6 +29,7 @@ cmake "$ROOTDIR/llvm" \
2929 -DCMAKE_INSTALL_PREFIX=" $ROOTDIR /out/host" \
3030 -DCMAKE_PREFIX_PATH=" $ROOTDIR /out/host" \
3131 -DCMAKE_BUILD_TYPE=Release \
32+ -DCMAKE_ASM_COMPILER=" cc" \
3233 -DLLVM_ENABLE_BINDINGS=OFF \
3334 -DLLVM_ENABLE_LIBEDIT=OFF \
3435 -DLLVM_ENABLE_LIBPFM=OFF \
0 commit comments