ci: Use mold for x86-64 and AArch64 builds
mold is a fancy new linker that's really fast. Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6877 Signed-off-by: Daniel Stone <daniels@collabora.com> Reviewed-by: Eric Engestrom <eric@igalia.com> Reviewed-by: David Heidelberg <david.heidelberg@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17992>
This commit is contained in:
11
.gitlab-ci/container/build-mold.sh
Normal file
11
.gitlab-ci/container/build-mold.sh
Normal file
@@ -0,0 +1,11 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -ex
|
||||
|
||||
export MOLD_VERSION="1.4.1"
|
||||
git clone -b v"$MOLD_VERSION" --single-branch --depth 1 https://github.com/rui314/mold.git
|
||||
cd mold
|
||||
make
|
||||
make install
|
||||
cd ..
|
||||
rm -rf mold
|
@@ -17,7 +17,8 @@ export PATH=$CCACHE_PATH:$PATH
|
||||
export CC="${CCACHE_PATH}/gcc"
|
||||
export CXX="${CCACHE_PATH}/g++"
|
||||
|
||||
# Force linkers to gold, since it's so much faster for building. We can't use
|
||||
# When not using the mold linker (e.g. unsupported architecture), force
|
||||
# linkers to gold, since it's so much faster for building. We can't use
|
||||
# lld because we're on old debian and it's buggy. ming fails meson builds
|
||||
# with it with "meson.build:21:0: ERROR: Unable to determine dynamic linker"
|
||||
find /usr/bin -name \*-ld -o -name ld | \
|
||||
|
@@ -8,8 +8,15 @@ sed -i -e 's/http:\/\/deb/https:\/\/deb/g' /etc/apt/sources.list
|
||||
echo 'deb https://deb.debian.org/debian buster main' >/etc/apt/sources.list.d/buster.list
|
||||
apt-get update
|
||||
|
||||
# Ephemeral packages (installed for this script and removed again at
|
||||
# the end)
|
||||
STABLE_EPHEMERAL=" \
|
||||
libssl-dev \
|
||||
"
|
||||
|
||||
apt-get -y install \
|
||||
${EXTRA_LOCAL_PACKAGES} \
|
||||
${STABLE_EPHEMERAL} \
|
||||
abootimg \
|
||||
autoconf \
|
||||
automake \
|
||||
@@ -68,8 +75,12 @@ arch=armhf
|
||||
|
||||
. .gitlab-ci/container/container_pre_build.sh
|
||||
|
||||
. .gitlab-ci/container/build-mold.sh
|
||||
|
||||
# dependencies where we want a specific version
|
||||
EXTRA_MESON_ARGS=
|
||||
. .gitlab-ci/container/build-libdrm.sh
|
||||
|
||||
apt-get purge -y $STABLE_EPHEMERAL
|
||||
|
||||
. .gitlab-ci/container/container_post_build.sh
|
||||
|
@@ -12,6 +12,7 @@ STABLE_EPHEMERAL=" \
|
||||
autotools-dev \
|
||||
bzip2 \
|
||||
libtool \
|
||||
libssl-dev \
|
||||
python3-pip \
|
||||
"
|
||||
|
||||
@@ -58,6 +59,8 @@ export XORG_RELEASES=https://xorg.freedesktop.org/releases/individu
|
||||
|
||||
export XORGMACROS_VERSION=util-macros-1.19.0
|
||||
|
||||
. .gitlab-ci/container/build-mold.sh
|
||||
|
||||
wget $XORG_RELEASES/util/$XORGMACROS_VERSION.tar.bz2
|
||||
tar -xvf $XORGMACROS_VERSION.tar.bz2 && rm $XORGMACROS_VERSION.tar.bz2
|
||||
cd $XORGMACROS_VERSION; ./configure; make install; cd ..
|
||||
|
@@ -8,10 +8,12 @@ EPHEMERAL="
|
||||
autoconf
|
||||
automake
|
||||
bzip2
|
||||
cmake
|
||||
git
|
||||
libtool
|
||||
pkgconfig(epoxy)
|
||||
pkgconfig(gbm)
|
||||
pkgconfig(openssl)
|
||||
unzip
|
||||
wget
|
||||
xz
|
||||
@@ -83,6 +85,8 @@ tar -xvf $XORGMACROS_VERSION.tar.bz2 && rm $XORGMACROS_VERSION.tar.bz2
|
||||
cd $XORGMACROS_VERSION; ./configure; make install; cd ..
|
||||
rm -rf $XORGMACROS_VERSION
|
||||
|
||||
. .gitlab-ci/container/build-mold.sh
|
||||
|
||||
. .gitlab-ci/container/build-libdrm.sh
|
||||
|
||||
. .gitlab-ci/container/build-wayland.sh
|
||||
|
@@ -4,6 +4,7 @@ variables:
|
||||
|
||||
DEBIAN_X86_BUILD_IMAGE_PATH: "debian/x86_build"
|
||||
DEBIAN_BUILD_TAG: "2022-08-22-drop-llvm9"
|
||||
DEBIAN_BUILD_TAG: "2022-08-23-mold"
|
||||
|
||||
DEBIAN_X86_BUILD_MINGW_IMAGE_PATH: "debian/x86_build-mingw"
|
||||
DEBIAN_BUILD_MINGW_TAG: "2022-08-17-bump"
|
||||
@@ -14,7 +15,7 @@ variables:
|
||||
DEBIAN_X86_TEST_GL_TAG: "2022-08-17-bump"
|
||||
DEBIAN_X86_TEST_VK_TAG: "2022-08-17-bump"
|
||||
|
||||
FEDORA_X86_BUILD_TAG: "2022-08-17-bump"
|
||||
FEDORA_X86_BUILD_TAG: "2022-08-23-mold"
|
||||
KERNEL_ROOTFS_TAG: "2022-08-17-bump"
|
||||
|
||||
WINDOWS_X64_VS_PATH: "windows/x64_vs"
|
||||
|
@@ -79,7 +79,15 @@ meson _build --native-file=native.file \
|
||||
${EXTRA_OPTION}
|
||||
cd _build
|
||||
meson configure
|
||||
ninja
|
||||
if command -V mold &> /dev/null ; then
|
||||
mold --run ninja
|
||||
else
|
||||
ninja
|
||||
fi
|
||||
LC_ALL=C.UTF-8 meson test --num-processes ${FDO_CI_CONCURRENT:-4} --print-errorlogs ${MESON_TEST_ARGS}
|
||||
ninja install
|
||||
if command -V mold &> /dev/null ; then
|
||||
mold --run ninja install
|
||||
else
|
||||
ninja install
|
||||
fi
|
||||
cd ..
|
||||
|
Reference in New Issue
Block a user