Skip to content

Commit

Permalink
GHA Alpine: Link remaining lib{zstd,z,c} statically too
Browse files Browse the repository at this point in the history
  • Loading branch information
kinke committed Jan 19, 2025
1 parent 4f51525 commit 83539fc
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 9 deletions.
4 changes: 0 additions & 4 deletions .github/actions/3-build-native/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,3 @@ runs:

- run: ../build/bin/ldc2 --version
shell: bash

- run: ldd ../build/bin/ldc2
if: runner.os == 'Linux'
shell: bash
18 changes: 18 additions & 0 deletions .github/actions/7-package/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@ runs:
fi
echo "DMD=$DMD" >> $GITHUB_ENV
- name: 'Alpine: Set DFLAGS environment variable (-Xcc=-static)' # for fully statically linked dub etc.
if: inputs.os == 'alpine'
shell: bash
run: |
set -eux
echo "DFLAGS=-Xcc=-static${DFLAGS:+ $DFLAGS}" >> $GITHUB_ENV
- name: Build & copy dub
shell: bash
run: |
Expand Down Expand Up @@ -85,6 +92,17 @@ runs:
../installed/bin/reggae --version -b ninja
fi
- name: 'Linux: List executable dependencies'
if: runner.os == 'Linux'
shell: bash
run: |
set -euxo pipefail
cd ../installed/bin
for i in *; do
ls -lh $i
readelf -d $i | grep NEEDED || true
done
- name: Pack installation dir
shell: bash
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ jobs:
-DCOMPILER_RT_LIBDIR_OS=linux
-DLDC_INSTALL_LLVM_RUNTIME_LIBS_ARCH=x86_64
-DTEST_COMPILER_RT_LIBRARIES="profile;lsan;asan;msan;fuzzer"
-DCMAKE_EXE_LINKER_FLAGS=-static-libstdc++
-DCMAKE_EXE_LINKER_FLAGS=-static
-DJITRT_EXTRA_LDFLAGS=-static-libstdc++
-DD_COMPILER_FLAGS="-O -flto=full"
-DD_COMPILER_FLAGS="-O -flto=full -Xcc=-static"
# FIXME: -defaultlib=phobos2-ldc-lto,druntime-ldc-lto
with_pgo: false

Expand Down
3 changes: 0 additions & 3 deletions runtime/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,6 @@ if("${C_SYSTEM_LIBS}" STREQUAL "AUTO")
set(C_SYSTEM_LIBS m c)
elseif("${TARGET_SYSTEM}" MATCHES "Linux")
set(C_SYSTEM_LIBS m pthread rt dl)
if("${TARGET_SYSTEM}" MATCHES "musl")
list(APPEND C_SYSTEM_LIBS "unwind")
endif()
elseif("${TARGET_SYSTEM}" MATCHES "FreeBSD")
set(C_SYSTEM_LIBS m pthread execinfo z)
else()
Expand Down

0 comments on commit 83539fc

Please sign in to comment.