Skip to content

Commit

Permalink
[switch to Ubuntu 20 container - mainly for working gdb version]
Browse files Browse the repository at this point in the history
  • Loading branch information
kinke committed Jan 17, 2025
1 parent 3f5e71e commit 5e98fe7
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 7 deletions.
13 changes: 11 additions & 2 deletions .github/actions/1-setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ runs:
shell: bash
run: |
set -eux
cd ..
export DEBIAN_FRONTEND=noninteractive
arch='${{ inputs.arch }}'
if [[ $arch == x86_64 ]]; then
Expand All @@ -23,15 +24,23 @@ runs:
sudo apt-get -q update
packages=( \
git-core cmake g++ \
libcurl4 libzstd-dev \
libcurl4 libxml2-dev libzstd-dev \
curl gdb p7zip-full tzdata unzip zip python3-pip \
)
if [[ $arch == x86_64 ]]; then
packages+=(g++-multilib libcurl4:i386)
fi
sudo apt-get -yq install ${packages[@]}
sudo -E apt-get -yq install ${packages[@]}
# Make sure to link libzstd statically
sudo rm /usr/lib/$arch-linux-gnu/libzstd.so
# Install a more recent CMake version in the AArch64 container (for mimalloc...)
if [[ $arch == aarch64 ]]; then
curl -fL --retry 3 --max-time 300 -o cmake.tar.gz https://github.com/Kitware/CMake/releases/download/v3.31.4/cmake-3.31.4-linux-$arch.tar.gz
mkdir cmake
tar -xf cmake.tar.gz --strip 1 -C cmake
rm cmake.tar.gz
sudo ln -sf $PWD/cmake/bin/cmake /usr/bin/cmake
fi
- name: 'Linux: Download & extract clang' # into ../clang
if: runner.os == 'Linux'
Expand Down
20 changes: 16 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,18 @@ jobs:
with_pgo: true

- job_name: Linux aarch64
os: ubuntu-22.04-arm
os: ubuntu-22.04-arm # Ubuntu 20 not natively supported
container_image: ubuntu:20.04
arch: aarch64
clang_version: 15.0.3 # 15.0.6 requires a more recent libstdc++.so.6 than shipped with Ubuntu 20
bootstrap_cmake_flags: >-
-DBUILD_LTO_LIBS=ON
-DCOMPILER_RT_LIBDIR_OS=aarch64-unknown-linux-gnu
extra_cmake_flags: >-
-DBUILD_LTO_LIBS=ON
-DCOMPILER_RT_LIBDIR_OS=aarch64-unknown-linux-gnu
-DCMAKE_C_COMPILER=/home/runner/work/ldc/clang/bin/clang
-DCMAKE_CXX_COMPILER=/home/runner/work/ldc/clang/bin/clang++
-DCMAKE_C_COMPILER=/__w/ldc/clang/bin/clang
-DCMAKE_CXX_COMPILER=/__w/ldc/clang/bin/clang++
-DCMAKE_EXE_LINKER_FLAGS=-static-libstdc++
-DJITRT_EXTRA_LDFLAGS=-static-libstdc++
-DD_COMPILER_FLAGS="-O -flto=full -defaultlib=phobos2-ldc-lto,druntime-ldc-lto"
Expand Down Expand Up @@ -81,6 +83,7 @@ jobs:
- job_name: Windows x64
os: windows-2022
arch: x64
clang_version: 19.1.3
bootstrap_cmake_flags: -DBUILD_LTO_LIBS=ON
extra_cmake_flags: >-
-DBUILD_LTO_LIBS=ON
Expand All @@ -91,6 +94,7 @@ jobs:
- job_name: Windows x86
os: windows-2022
arch: x86
clang_version: 19.1.3
bootstrap_cmake_flags: -DBUILD_LTO_LIBS=ON
# `RT_CFLAGS=-m32` needed to make 64-bit clang-cl output 32-bit code for druntime integration tests
extra_cmake_flags: >-
Expand All @@ -103,18 +107,26 @@ jobs:

name: ${{ matrix.job_name }}
runs-on: ${{ matrix.os }}
container: ${{ matrix.container_image }}
timeout-minutes: 90
env:
MACOSX_DEPLOYMENT_TARGET: ${{ matrix.arch == 'arm64' && '11.0' || '10.12' }}
steps:
- name: 'Container: Install git and sudo'
if: matrix.container_image
shell: bash
run: |
set -eux
apt-get -q update
DEBIAN_FRONTEND=noninteractive apt-get -yq install git-core sudo
- uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 50
- name: Install prerequisites
uses: ./.github/actions/1-setup
with:
clang_version: ${{ runner.os == 'Windows' && '19.1.3' || env.CLANG_VERSION }}
clang_version: ${{ matrix.clang_version || env.CLANG_VERSION }}
llvm_version: ${{ matrix.llvm_version || env.LLVM_VERSION }}
arch: ${{ matrix.arch }}
- name: Build bootstrap LDC
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ if(LDC_DYNAMIC_COMPILE)
add_definitions(-DLDC_DYNAMIC_COMPILE_API_VERSION=4)
endif()
if (LDC_DYNAMIC_COMPILE_USE_LLVM_JITLINK)
add_compile_definitions(-DLDC_JITRT_USE_JITLINK)
add_compile_definitions(LDC_JITRT_USE_JITLINK)
endif()

#
Expand Down

0 comments on commit 5e98fe7

Please sign in to comment.