When using a toolchain with gold as the default linker in Debian, the kernel build fails:
x86_64-linux-gnu-ld: unknown linker scripts/Kconfig.include:56: Sorry, this linker is not supported. So force the use of the BFD linker. This was already part of the build script but has now been moved to a separate script so that other jobs (dtbs check, kunit) can use it. Signed-off-by: Vignesh Raman <vignesh.ra...@collabora.com> --- drivers/gpu/drm/ci/build.sh | 14 ++------------ drivers/gpu/drm/ci/override-ld-with-bfd.sh | 16 ++++++++++++++++ 2 files changed, 18 insertions(+), 12 deletions(-) create mode 100755 drivers/gpu/drm/ci/override-ld-with-bfd.sh diff --git a/drivers/gpu/drm/ci/build.sh b/drivers/gpu/drm/ci/build.sh index 284873e94d8d..3857b732cf16 100644 --- a/drivers/gpu/drm/ci/build.sh +++ b/drivers/gpu/drm/ci/build.sh @@ -8,6 +8,8 @@ rm -rf .git/rebase-apply . .gitlab-ci/container/container_pre_build.sh +. drivers/gpu/drm/ci/override-ld-with-bfd.sh + # libssl-dev was uninstalled because it was considered an ephemeral package apt-get update apt-get install -y libssl-dev @@ -47,18 +49,6 @@ fi export ARCH=${KERNEL_ARCH} export CROSS_COMPILE="${GCC_ARCH}-" -# The kernel doesn't like the gold linker (or the old lld in our debians). -# Sneak in some override symlinks during kernel build until we can update -# debian. -mkdir -p ld-links -for i in /usr/bin/*-ld /usr/bin/ld; do - i=$(basename $i) - ln -sf /usr/bin/$i.bfd ld-links/$i -done - -NEWPATH=$(pwd)/ld-links -export PATH=$NEWPATH:$PATH - git config --global user.email "f...@example.com" git config --global user.name "freedesktop.org CI" git config --global pull.rebase true diff --git a/drivers/gpu/drm/ci/override-ld-with-bfd.sh b/drivers/gpu/drm/ci/override-ld-with-bfd.sh new file mode 100755 index 000000000000..9728dc39cb19 --- /dev/null +++ b/drivers/gpu/drm/ci/override-ld-with-bfd.sh @@ -0,0 +1,16 @@ +#!/bin/bash +# SPDX-License-Identifier: MIT + +set -ex + +# The kernel doesn't like the gold linker (or the old lld in our debians). +# Sneak in some override symlinks during kernel build until we can update +# debian. +mkdir -p ld-links +for i in /usr/bin/*-ld /usr/bin/ld; do + i=$(basename $i) + ln -sf /usr/bin/$i.bfd ld-links/$i +done + +NEWPATH=$(pwd)/ld-links +export PATH=$NEWPATH:$PATH -- 2.47.2