Skip to content

Commit

Permalink
[LLVM] Bump to llvm 19.1.6
Browse files Browse the repository at this point in the history
* Update windows sdk to 26100
* Use built-in cmake

Signed-off-by: Shen-Ta Hsieh <[email protected]>
  • Loading branch information
ibmibmibm committed Dec 24, 2024
1 parent 0f8709e commit 941a651
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 67 deletions.
45 changes: 22 additions & 23 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,56 +25,55 @@ jobs:
- name: Install dependency
uses: crazy-max/ghaction-chocolatey@v1
with:
args: install cmake ninja vswhere 7zip.install
args: install --no-progress ninja vswhere 7zip.install
- name: Upgrade dependency
uses: crazy-max/ghaction-chocolatey@v1
with:
args: upgrade llvm
args: upgrade --no-progress llvm

- uses: GuillaumeFalourd/setup-windows10-sdk-action@v2
with:
sdk-version: 22621
sdk-version: 26100

- name: Checkout by pushing tags
run: git clone --branch llvmorg-17.0.6 --depth 1 https://github.com/llvm/llvm-project.git
- name: Checkout llvm
run: git clone --quiet --branch llvmorg-19.1.6 --depth 1 https://github.com/llvm/llvm-project.git

- name: Build llvm stage 1
run: |
$vsPath = (vswhere -latest -property installationPath)
Import-Module (Join-Path $vsPath "Common7\Tools\Microsoft.VisualStudio.DevShell.dll")
Enter-VsDevShell -VsInstallPath $vsPath -SkipAutomaticLocation -DevCmdArguments "-arch=x64 -host_arch=x64 -winsdk=10.0.22621.0"
Enter-VsDevShell -VsInstallPath $vsPath -SkipAutomaticLocation -DevCmdArguments "-arch=x64 -host_arch=x64 -winsdk=10.0.26100.0"
$prefix = "$pwd\prefix"
$Env:CC = "clang-cl"
$Env:CXX = "clang-cl"
$cmake_sys_ver = "10.0.22621.0"
cmake -Bbuild -GNinja "-DCMAKE_SYSTEM_VERSION=$cmake_sys_ver" -DCMAKE_MSVC_RUNTIME_LIBRARY=${{ matrix.rtlib }} -DCMAKE_BUILD_TYPE=Release -DCPACK_GENERATOR=ZIP "-DCMAKE_INSTALL_PREFIX=$pwd\\prefix" -DLLVM_TARGETS_TO_BUILD="X86" -DLLVM_ENABLE_PROJECTS="lld;clang;clang-tools-extra" -DLLVM_ENABLE_DIA_SDK=OFF llvm-project\\llvm
cmake --build build --target package
Expand-Archive -Path build/*.zip -DestinationPath "$pwd"
$cmake_mt = "mt"
$cmake_sys_ver = "10.0.26100.0"
cmake -Bbuild -GNinja -DCMAKE_SYSTEM_VERSION=$cmake_sys_ver -DCMAKE_MSVC_RUNTIME_LIBRARY=${{ matrix.rtlib }} -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX:PATH=$prefix -DCMAKE_MT:PATH=$cmake_mt -DLLVM_TARGETS_TO_BUILD="X86" -DLLVM_ENABLE_PROJECTS="lld;clang;clang-tools-extra" -DLLVM_ENABLE_DIA_SDK=OFF llvm-project\llvm
cmake --build build --target install
Remove-Item -Recurse -Force build
- name: Build llvm stage 2
run: |
$vsPath = (vswhere -latest -property installationPath)
Import-Module (Join-Path $vsPath "Common7\Tools\Microsoft.VisualStudio.DevShell.dll")
Enter-VsDevShell -VsInstallPath $vsPath -SkipAutomaticLocation -DevCmdArguments "-arch=x64 -host_arch=x64 -winsdk=10.0.22621.0"
$Env:CC = "$pwd\\LLVM-17.0.6-win64\\bin\\clang-cl.exe"
$Env:CXX = "$pwd\\LLVM-17.0.6-win64\\bin\\clang-cl.exe"
$cmake_sys_ver = "10.0.22621.0"
cmake -Bbuild -GNinja "-DCMAKE_SYSTEM_VERSION=$cmake_sys_ver" -DCMAKE_MSVC_RUNTIME_LIBRARY=${{ matrix.rtlib }} -DCMAKE_BUILD_TYPE=Release -DCPACK_GENERATOR=ZIP "-DCMAKE_INSTALL_PREFIX=$pwd\\prefix" -DLLVM_TARGETS_TO_BUILD="X86" -DLLVM_ENABLE_PROJECTS="lld;clang;clang-tools-extra" -DLLVM_ENABLE_DIA_SDK=OFF llvm-project\\llvm
cmake --build build --target package
Enter-VsDevShell -VsInstallPath $vsPath -SkipAutomaticLocation -DevCmdArguments "-arch=x64 -host_arch=x64 -winsdk=10.0.26100.0"
$prefix = "$pwd\prefix"
$Env:CC = "$prefix\bin\clang-cl.exe"
$Env:CXX = "$prefix\bin\clang-cl.exe"
$cmake_mt = "mt"
$cmake_sys_ver = "10.0.26100.0"
cmake -Bbuild -GNinja -DCMAKE_SYSTEM_VERSION=$cmake_sys_ver -DCMAKE_MSVC_RUNTIME_LIBRARY=${{ matrix.rtlib }} -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX:PATH=$prefix -DCMAKE_MT:PATH=$cmake_mt -DLLVM_TARGETS_TO_BUILD="X86" -DLLVM_ENABLE_PROJECTS="lld;clang;clang-tools-extra" -DLLVM_ENABLE_DIA_SDK=OFF llvm-project\llvm
cmake --build build --target install
- name: Repack zip package
run: |
$name = (Get-Item build/LLVM-*.zip).Name
$basename = (Get-Item build/LLVM-*.zip).BaseName
Remove-Item -Recurse -Force "$basename"
Expand-Archive -Path "build/$name" -DestinationPath "$pwd"
Remove-Item "build/$name"
7z a -mx=9 -tzip -mtm=off -mtc=off -mta=off "build/$name" "$basename"
Rename-Item prefix LLVM-19.1.6-win64
7z a -mx=9 -tzip -mtm=off -mtc=off -mta=off LLVM-19.1.6-win64-${{ matrix.rtlib }}.zip LLVM-19.1.6-win64
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: llvm-${{ matrix.rtlib }}
path: build/*.zip
path: LLVM-*.zip
retention-days: 14
compression-level: 0
74 changes: 30 additions & 44 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,8 @@ on:
- "llvmorg-*"

jobs:
create_release:
name: Create release
runs-on: windows-latest
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
steps:
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: llvmorg-17.0.6
release_name: llvmorg-17.0.6
draft: true
prerelease: true

upload_assets:
build:
name: Build llvm on Windows
needs: create_release
runs-on: windows-2022
strategy:
matrix:
Expand All @@ -38,55 +20,59 @@ jobs:
- name: Install dependency
uses: crazy-max/ghaction-chocolatey@v1
with:
args: install cmake ninja vswhere 7zip.install
args: install --no-progress ninja vswhere 7zip.install
- name: Upgrade dependency
uses: crazy-max/ghaction-chocolatey@v1
with:
args: upgrade llvm

args: upgrade --no-progress llvm
- uses: GuillaumeFalourd/setup-windows10-sdk-action@v2
with:
sdk-version: 22621
sdk-version: 26100

- name: Checkout code
uses: actions/checkout@v4
- name: Ensure git safe directory
run: |
git config --global --add safe.directory $(pwd)
- name: Checkout by pushing tags
- name: Checkout llvm
if: ${{ github.event_name == 'push' }}
run: git clone --branch llvmorg-17.0.6 --depth 1 https://github.com/llvm/llvm-project.git
run: git clone --quiet --branch llvmorg-19.1.6 --depth 1 https://github.com/llvm/llvm-project.git

- name: Build llvm stage 1
run: |
$vsPath = (vswhere -latest -property installationPath)
Import-Module (Join-Path $vsPath "Common7\Tools\Microsoft.VisualStudio.DevShell.dll")
Enter-VsDevShell -VsInstallPath $vsPath -SkipAutomaticLocation -DevCmdArguments "-arch=x64 -host_arch=x64 -winsdk=10.0.22621.0"
Enter-VsDevShell -VsInstallPath $vsPath -SkipAutomaticLocation -DevCmdArguments "-arch=x64 -host_arch=x64 -winsdk=10.0.26100.0"
$prefix = "$pwd\prefix"
$Env:CC = "clang-cl"
$Env:CXX = "clang-cl"
$cmake_sys_ver = "10.0.22621.0"
cmake -Bbuild -GNinja "-DCMAKE_SYSTEM_VERSION=$cmake_sys_ver" -DCMAKE_MSVC_RUNTIME_LIBRARY=${{ matrix.rtlib }} -DCMAKE_BUILD_TYPE=Release -DCPACK_GENERATOR=ZIP "-DCMAKE_INSTALL_PREFIX=$pwd\\prefix" -DLLVM_TARGETS_TO_BUILD="X86" -DLLVM_ENABLE_PROJECTS="lld;clang;clang-tools-extra" -DLLVM_ENABLE_DIA_SDK=OFF llvm-project\\llvm
cmake --build build --target package
Expand-Archive -Path build/*.zip -DestinationPath "$pwd"
$cmake_mt = "mt"
$cmake_sys_ver = "10.0.26100.0"
cmake -Bbuild -GNinja -DCMAKE_SYSTEM_VERSION=$cmake_sys_ver -DCMAKE_MSVC_RUNTIME_LIBRARY=${{ matrix.rtlib }} -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX:PATH=$prefix -DCMAKE_MT:PATH=$cmake_mt -DLLVM_TARGETS_TO_BUILD="X86" -DLLVM_ENABLE_PROJECTS="lld;clang;clang-tools-extra" -DLLVM_ENABLE_DIA_SDK=OFF llvm-project\llvm
cmake --build build --target install
Remove-Item -Recurse -Force build
- name: Build llvm stage 2
run: |
$vsPath = (vswhere -latest -property installationPath)
Import-Module (Join-Path $vsPath "Common7\Tools\Microsoft.VisualStudio.DevShell.dll")
Enter-VsDevShell -VsInstallPath $vsPath -SkipAutomaticLocation -DevCmdArguments "-arch=x64 -host_arch=x64 -winsdk=10.0.22621.0"
$Env:CC = "$pwd\\LLVM-17.0.6-win64\\bin\\clang-cl.exe"
$Env:CXX = "$pwd\\LLVM-17.0.6-win64\\bin\\clang-cl.exe"
$cmake_sys_ver = "10.0.22621.0"
cmake -Bbuild -GNinja "-DCMAKE_SYSTEM_VERSION=$cmake_sys_ver" -DCMAKE_MSVC_RUNTIME_LIBRARY=${{ matrix.rtlib }} -DCMAKE_BUILD_TYPE=Release -DCPACK_GENERATOR=ZIP "-DCMAKE_INSTALL_PREFIX=$pwd\\prefix" -DLLVM_TARGETS_TO_BUILD="X86" -DLLVM_ENABLE_PROJECTS="lld;clang;clang-tools-extra" -DLLVM_ENABLE_DIA_SDK=OFF llvm-project\\llvm
cmake --build build --target package
Enter-VsDevShell -VsInstallPath $vsPath -SkipAutomaticLocation -DevCmdArguments "-arch=x64 -host_arch=x64 -winsdk=10.0.26100.0"
$prefix = "$pwd\prefix"
$Env:CC = "$prefix\bin\clang-cl.exe"
$Env:CXX = "$prefix\bin\clang-cl.exe"
$cmake_mt = "mt"
$cmake_sys_ver = "10.0.26100.0"
cmake -Bbuild -GNinja -DCMAKE_SYSTEM_VERSION=$cmake_sys_ver -DCMAKE_MSVC_RUNTIME_LIBRARY=${{ matrix.rtlib }} -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX:PATH=$prefix -DCMAKE_MT:PATH=$cmake_mt -DLLVM_TARGETS_TO_BUILD="X86" -DLLVM_ENABLE_PROJECTS="lld;clang;clang-tools-extra" -DLLVM_ENABLE_DIA_SDK=OFF llvm-project\llvm
cmake --build build --target install
- name: Repack zip package
run: |
$name = (Get-Item build/LLVM-*.zip).Name
$basename = (Get-Item build/LLVM-*.zip).BaseName
Remove-Item -Recurse -Force "$basename"
Expand-Archive -Path "build/$name" -DestinationPath "$pwd"
Remove-Item "build/$name"
7z a -mx=9 -tzip -mtm=off -mtc=off -mta=off "build/$name" "$basename"
Rename-Item prefix LLVM-19.1.6-win64
7z a -mx=9 -tzip -mtm=off -mtc=off -mta=off LLVM-19.1.6-win64-${{ matrix.rtlib }}.zip LLVM-19.1.6-win6
- name: Upload LLVM zip package
- name: Create release and Upload LLVM zip package
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release upload LLVM-17.0.6-win64-${{ matrix.rtlib }}.zip build/*.zip --clobber
gh release create --draft --prerelease --notes-from-tag ${{ github.event.release.tag_name }} LLVM-*.zip

0 comments on commit 941a651

Please sign in to comment.