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
* Add libxml2

Signed-off-by: Shen-Ta Hsieh <[email protected]>
  • Loading branch information
ibmibmibm committed Dec 22, 2024
1 parent 0f8709e commit 56914c5
Show file tree
Hide file tree
Showing 2 changed files with 76 additions and 48 deletions.
59 changes: 36 additions & 23 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,56 +25,69 @@ 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 libxml2
run: git clone --quiet --branch v2.13.5 --depth 1 https://gitlab.gnome.org/GNOME/libxml2.git

- name: Build libxml2
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.26100.0"
$Env:CC = "clang-cl"
$Env:CXX = "clang-cl"
$cmake_sys_ver = "10.0.26100.0"
$prefix = "$pwd\prefix"
cmake -Bbuild -GNinja "-DCMAKE_SYSTEM_VERSION=$cmake_sys_ver" -DCMAKE_MSVC_RUNTIME_LIBRARY=${{ matrix.rtlib }} -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX:PATH=$prefix -DLIBXML2_WITH_ICONV=OFF libxml2
cmake --build build --target install
Remove-Item -Recurse build
- 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"
$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_sys_ver = "10.0.26100.0"
$prefix = "$pwd\prefix"
cmake -Bbuild -GNinja -DCMAKE_SYSTEM_VERSION=$cmake_sys_ver -DCMAKE_MSVC_RUNTIME_LIBRARY=${{ matrix.rtlib }} -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX:PATH=$prefix -DLLVM_TARGETS_TO_BUILD="X86" -DLLVM_ENABLE_PROJECTS="lld;clang;clang-tools-extra" -DLLVM_ENABLE_DIA_SDK=OFF -DLLVM_ENABLE_LIBXML2=FORCE_ON -DLIBXML2_INCLUDE_DIR:PATH="$prefix\include\libxml2" -DLIBXML2_LIBRARY:FILEPATH="$prefix\lib\libxml2.lib" 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_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 -DLLVM_TARGETS_TO_BUILD="X86" -DLLVM_ENABLE_PROJECTS="lld;clang;clang-tools-extra" -DLLVM_ENABLE_DIA_SDK=OFF -DLLVM_ENABLE_LIBXML2=FORCE_ON -DLIBXML2_INCLUDE_DIR:PATH="$prefix\include\libxml2" -DLIBXML2_LIBRARY:FILEPATH="$prefix\lib\libxml2.lib" 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
65 changes: 40 additions & 25 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: llvmorg-17.0.6
release_name: llvmorg-17.0.6
tag_name: llvmorg-19.1.6
release_name: llvmorg-19.1.6
draft: true
prerelease: true

Expand All @@ -38,55 +38,70 @@ 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
- name: Checkout libxml2
run: git clone --quiet --branch v2.13.5 --depth 1 https://gitlab.gnome.org/GNOME/libxml2.git

- name: Build libxml2
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.26100.0"
$Env:CC = "clang-cl"
$Env:CXX = "clang-cl"
$cmake_sys_ver = "10.0.26100.0"
$prefix = "$pwd\prefix"
cmake -Bbuild -GNinja "-DCMAKE_SYSTEM_VERSION=$cmake_sys_ver" -DCMAKE_MSVC_RUNTIME_LIBRARY=${{ matrix.rtlib }} -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX:PATH=$prefix -DLIBXML2_WITH_ICONV=OFF libxml2
cmake --build build --target install
Remove-Item -Recurse build
- 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"
$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_sys_ver = "10.0.26100.0"
$prefix = "$pwd\prefix"
cmake -Bbuild -GNinja -DCMAKE_SYSTEM_VERSION=$cmake_sys_ver -DCMAKE_MSVC_RUNTIME_LIBRARY=${{ matrix.rtlib }} -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX:PATH=$prefix -DLLVM_TARGETS_TO_BUILD="X86" -DLLVM_ENABLE_PROJECTS="lld;clang;clang-tools-extra" -DLLVM_ENABLE_DIA_SDK=OFF -DLLVM_ENABLE_LIBXML2=FORCE_ON -DLIBXML2_INCLUDE_DIR:PATH="$prefix\include\libxml2" -DLIBXML2_LIBRARY:FILEPATH="$prefix\lib\libxml2.lib" 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_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 -DLLVM_TARGETS_TO_BUILD="X86" -DLLVM_ENABLE_PROJECTS="lld;clang;clang-tools-extra" -DLLVM_ENABLE_DIA_SDK=OFF -DLLVM_ENABLE_LIBXML2=FORCE_ON -DLIBXML2_INCLUDE_DIR:PATH="$prefix\include\libxml2" -DLIBXML2_LIBRARY:FILEPATH="$prefix\lib\libxml2.lib" 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 LLVM zip package
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release upload LLVM-17.0.6-win64-${{ matrix.rtlib }}.zip build/*.zip --clobber
$name = (Get-Item LLVM-*.zip).Name
$basename = (Get-Item LLVM-*.zip).BaseName
gh release upload $basename-${{ matrix.rtlib }}.zip $name --clobber

0 comments on commit 56914c5

Please sign in to comment.