From e2b8402e3e6e0a6a4084b58238e8bfda028cb2b3 Mon Sep 17 00:00:00 2001 From: Chongyun Lee <45286352+licy183@users.noreply.github.com> Date: Sun, 25 Aug 2024 01:04:07 +0800 Subject: [PATCH] binutils-cross: enable zstd support Since NDK r27, debug sections of libraries from the bundled sysroot are compressed with zstd. It is necessary to enable the zstd support for ld.bfd. --- packages/binutils-libs/build.sh | 12 +++++++++--- scripts/setup-ubuntu.sh | 3 +++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/packages/binutils-libs/build.sh b/packages/binutils-libs/build.sh index aa31297ab6fa3d..7a0efc6403c28a 100644 --- a/packages/binutils-libs/build.sh +++ b/packages/binutils-libs/build.sh @@ -23,6 +23,8 @@ TERMUX_PKG_NO_STATICSPLIT=true TERMUX_PKG_GROUPS="base-devel" # For binutils-cross: +# Since NDK r27, debug sections of libraries from the bundled sysroot are +# compressed with zstd. It is necessary to enable the zstd support for ld.bfd. TERMUX_PKG_HOSTBUILD=true TERMUX_PKG_EXTRA_HOSTBUILD_CONFIGURE_ARGS=" --prefix=$TERMUX_PREFIX/opt/binutils/cross @@ -31,9 +33,16 @@ TERMUX_PKG_EXTRA_HOSTBUILD_CONFIGURE_ARGS=" --disable-static --disable-nls --with-system-zlib +--with-zstd --disable-gprofng +ZSTD_LIBS=-l:libzstd.a " +termux_step_post_get_source() { + # Remove this marker all the time, as binutils is architecture-specific. + rm -rf $TERMUX_HOSTBUILD_MARKER +} + termux_step_host_build() { $TERMUX_PKG_SRCDIR/configure $TERMUX_PKG_EXTRA_HOSTBUILD_CONFIGURE_ARGS make -j $TERMUX_PKG_MAKE_PROCESSES @@ -45,9 +54,6 @@ termux_step_host_build() { export LEXLIB= termux_step_pre_configure() { - # Remove this marker all the time, as binutils is architecture-specific. - rm -rf $TERMUX_HOSTBUILD_MARKER - export CPPFLAGS="$CPPFLAGS -Wno-c++11-narrowing" # llvm upgraded a warning to an error, which caused this build (and some # others, including the rust toolchain) to fail like so: diff --git a/scripts/setup-ubuntu.sh b/scripts/setup-ubuntu.sh index 81ca6a2f9f04f6..419c7e8377fa65 100755 --- a/scripts/setup-ubuntu.sh +++ b/scripts/setup-ubuntu.sh @@ -310,6 +310,9 @@ PACKAGES+=" patchelf" # Needed by lldb for python integration PACKAGES+=" swig" +# Needed by binutils-cross +PACKAGES+=" libzstd-dev" + # Do not require sudo if already running as root. SUDO="sudo" if [ "$(id -u)" = "0" ]; then