From 1973ef42dba8c37d4e8de2aee5bdd27749390849 Mon Sep 17 00:00:00 2001 From: Henrik Grimler Date: Tue, 28 May 2019 21:31:32 +0200 Subject: [PATCH] datamash: fix debug build --- packages/datamash/build.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/packages/datamash/build.sh b/packages/datamash/build.sh index af2dac307..47e609097 100644 --- a/packages/datamash/build.sh +++ b/packages/datamash/build.sh @@ -5,3 +5,16 @@ TERMUX_PKG_VERSION=1.4 TERMUX_PKG_SHA256=fa44dd2d5456bcb94ef49dfc6cfe62c83fd53ac435119a85d34e6812f6e6472a TERMUX_PKG_SRCURL=https://mirrors.kernel.org/gnu/datamash/datamash-${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_BUILD_IN_SRC=yes + +termux_step_pre_configure() { + if [ "$TERMUX_DEBUG" == "true" ]; then + # When doing debug build, -D_FORTIFY_SOURCE=2 gives this error: + # /home/builder/.termux-build/_cache/19b-aarch64-24-v5/bin/../sysroot/usr/include/bits/fortify/stdio.h:51:53: error: use of undeclared identifier '__USE_FORTIFY_LEVEL' + # return __builtin___vsnprintf_chk(dest, size, 0, __bos(dest), format, ap); + # ^ + # lib/cdefs.h:123:48: note: expanded from macro '__bos' + # #define __bos(ptr) __builtin_object_size (ptr, __USE_FORTIFY_LEVEL > 1) + # ^ + export CFLAGS=${CFLAGS/-D_FORTIFY_SOURCE=2/} + fi +}