2828 GCC_GIT_REF : " releases/gcc-14.1.0"
2929 LIBUNWIND_GIT_REF : " v1.8.1"
3030 LLVM_MAJOR_VERSION : " 20"
31+ LLVM_MINOR_VERSION : " 1"
3132 ZULU_JRE_URL : https://cdn.azul.com/zulu/bin/zulu21.36.17-ca-jre21.0.4-win_x64.zip
3233
3334jobs :
@@ -138,6 +139,8 @@ jobs:
138139 - name : mvn clean verify
139140 if : steps.cache-emerge-toolchain-maven.outputs.cache-hit != 'true'
140141 run : mvn "-Demerge.llvm-tests.llvm-install-dir=/usr/lib/llvm-20" -B clean verify
142+ llvm-build-for-linux :
143+ uses : ./.github/workflows/build-llvm-linux.yaml
141144 linux-distributables :
142145 name : Linux distributable archives
143146 runs-on : ubuntu-22.04
@@ -148,11 +151,18 @@ jobs:
148151 - build-glibc-x86_64
149152 - build-libunwind-x86_64
150153 - emerge-toolchain-maven
154+ - llvm-build-for-linux
151155 steps :
152156 - name : checkout
153157 uses : actions/checkout@v4
154158 with :
155159 ref : " ${{ inputs.ref || github.sha }}"
160+ - name : get LLVM binaries
161+ uses : actions/download-artifact@v4.1.8
162+ with :
163+ run-id : " ${{ needs.llvm-build-for-linux.run-id }}"
164+ name : llvm-linux-gnu-x86_64
165+ path : ${{ github.workspace }}/llvm-install
156166 - name : get C-runtime binaries from glibc
157167 uses : actions/cache/restore@v4.2.2
158168 with :
@@ -193,6 +203,7 @@ jobs:
193203 mkdir bin && pushd $_
194204 cp "${{ github.workspace }}/toolchain/target/toolchain.jar" .
195205 popd
206+
196207 cp -r "${{ github.workspace }}/stdlib" .
197208 cp -ar "${{ github.workspace }}/dist/linux/all/." .
198209
@@ -217,7 +228,22 @@ jobs:
217228 cp "${{ github.workspace }}/glibc-build/csu/Scrt1.o" .
218229 cp "${{ github.workspace }}/glibc-build/libc.so" .
219230 popd
231+ popd
232+
233+ mkdir -p llvm/bin && pushd $_
234+ cp "${{ github.workspace }}/llvm-install/bin/lld" .
220235 popd
236+ mkdir llvm/lib && pushd $_
237+ cp "${{ github.workspace }}/llvm-install/lib/libLLVM.so.$LLVM_MAJOR_VERSION.$LLVM_MINOR_VERSION" .
238+ ln -s "libLLVM.so.$LLVM_MAJOR_VERSION.$LLVM_MINOR_VERSION" "libLLVM-$LLVM_MAJOR_VERSION.so"
239+ ln -s "libLLVM.so.$LLVM_MAJOR_VERSION.$LLVM_MINOR_VERSION" "libLLVM.so"
240+ cp "${{ github.workspace }}/llvm-install/lib/libLTO.so.$LLVM_MAJOR_VERSION.$LLVM_MINOR_VERSION" .
241+ ln -s "libLTO.so.$LLVM_MAJOR_VERSION.$LLVM_MINOR_VERSION" "libLTO-$LLVM_MAJOR_VERSION.so"
242+ ln -s "libLTO.so.$LLVM_MAJOR_VERSION.$LLVM_MINOR_VERSION" "libLTO.so"
243+ cp "${{ github.workspace }}/llvm-install/lib/libRemarks.so.$LLVM_MAJOR_VERSION.$LLVM_MINOR_VERSION" .
244+ ln -s "libRemarks.so.$LLVM_MAJOR_VERSION.$LLVM_MINOR_VERSION" "libRemarks.so"
245+ popd
246+ cp -r "${{ github.workspace }}/llvm-install/share" llvm/share
221247 popd
222248 tar --create \
223249 --directory=tarball-root \
@@ -269,15 +295,19 @@ jobs:
269295 run-id : " ${{ needs.llvm-build-for-windows.run-id }}"
270296 name : llvm-windows-x86_64
271297 path : ${{ github.workspace }}/llvm-install
272- - name : prepare zip
298+ - name : build distributable archive
299+ id : pack-zip
273300 shell : pwsh
274301 run : |
275302 New-Item -Type Directory -Name "archive-root"
276303
277304 # first extract the linux tarball. It doesn't come with much linux-specific stuff, so we can reuse all the
278305 # code for building it
279- tar --directory archive-root -xf "${{ needs.linux-distributables.outputs.tarball-filename }}"
306+ tar --no-same-owner --no-same-permissions --directory archive-root -xf "${{ needs.linux-distributables.outputs.tarball-filename }}"
307+ chown -R archive-root
308+ chmod -R u+w archive-root
280309 Remove-Item "archive-root/configure.sh" # this one is linux specific
310+ Remove-Item "archive-root/llvm" -Recurse # this one is linux specific
281311
282312 New-Item -Type Directory -Path "archive-root/llvm" -Name "bin"
283313 # the LLVM distribution for windows builds THE WHOLE thing. This is needed for development.
@@ -286,15 +316,10 @@ jobs:
286316 Move-Item -Path "llvm-install/bin/ld.lld.exe" "archive-root/llvm/bin/ld.lld.exe"
287317 Move-Item -Path "llvm-install/bin/llc.exe" "archive-root/llvm/bin/llc.exe"
288318 Move-Item -Path "llvm-install/bin/LLVM-C.dll" "archive-root/llvm/bin/LLVM-C.dll"
289- # fix the reference to the LLVM installation directiory
290- (Get-Content archive-root/toolchain-config.yml) -replace '(?<=\s*llvm-installation-directory: ).+','llvm' | Set-Content archive-root/toolchain-config.yml
291319
292320 # redistribute JRE
293321 Move-Item -Path "zulu-jre/jre" "archive-root/jre"
294- - name : pack zip
295- id : pack-zip
296- shell : pwsh
297- run : |
322+
298323 Get-ChildItem -Path "archive-root" | Compress-Archive -DestinationPath "emerge-toolchain.zip"
299324 $hash = (Get-FileHash -Algorithm SHA256 "emerge-toolchain.zip").Hash
300325 Add-Content -Path "$Env:GITHUB_OUTPUT" -Value "sha256=$hash"
0 commit comments