From a2f1e1d5e2af51e027c9ea5e9931300ff755755f Mon Sep 17 00:00:00 2001 From: Martin Kinkelin Date: Thu, 14 Nov 2024 17:55:27 +0100 Subject: [PATCH] Add SDC (Steven's fork) as submodule and build its libdmdalloc.a --- .github/workflows/main.yml | 24 ++++++++++++++++++++++++ .gitmodules | 4 ++++ sdc | 1 + 3 files changed, 29 insertions(+) create mode 160000 sdc diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7599941..54ace49 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -36,6 +36,30 @@ jobs: fi source ~/dlang/$HOST_DC/activate + # download & unpack prebuilt LLVM 19 for SDC + curl -fL -o llvm.tar.xz https://github.com/ldc-developers/llvm-project/releases/download/ldc-v19.1.3/llvm-19.1.3-linux-x86_64.tar.xz + mkdir llvm + tar -xf llvm.tar.xz --strip 1 -C llvm + rm llvm.tar.xz + + # download & unpack prebuilt clang v15 to use as linker driver for SDC + # (matching the clang version used to compile the prebuilt LLVM) + curl -fL -o clang.tar.xz https://github.com/llvm/llvm-project/releases/download/llvmorg-15.0.6/clang+llvm-15.0.6-x86_64-linux-gnu-ubuntu-18.04.tar.xz + mkdir clang + tar -xf clang.tar.xz --strip 1 -C clang + rm clang.tar.xz + # make SDC's Makefile detect and use the ld.lld linker + sudo ln -sf "$PWD/clang/bin/ld.lld" /usr/bin/ld.lld + + # install distro packages for SDC + export DEBIAN_FRONTEND=noninteractive + sudo apt-get -qq update + sudo apt-get install -qq nasm libzstd-dev + + # build SDC's libdmdalloc.a + LLVM_CONFIG=$PWD/llvm/bin/llvm-config CC=$PWD/clang/bin/clang SDFLAGS=-O3 make -C sdc + ls -l sdc/lib/libdmdalloc.a + # patch DMD version if this CI job was triggered by a tag tag="" if [[ '${{ github.ref }}' = refs/tags/v* ]]; then diff --git a/.gitmodules b/.gitmodules index 883c112..7e63559 100644 --- a/.gitmodules +++ b/.gitmodules @@ -13,3 +13,7 @@ [submodule "ninja"] path = ninja url = git@github.com:symmetryinvestments/ninja.git +[submodule "sdc"] + path = sdc + url = https://github.com/schveiguy/sdc.git + branch = dmdbuild diff --git a/sdc b/sdc new file mode 160000 index 0000000..b5c1539 --- /dev/null +++ b/sdc @@ -0,0 +1 @@ +Subproject commit b5c1539829d446dd12fad5bfd3823a28c5eca6dc