Skip to content

Commit 6a67104

Browse files
awakecodingMarc-André Moreau
andauthored
Fix lld-targets + build Ubuntu 18.04/20.04 (#8)
* update lld-targets * try adding distros * fix yaml * update patch * update yaml * update * update yaml * update YAML * update yaml again * split 18.04/20.04 * try fixing ubuntu conditional * try updating cctools * update cctools * update cctools * add initial msvc-bundle workflow * update stuff * fix wget * add linux distro-specific initial cache files * add xcode-bundle Co-authored-by: Marc-André Moreau <mamoreau@devolutions.net>
1 parent 61830ce commit 6a67104

11 files changed

+202
-52
lines changed

.github/workflows/cctools-prebuilt.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,20 @@ jobs:
88
fail-fast: false
99
matrix:
1010
arch: [ x86_64 ]
11-
os: [ linux ]
11+
os: [ ubuntu-18.04, ubuntu-20.04 ]
1212

1313
include:
14-
- os: linux
14+
- os: ubuntu-18.04
1515
runner: ubuntu-18.04
16+
- os: ubuntu-20.04
17+
runner: ubuntu-20.04
18+
1619
steps:
1720
- name: Configure Linux runner
18-
if: runner.os == 'Linux'
1921
run: |
2022
sudo apt update
21-
sudo apt install git xz-utils
23+
sudo apt install git xz-utils ninja-build
2224
sudo apt install libssl-dev libxml2-dev liblzma-dev libbz2-dev
23-
sudo apt install ninja-build ${{matrix.multilib}}
2425
2526
- name: Build libxar
2627
run: |

.github/workflows/llvm-prebuilt.yml

Lines changed: 27 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@ name: LLVM prebuilt
22
on: workflow_dispatch
33
jobs:
44
build:
5-
name: LLVM ${{matrix.version}} [${{matrix.arch}}-${{matrix.os}}]
5+
name: LLVM ${{matrix.version}} [${{matrix.arch}}-${{matrix.os}}] ${{matrix.distro}}
66
runs-on: ${{matrix.runner}}
77
strategy:
88
fail-fast: false
99
matrix:
1010
arch: [ x86_64, aarch64 ]
11-
os: [ windows, macos, linux ]
11+
os: [ windows, macos, ubuntu-18.04, ubuntu-20.04 ]
1212
version: [ 12.0.1 ]
1313

1414
include:
@@ -19,8 +19,10 @@ jobs:
1919
runner: windows-2019
2020
- os: macos
2121
runner: macos-10.15
22-
- os: linux
22+
- os: ubuntu-18.04
2323
runner: ubuntu-18.04
24+
- os: ubuntu-20.04
25+
runner: ubuntu-20.04
2426

2527
- arch: x86_64
2628
os: windows
@@ -35,9 +37,6 @@ jobs:
3537
- arch: aarch64
3638
os: macos
3739
osx_arch: arm64
38-
39-
- arch: aarch64
40-
os: linux
4140
steps:
4241
- name: Configure Windows runner
4342
if: runner.os == 'Windows'
@@ -50,16 +49,33 @@ jobs:
5049
brew install ninja
5150
echo "MACOSX_DEPLOYMENT_TARGET=10.12" >> $GITHUB_ENV
5251
53-
- name: Configure Ubuntu runner
54-
if: runner.os == 'Linux'
52+
- name: Configure Ubuntu 18.04 runner
53+
if: matrix.os == 'ubuntu-18.04'
54+
shell: pwsh
55+
run: |
56+
sudo apt update
57+
sudo apt install xz-utils libxml2-dev
58+
sudo apt install ninja-build
59+
sudo apt install g++-aarch64-linux-gnu
60+
mkdir libxml2-dev-arm64 && cd libxml2-dev-arm64
61+
$LibXmlDebFile = "libxml2-dev_2.9.4+dfsg1-6.1ubuntu1.4_arm64.deb"
62+
wget -q "http://ports.ubuntu.com/pool/main/libx/libxml2/$LibXmlDebFile"
63+
ar -x "$LibXmlDebFile"
64+
tar -xf data.tar.xz
65+
sudo cp -R ./usr/lib/aarch64-linux-gnu/ /usr/lib/aarch64-linux-gnu
66+
67+
- name: Configure Ubuntu 20.04 runner
68+
if: matrix.os == 'ubuntu-20.04'
69+
shell: pwsh
5570
run: |
5671
sudo apt update
5772
sudo apt install xz-utils libxml2-dev
5873
sudo apt install ninja-build
5974
sudo apt install g++-aarch64-linux-gnu
6075
mkdir libxml2-dev-arm64 && cd libxml2-dev-arm64
61-
wget http://ports.ubuntu.com/pool/main/libx/libxml2/libxml2-dev_2.9.4+dfsg1-6.1ubuntu1.4_arm64.deb
62-
ar -x libxml2-dev_2.9.4+dfsg1-6.1ubuntu1.4_arm64.deb
76+
$LibXmlDebFile = "libxml2-dev_2.9.10+dfsg-5ubuntu0.20.04.1_arm64.deb"
77+
wget -q "http://ports.ubuntu.com/pool/main/libx/libxml2/$LibXmlDebFile"
78+
ar -x "$LibXmlDebFile"
6379
tar -xf data.tar.xz
6480
sudo cp -R ./usr/lib/aarch64-linux-gnu/ /usr/lib/aarch64-linux-gnu
6581
@@ -77,7 +93,7 @@ jobs:
7793

7894
- name: Patch LLVM
7995
run: |
80-
git -C llvm-project apply ../llvm-prebuilt/patches/0001-add-lld-headers-target.patch
96+
git -C llvm-project apply ../llvm-prebuilt/patches/0001-add-lld-install-targets.patch
8197
8298
- name: Enable Windows host environment
8399
if: runner.os == 'Windows'

.github/workflows/msvc-bundle.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: msvc bundle
2+
on: workflow_dispatch
3+
jobs:
4+
build:
5+
name: MSVC bundle
6+
runs-on: windows-2019
7+
steps:
8+
- name: Configure Windows runner
9+
run: |
10+
choco install 7zip
11+
12+
- name: Enable Windows target environment
13+
uses: ilammy/msvc-dev-cmd@v1
14+
with:
15+
arch: amd64
16+
17+
- name: Copy MSVC bundle
18+
shell: pwsh
19+
run: |
20+
$BundlePath = $Env:GITHUB_WORKSPACE
21+
Copy-Item -Recurse -Path $Env:VCToolsInstallDir\include -Destination $BundlePath\vctools\include
22+
Copy-Item -Recurse -Path $Env:VCToolsInstallDir\lib -Destination $BundlePath\vctools\lib
23+
Copy-Item -Recurse -Path $Env:WindowsSdkDir\Include\$Env:WindowsSDKVersion\ $BundlePath\winsdk\Include\$Env:WindowsSDKVersion
24+
Copy-Item -Recurse -Path $Env:WindowsSdkDir\Lib\$Env:WindowsSDKVersion\ $BundlePath\winsdk\Lib\$Env:WindowsSDKVersion
25+
26+
- name: Package MSVC bundle
27+
shell: pwsh
28+
run: |
29+
cmd.exe /c "7z a -ttar -snl -so vctools.tar vctools | 7z a -si vctools.tar.xz"
30+
cmd.exe /c "7z a -ttar -snl -so winsdk.tar winsdk | 7z a -si winsdk.tar.xz"
31+
32+
- name: Upload vctools package
33+
uses: actions/upload-artifact@v2
34+
with:
35+
name: vctools
36+
path: vctools.tar.xz
37+
38+
- name: Upload winsdk package
39+
uses: actions/upload-artifact@v2
40+
with:
41+
name: winsdk
42+
path: winsdk.tar.xz

.github/workflows/xcode-bundle.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: xcode bundle
2+
on: workflow_dispatch
3+
jobs:
4+
build:
5+
name: Xcode bundle
6+
runs-on: macos-10.15
7+
steps:
8+
- name: Configure macOS runner
9+
run: |
10+
brew install --cask powershell
11+
12+
- name: Copy Xcode bundle
13+
shell: pwsh
14+
run: |
15+
$XcodeDeveloperPath = $(xcode-select -p)
16+
$XcodePlatformsPath = Join-Path $XcodeDeveloperPath "Platforms"
17+
18+
$BundlePath = Join-Path $Env:GITHUB_WORKSPACE "xcode-bundle"
19+
New-Item -Path $BundlePath -ItemType Directory | Out-Null
20+
21+
foreach ($Platform in @('MacOSX','iPhoneOS','iPhoneSimulator')) {
22+
Write-Host "Copying $Platform SDK"
23+
$PlatformPath = Join-Path $XcodePlatformsPath "$Platform.platform"
24+
$PlatformSdkPath = Join-Path $PlatformPath "Developer" "SDKs" "$Platform.sdk"
25+
Copy-Item -Recurse -Path $PlatformSdkPath -Destination $BundlePath
26+
}
27+
28+
Write-Host "Copying Xcode xctoolchain"
29+
$XcodeToolchainsPath = Join-Path $XcodeDeveloperPath "Toolchains"
30+
$XcodeToolchainPath = Join-Path $XcodeToolchainsPath "XcodeDefault.xctoolchain"
31+
$DestinationPath = Join-Path $BundlePath "XcodeDefault.xctoolchain"
32+
New-Item -Path $DestinationPath -ItemType Directory | Out-Null
33+
Copy-Item -Recurse -Path "$XcodeToolchainPath\usr\include" -Destination "$DestinationPath\usr\include"
34+
Copy-Item -Recurse -Path "$XcodeToolchainPath\usr\lib" -Destination "$DestinationPath\usr\lib"
35+
36+
- name: Package Xcode bundle
37+
shell: pwsh
38+
run: |
39+
tar -cJf xcode-bundle.tar.xz xcode-bundle
40+
41+
- name: Upload xcode-bundle package
42+
uses: actions/upload-artifact@v2
43+
with:
44+
name: xcode-bundle
45+
path: xcode-bundle.tar.xz

cmake/aarch64-ubuntu-18.04.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
include("${CMAKE_CURRENT_LIST_DIR}/aarch64-linux.cmake")

cmake/aarch64-ubuntu-20.04.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
include("${CMAKE_CURRENT_LIST_DIR}/aarch64-linux.cmake")

cmake/llvm-distribution.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ set(LLVM_DEVELOPMENT_COMPONENTS
126126
clang-resource-headers
127127
libclang-headers
128128
lld-headers # requires patch
129+
lld-libraries # requires patch
129130
lld-cmake-exports
130131
CACHE STRING "")
131132

cmake/x86_64-ubuntu-18.04.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
include("${CMAKE_CURRENT_LIST_DIR}/x86_64-linux.cmake")

cmake/x86_64-ubuntu-20.04.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
include("${CMAKE_CURRENT_LIST_DIR}/x86_64-linux.cmake")

patches/0001-add-lld-headers-target.patch

Lines changed: 0 additions & 36 deletions
This file was deleted.

0 commit comments

Comments
 (0)