diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 25e2a99..2aacc8f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -22,7 +22,13 @@ jobs: python-version: "3.x" - name: Build toolchain - run: ./build.sh + run: | + sudo apt-get -y install cmake ninja-build libzstd-dev binutils-dev + wget https://apt.llvm.org/llvm.sh + chmod +x llvm.sh + sudo ./llvm.sh 17 + rm llvm.sh + ./build.sh - name: Upload build artifact uses: actions/upload-artifact@v4 @@ -93,6 +99,7 @@ jobs: - name: Build toolchain run: | + brew install ninja zstd binutils ./build.sh clone build mkdir tmp tar c out | xz --x86 --lzma2 > tmp/out.x64.tar.xz @@ -119,9 +126,8 @@ jobs: python-version: "3.x" - name: Build toolchain - env: - SKIP_DIST: 1 run: | + brew install ninja zstd binutils ./build.sh clone build mkdir tmp tar c out | xz > tmp/out.arm64.tar.xz diff --git a/build.sh b/build.sh index a5f535f..8df8912 100755 --- a/build.sh +++ b/build.sh @@ -23,30 +23,21 @@ if [ $OS = "darwin" ]; then NATIVE_TRIPLE="${NATIVE_ARCH}-apple-darwin" DYN_EXT='dylib' EXE_FMT='Mach-O' - - # Hardcode to 16k page to support both x64 and arm64 - # export JEMALLOC_SYS_WITH_LG_PAGE=14 - - command -v ninja >/dev/null || brew install ninja - command -v zstd >/dev/null || brew install zstd - brew install binutils - sed -i '' "s|BREW_PREFIX|$(brew --prefix)|g" config-darwin.toml else NDK_DIRNAME='linux-x86_64' TRIPLE="${ARCH}-unknown-linux-gnu" NATIVE_TRIPLE="${NATIVE_ARCH}-unknown-linux-gnu" DYN_EXT='so' EXE_FMT='ELF' - - command -v cmake >/dev/null || sudo apt-get -y install cmake - command -v ninja >/dev/null || sudo apt-get -y install ninja-build - command -v clang-12 >/dev/null || sudo apt-get -y install clang-12 - command -v lld-12 >/dev/null || sudo apt-get -y install lld-12 - dpkg-query -W libzstd-dev >/dev/null 2>&1 || sudo apt-get -y install libzstd-dev - sudo apt-get -y install binutils-dev fi build() { + if [ $OS = "darwin" ]; then + sed -i '' "s|BREW_PREFIX|$(brew --prefix)|g" config-darwin.toml + # Manually set page size if cross compilation is required (arm64 require 16k page) + # export JEMALLOC_SYS_WITH_LG_PAGE=14 + fi + cd rust python3 ./x.py --config "../config-${OS}.toml" --host $TRIPLE install cd ../ diff --git a/config-linux.toml b/config-linux.toml index 8be6f21..8251e23 100644 --- a/config-linux.toml +++ b/config-linux.toml @@ -47,6 +47,6 @@ codegen-units = 1 [target.x86_64-unknown-linux-gnu] llvm-has-rust-patches = false -cc = "clang-12" -cxx = "clang++-12" -linker = "clang-12" +cc = "clang-17" +cxx = "clang++-17" +linker = "clang-17"