diff --git a/.github/workflows/build_test.sh b/.github/workflows/build_test.sh index c0872117abc..176764246fc 100755 --- a/.github/workflows/build_test.sh +++ b/.github/workflows/build_test.sh @@ -45,7 +45,7 @@ PACKAGES=( libxkbcommon-dev libxtables-dev libzstd-dev - mold + # mold mount net-tools python3-evdev @@ -68,6 +68,14 @@ LINKER="${LINKER:?}" CRYPTOLIB="${CRYPTOLIB:?}" RELEASE="$(lsb_release -cs)" +# mold-2.2.0+ fixes some bugs breaking bootloader builds. +# TODO: Switch to distro mold with ubuntu-24.04 +if [[ "$LINKER" == mold ]]; then + wget https://github.com/rui314/mold/releases/download/v2.2.0/mold-2.2.0-x86_64-linux.tar.gz + echo "d66e0230c562c2ba0e0b789cc5034e0fa2369cc843d0154920de4269cd94afeb mold-2.2.0-x86_64-linux.tar.gz" | sha256sum -c + sudo tar -xz -C /usr --strip-components=1 -f mold-2.2.0-x86_64-linux.tar.gz +fi + # Note: As we use postfixed clang/gcc binaries, we need to override $AR # as well, otherwise meson falls back to ar from binutils which # doesn't work with LTO @@ -123,20 +131,11 @@ ninja --version for args in "${ARGS[@]}"; do SECONDS=0 - # mold < 1.1 does not support LTO. - if dpkg --compare-versions "$(dpkg-query --showformat='${Version}' --show mold)" ge 1.1; then - fatal "Newer mold version detected, please remove this workaround." - elif [[ "$args" == *"-Db_lto=true"* ]]; then - LD="gold" - else - LD="$LINKER" - fi - info "Checking build with $args" # shellcheck disable=SC2086 if ! AR="$AR" \ - CC="$CC" CC_LD="$LD" CFLAGS="-Werror" \ - CXX="$CXX" CXX_LD="$LD" CXXFLAGS="-Werror" \ + CC="$CC" CC_LD="$LINKER" CFLAGS="-Werror" \ + CXX="$CXX" CXX_LD="$LINKER" CXXFLAGS="-Werror" \ meson setup \ -Dtests=unsafe -Dslow-tests=true -Dfuzz-tests=true --werror \ -Dnobody-group=nogroup -Dcryptolib="${CRYPTOLIB:?}" -Ddebug=false \ diff --git a/.github/workflows/build_test.yml b/.github/workflows/build_test.yml index ccbbe26ecdc..dc9dc0bcb17 100644 --- a/.github/workflows/build_test.yml +++ b/.github/workflows/build_test.yml @@ -26,10 +26,10 @@ jobs: matrix: env: - { COMPILER: "gcc", COMPILER_VERSION: "11", LINKER: "bfd", CRYPTOLIB: "gcrypt" } - - { COMPILER: "gcc", COMPILER_VERSION: "13", LINKER: "gold", CRYPTOLIB: "openssl" } - - { COMPILER: "clang", COMPILER_VERSION: "14", LINKER: "mold", CRYPTOLIB: "gcrypt" } - - { COMPILER: "clang", COMPILER_VERSION: "15", LINKER: "lld", CRYPTOLIB: "openssl" } - - { COMPILER: "clang", COMPILER_VERSION: "16", LINKER: "bfd", CRYPTOLIB: "auto" } + - { COMPILER: "gcc", COMPILER_VERSION: "13", LINKER: "mold", CRYPTOLIB: "openssl" } + - { COMPILER: "clang", COMPILER_VERSION: "14", LINKER: "bfd", CRYPTOLIB: "gcrypt" } + - { COMPILER: "clang", COMPILER_VERSION: "15", LINKER: "mold", CRYPTOLIB: "openssl" } + - { COMPILER: "clang", COMPILER_VERSION: "17", LINKER: "lld", CRYPTOLIB: "auto" } env: ${{ matrix.env }} steps: - name: Repository checkout