diff --git a/.github/actions/3-build-native/action.yml b/.github/actions/3-build-native/action.yml index 14bbd8f812f..3683f67fd8c 100644 --- a/.github/actions/3-build-native/action.yml +++ b/.github/actions/3-build-native/action.yml @@ -31,7 +31,3 @@ runs: - run: ../build/bin/ldc2 --version shell: bash - - - run: ldd ../build/bin/ldc2 - if: runner.os == 'Linux' - shell: bash diff --git a/.github/actions/6-integration-test/action.yml b/.github/actions/6-integration-test/action.yml index 79729b4223a..b6c4cb57d28 100644 --- a/.github/actions/6-integration-test/action.yml +++ b/.github/actions/6-integration-test/action.yml @@ -49,7 +49,7 @@ runs: set -eux cd .. if type -P apk &>/dev/null; then - exit 0 # FIXME: Alpine: LLVM too old for dynamic-compile support + exit 0 # Alpine: disabled dynamic-compile support fi if [[ '${{ runner.os }}' == Windows ]]; then # add ldc-jit.dll dir to PATH diff --git a/.github/actions/7-package/action.yml b/.github/actions/7-package/action.yml index e6c91b46211..569e5b69227 100644 --- a/.github/actions/7-package/action.yml +++ b/.github/actions/7-package/action.yml @@ -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: | @@ -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: | diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 69d27872707..5caaeeaab30 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -63,13 +63,15 @@ jobs: -DBUILD_LTO_LIBS=ON -DBUILD_SHARED_LIBS=OFF -DLLVM_IS_SHARED=OFF + -DLDC_ENABLE_PLUGINS=OFF + -DLDC_DYNAMIC_COMPILE=OFF -DLDC_INSTALL_LTOPLUGIN=OFF -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 diff --git a/runtime/CMakeLists.txt b/runtime/CMakeLists.txt index 2d2d7e81309..ce4b6007b08 100644 --- a/runtime/CMakeLists.txt +++ b/runtime/CMakeLists.txt @@ -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()