Skip to content

Commit 83539fc

Browse files
committed
GHA Alpine: Link remaining lib{zstd,z,c} statically too
1 parent 4f51525 commit 83539fc

File tree

4 files changed

+20
-9
lines changed

4 files changed

+20
-9
lines changed

.github/actions/3-build-native/action.yml

-4
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,3 @@ runs:
3131

3232
- run: ../build/bin/ldc2 --version
3333
shell: bash
34-
35-
- run: ldd ../build/bin/ldc2
36-
if: runner.os == 'Linux'
37-
shell: bash

.github/actions/7-package/action.yml

+18
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,13 @@ runs:
2424
fi
2525
echo "DMD=$DMD" >> $GITHUB_ENV
2626
27+
- name: 'Alpine: Set DFLAGS environment variable (-Xcc=-static)' # for fully statically linked dub etc.
28+
if: inputs.os == 'alpine'
29+
shell: bash
30+
run: |
31+
set -eux
32+
echo "DFLAGS=-Xcc=-static${DFLAGS:+ $DFLAGS}" >> $GITHUB_ENV
33+
2734
- name: Build & copy dub
2835
shell: bash
2936
run: |
@@ -85,6 +92,17 @@ runs:
8592
../installed/bin/reggae --version -b ninja
8693
fi
8794
95+
- name: 'Linux: List executable dependencies'
96+
if: runner.os == 'Linux'
97+
shell: bash
98+
run: |
99+
set -euxo pipefail
100+
cd ../installed/bin
101+
for i in *; do
102+
ls -lh $i
103+
readelf -d $i | grep NEEDED || true
104+
done
105+
88106
- name: Pack installation dir
89107
shell: bash
90108
run: |

.github/workflows/main.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,9 @@ jobs:
6767
-DCOMPILER_RT_LIBDIR_OS=linux
6868
-DLDC_INSTALL_LLVM_RUNTIME_LIBS_ARCH=x86_64
6969
-DTEST_COMPILER_RT_LIBRARIES="profile;lsan;asan;msan;fuzzer"
70-
-DCMAKE_EXE_LINKER_FLAGS=-static-libstdc++
70+
-DCMAKE_EXE_LINKER_FLAGS=-static
7171
-DJITRT_EXTRA_LDFLAGS=-static-libstdc++
72-
-DD_COMPILER_FLAGS="-O -flto=full"
72+
-DD_COMPILER_FLAGS="-O -flto=full -Xcc=-static"
7373
# FIXME: -defaultlib=phobos2-ldc-lto,druntime-ldc-lto
7474
with_pgo: false
7575

runtime/CMakeLists.txt

-3
Original file line numberDiff line numberDiff line change
@@ -136,9 +136,6 @@ if("${C_SYSTEM_LIBS}" STREQUAL "AUTO")
136136
set(C_SYSTEM_LIBS m c)
137137
elseif("${TARGET_SYSTEM}" MATCHES "Linux")
138138
set(C_SYSTEM_LIBS m pthread rt dl)
139-
if("${TARGET_SYSTEM}" MATCHES "musl")
140-
list(APPEND C_SYSTEM_LIBS "unwind")
141-
endif()
142139
elseif("${TARGET_SYSTEM}" MATCHES "FreeBSD")
143140
set(C_SYSTEM_LIBS m pthread execinfo z)
144141
else()

0 commit comments

Comments
 (0)