termux-packages/packages/binutils/build.sh

49 lines
2.4 KiB
Bash
Raw Normal View History

TERMUX_PKG_HOMEPAGE=https://www.gnu.org/software/binutils/
2015-06-13 01:03:31 +02:00
TERMUX_PKG_DESCRIPTION="Collection of binary tools, the main ones being ld, the GNU linker, and as, the GNU assembler"
2019-01-20 22:39:59 +01:00
TERMUX_PKG_LICENSE="GPL-2.0"
2019-10-22 03:00:53 +02:00
TERMUX_PKG_VERSION=2.33.1
TERMUX_PKG_SHA256=98aba5f673280451a09df3a8d8eddb3aa0c505ac183f1e2f9d00c67aa04c6f7d
TERMUX_PKG_SRCURL=https://mirrors.kernel.org/gnu/binutils/binutils-${TERMUX_PKG_VERSION}.tar.gz
2019-06-19 20:16:39 +02:00
TERMUX_PKG_DEPENDS="libc++, zlib"
TERMUX_PKG_BREAKS="binutils-dev"
TERMUX_PKG_REPLACES="binutils-dev"
TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--enable-gold --enable-plugins --disable-werror --with-system-zlib --enable-new-dtags"
2015-06-13 01:03:31 +02:00
TERMUX_PKG_EXTRA_MAKE_ARGS="tooldir=$TERMUX_PREFIX"
TERMUX_PKG_RM_AFTER_INSTALL="share/man/man1/windmc.1 share/man/man1/windres.1 bin/ld.bfd"
TERMUX_PKG_NO_STATICSPLIT=true
TERMUX_PKG_HAS_DEBUG=false
# Debug build fails with:
# ~/termux-build/binutils/src/binutils/readelf.c:19060:81: error: in call to 'fread', size * count is too large for the given buffer
# if (fread (ehdr32.e_type, sizeof (ehdr32) - EI_NIDENT, 1, filedata->handle) != 1)
# ^
# ~/termux-build/_cache/19b-aarch64-24-v5/bin/../sysroot/usr/include/bits/fortify/stdio.h:107:9: note: from 'diagnose_if' attribute on 'fread':
# __clang_error_if(__bos(buf) != __BIONIC_FORTIFY_UNKNOWN_SIZE && size * count > __bos(buf),
# ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# ~/termux-build/_cache/19b-aarch64-24-v5/bin/../sysroot/usr/include/sys/cdefs.h:163:52: note: expanded from macro '__clang_error_if'
# #define __clang_error_if(cond, msg) __attribute__((diagnose_if(cond, msg, "error")))
# ^ ~~~~
2018-03-20 23:15:46 +01:00
# Avoid linking against libfl.so from flex if available:
export LEXLIB=
termux_step_pre_configure() {
2018-09-19 23:29:39 +02:00
export CPPFLAGS="$CPPFLAGS -Wno-c++11-narrowing"
2018-10-30 14:38:16 +01:00
if [ $TERMUX_ARCH_BITS = 32 ]; then
2018-10-30 14:38:16 +01:00
export LIB_PATH="${TERMUX_PREFIX}/lib:/system/lib"
else
export LIB_PATH="${TERMUX_PREFIX}/lib:/system/lib64"
fi
2018-09-19 23:29:39 +02:00
}
termux_step_post_make_install() {
2015-06-13 01:03:31 +02:00
cp $TERMUX_PKG_BUILDER_DIR/ldd $TERMUX_PREFIX/bin/ldd
cd $TERMUX_PREFIX/bin
# Setup symlinks as these are used when building, so used by
# system setup in e.g. python, perl and libtool:
for b in ar ld nm objdump ranlib readelf strip; do
ln -s -f $b $TERMUX_HOST_PLATFORM-$b
done
2019-02-09 12:16:54 +01:00
ln -sf ld.gold gold
2015-06-13 01:03:31 +02:00
}