Skip to content

Commit

Permalink
Add SDC (Steven's fork) as submodule and build its libdmdalloc.a
Browse files Browse the repository at this point in the history
  • Loading branch information
kinke committed Nov 14, 2024
1 parent c21fc7a commit a2f1e1d
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 0 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,7 @@
[submodule "ninja"]
path = ninja
url = [email protected]:symmetryinvestments/ninja.git
[submodule "sdc"]
path = sdc
url = https://github.com/schveiguy/sdc.git
branch = dmdbuild
1 change: 1 addition & 0 deletions sdc
Submodule sdc added at b5c153

0 comments on commit a2f1e1d

Please sign in to comment.