From dc57f98cfa416b5552c301e86d52b27dfd7d71bd Mon Sep 17 00:00:00 2001 From: Edoardo Marangoni Date: Mon, 23 Sep 2024 12:05:57 +0200 Subject: [PATCH 1/3] Update Windows version and use Ninja --- .github/workflows/ci.yml | 13 ++++++------- build.ps1 | 8 ++++---- build.sh | 7 +++---- 3 files changed, 13 insertions(+), 15 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 18c069e..c3de62d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,7 +22,7 @@ jobs: os: 'macos-latest' tar_extra_args: '' - id: 'windows-amd64' - os: 'windows-2019' + os: 'windows-2022' # When unpacking an archive on Windows, the symlinks can't be # created unless the target path already exists. This causes # problems when the linked file is ordered after the link @@ -64,12 +64,11 @@ jobs: run: | brew install ninja - # TODO(jubianchi): Re-enable this to build on MingW - # - name: Install `ninja` on Windows - # if: startsWith(matrix.target.id, 'windows-') - # shell: bash - # run: | - # choco install ninja + - name: Install `ninja` on Windows + if: startsWith(matrix.target.id, 'windows-') + shell: bash + run: | + choco install ninja - name: Build if: matrix.target.id != 'windows-amd64' && matrix.target.id != 'linux-aarch64' && matrix.target.id != 'linux-riscv64' diff --git a/build.ps1 b/build.ps1 index 4a326e3..e39e569 100755 --- a/build.ps1 +++ b/build.ps1 @@ -17,7 +17,7 @@ if ([string]::IsNullOrEmpty($LLVM_VERSION)) { # Clone the LLVM project. if (-not (Test-Path -Path "llvm-project" -PathType Container)) { - git clone "$LLVM_REPO_URL" llvm-project + git clone -b "release/$LLVM_VERSION" --single-branch --depth=1 "$LLVM_REPO_URL" llvm-project } Set-Location llvm-project @@ -40,10 +40,10 @@ $CROSS_COMPILE = "" # Run `cmake` to configure the project. cmake ` - -G "Visual Studio 16 2019" ` + -G "Ninja" ` -DCMAKE_BUILD_TYPE=MinSizeRel ` -DCMAKE_INSTALL_PREFIX=destdir ` - -DLLVM_ENABLE_PROJECTS="clang;lld" ` + -DLLVM_ENABLE_PROJECTS="polly;lldb;lld;compiler-rt;clang-tools-extra;clang" ` -DLLVM_ENABLE_TERMINFO=OFF ` -DLLVM_ENABLE_ZLIB=OFF ` -DLLVM_INCLUDE_DOCS=OFF ` @@ -51,7 +51,7 @@ cmake ` -DLLVM_INCLUDE_GO_TESTS=OFF ` -DLLVM_INCLUDE_TESTS=OFF ` -DLLVM_INCLUDE_TOOLS=ON ` - -DLLVM_INCLUDE_UTILS=OFF ` + -DLLVM_INCLUDE_UTILS=ON ` -DLLVM_OPTIMIZED_TABLEGEN=ON ` -DLLVM_TARGETS_TO_BUILD="X86;AArch64;RISCV;WebAssembly" ` $CROSS_COMPILE ` diff --git a/build.sh b/build.sh index 19a96fb..ab925a2 100755 --- a/build.sh +++ b/build.sh @@ -23,7 +23,7 @@ fi # Clone the LLVM project. if [ ! -d llvm-project ] then - git clone "$LLVM_REPO_URL" llvm-project + git clone -b "release/$LLVM_VERSION" --single-branch --depth=1 "$LLVM_REPO_URL" llvm-project fi @@ -62,15 +62,14 @@ cmake \ -G Ninja \ -DCMAKE_BUILD_TYPE=MinSizeRel \ -DCMAKE_INSTALL_PREFIX="/" \ - -DLLVM_ENABLE_PROJECTS="clang;lld" \ + -DLLVM_ENABLE_PROJECTS="polly;lldb;lld;compiler-rt;clang-tools-extra;clang" \ -DLLVM_ENABLE_TERMINFO=OFF \ -DLLVM_ENABLE_ZLIB=OFF \ -DLLVM_INCLUDE_DOCS=OFF \ -DLLVM_INCLUDE_EXAMPLES=OFF \ - -DLLVM_INCLUDE_GO_TESTS=OFF \ -DLLVM_INCLUDE_TESTS=OFF \ -DLLVM_INCLUDE_TOOLS=ON \ - -DLLVM_INCLUDE_UTILS=OFF \ + -DLLVM_INCLUDE_UTILS=ON \ -DLLVM_OPTIMIZED_TABLEGEN=ON \ -DLLVM_TARGETS_TO_BUILD="X86;AArch64;RISCV;WebAssembly" \ "${CROSS_COMPILE}" \ From cdf933d5a9fbed8f5b4b19f98071659f4296f723 Mon Sep 17 00:00:00 2001 From: Edoardo Marangoni Date: Mon, 23 Sep 2024 15:24:44 +0200 Subject: [PATCH 2/3] Remove Polly, build for macOS-amd64 --- .github/workflows/ci.yml | 6 ++++++ build.ps1 | 5 ++--- build.sh | 4 ++-- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c3de62d..5a8ba25 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,8 +19,14 @@ jobs: os: "ubuntu-latest" # os: ['self-hosted', 'linux', 'RISCV64'] - id: 'darwin-amd64' + os: 'macos-13' + tar_extra_args: '' + - id: 'darwin-aarch64' os: 'macos-latest' tar_extra_args: '' + # When unpacking an archive on Windows, the symlinks can't be + # created unless the target path already exists. This causes + # problems when the linked file is ordered after the link - id: 'windows-amd64' os: 'windows-2022' # When unpacking an archive on Windows, the symlinks can't be diff --git a/build.ps1 b/build.ps1 index e39e569..d40d2bd 100755 --- a/build.ps1 +++ b/build.ps1 @@ -43,15 +43,14 @@ cmake ` -G "Ninja" ` -DCMAKE_BUILD_TYPE=MinSizeRel ` -DCMAKE_INSTALL_PREFIX=destdir ` - -DLLVM_ENABLE_PROJECTS="polly;lldb;lld;compiler-rt;clang-tools-extra;clang" ` + -DLLVM_ENABLE_PROJECTS="clang;lld" ` -DLLVM_ENABLE_TERMINFO=OFF ` -DLLVM_ENABLE_ZLIB=OFF ` -DLLVM_INCLUDE_DOCS=OFF ` -DLLVM_INCLUDE_EXAMPLES=OFF ` - -DLLVM_INCLUDE_GO_TESTS=OFF ` -DLLVM_INCLUDE_TESTS=OFF ` -DLLVM_INCLUDE_TOOLS=ON ` - -DLLVM_INCLUDE_UTILS=ON ` + -DLLVM_INCLUDE_UTILS=OFF ` -DLLVM_OPTIMIZED_TABLEGEN=ON ` -DLLVM_TARGETS_TO_BUILD="X86;AArch64;RISCV;WebAssembly" ` $CROSS_COMPILE ` diff --git a/build.sh b/build.sh index ab925a2..12d4ef9 100755 --- a/build.sh +++ b/build.sh @@ -62,14 +62,14 @@ cmake \ -G Ninja \ -DCMAKE_BUILD_TYPE=MinSizeRel \ -DCMAKE_INSTALL_PREFIX="/" \ - -DLLVM_ENABLE_PROJECTS="polly;lldb;lld;compiler-rt;clang-tools-extra;clang" \ + -DLLVM_ENABLE_PROJECTS="clang;lld" \ -DLLVM_ENABLE_TERMINFO=OFF \ -DLLVM_ENABLE_ZLIB=OFF \ -DLLVM_INCLUDE_DOCS=OFF \ -DLLVM_INCLUDE_EXAMPLES=OFF \ -DLLVM_INCLUDE_TESTS=OFF \ -DLLVM_INCLUDE_TOOLS=ON \ - -DLLVM_INCLUDE_UTILS=ON \ + -DLLVM_INCLUDE_UTILS=OFF \ -DLLVM_OPTIMIZED_TABLEGEN=ON \ -DLLVM_TARGETS_TO_BUILD="X86;AArch64;RISCV;WebAssembly" \ "${CROSS_COMPILE}" \ From 9619cd704edf4ca318b699360d3d1d6dfcb5f6bd Mon Sep 17 00:00:00 2001 From: Edoardo Marangoni Date: Mon, 23 Sep 2024 15:40:01 +0200 Subject: [PATCH 3/3] Upload for macOS --- .github/workflows/ci.yml | 14 ++++++++++++-- README.md | 14 ++++++++------ 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5a8ba25..e2b81da 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -174,7 +174,7 @@ jobs: with: upload_url: ${{ steps.create_release.outputs.upload_url }} asset_path: artifacts/linux-aarch64-${{matrix.llvm_version}}/llvm.tar.xz - asset_name: linux-aarch64.tar.xz + asset_name: llvm-linux-aarch64.tar.xz asset_content_type: application/gzip - name: Upload Release Asset Linux (RISCV64) @@ -184,7 +184,7 @@ jobs: with: upload_url: ${{ steps.create_release.outputs.upload_url }} asset_path: artifacts/linux-riscv64-${{matrix.llvm_version}}/llvm.tar.xz - asset_name: linux-riscv64.tar.xz + asset_name: llvm-linux-riscv64.tar.xz asset_content_type: application/gzip - name: Upload Release Asset Darwin @@ -197,6 +197,16 @@ jobs: asset_name: llvm-darwin-amd64.tar.xz asset_content_type: application/gzip + - name: Upload Release Asset Darwin (aarch64) + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: artifacts/darwin-aarch64-${{matrix.llvm_version}}/llvm.tar.xz + asset_name: llvm-darwin-aarch64.tar.xz + asset_content_type: application/gzip + - name: Upload Release Asset Windows uses: actions/upload-release-asset@v1 env: diff --git a/README.md b/README.md index 120359a..086a53e 100644 --- a/README.md +++ b/README.md @@ -52,25 +52,27 @@ assets](https://github.com/wasmerio/llvm-custom-builds/releases). 18 amd64 Darwin - download + download Linux - download + download Windows - download + download - aarch64 + aarch64 Linux - download + download + Darwin + download riscv64 Linux - download + download 16