From 06015d006d9ed080c27f32febc9bd22ce3812e96 Mon Sep 17 00:00:00 2001 From: Bananymous Date: Thu, 7 Aug 2025 20:57:58 +0300 Subject: [PATCH] ports/binutils: Fix compilation when zstd is installed binutils uses pkg-config to find zstd for the host when building. If our zstd port is installed, it finds it instead and ends up including our own sysroot which is incompatible with host's. unsetting pkg-config related variables fixes this and allows binutils to build fine even when zstd is installed. We can now make it a dependency. --- ports/binutils/build.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/ports/binutils/build.sh b/ports/binutils/build.sh index f3d825b9..04732842 100755 --- a/ports/binutils/build.sh +++ b/ports/binutils/build.sh @@ -3,7 +3,7 @@ NAME='binutils' VERSION='2.44' DOWNLOAD_URL="https://ftp.gnu.org/gnu/binutils/binutils-$VERSION.tar.gz#0cdd76777a0dfd3dd3a63f215f030208ddb91c2361d2bcc02acec0f1c16b6a2e" -DEPENDENCIES=('zlib') +DEPENDENCIES=('zlib' 'zstd') MAKE_INSTALL_TARGETS=('install-strip') CONFIGURE_OPTIONS=( "--target=$BANAN_TOOLCHAIN_TRIPLE" @@ -16,6 +16,13 @@ CONFIGURE_OPTIONS=( '--disable-werror' ) +pre_configure() { + unset PKG_CONFIG_DIR + unset PKG_CONFIG_SYSROOT_DIR + unset PKG_CONFIG_LIBDIR + unset PKG_CONFIG_PATH +} + post_install() { # remove libtool files rm -f $BANAN_SYSROOT/usr/lib/libbfd.la