Remove _FORTIFY_SOURCE workaround for some pkgs for debug builds

Not necessary after __USE_FORTIFY_LEVEL is set. No need to rebuild any
packages for this though:
%ci:no-build
This commit is contained in:
Henrik Grimler 2021-02-03 12:53:04 +01:00
parent b158c8de2a
commit 742d86b568
11 changed files with 1 additions and 98 deletions

View File

@ -102,18 +102,7 @@ termux_step_make_install() {
socket_network_client_unix.c \
sockets_unix.o \
str_parms.c"
# -D_FORTIFY_SOURCE=2 makes debug build fail with:
# In file included from process_name.c:29:
# /data/data/com.termux/files/usr/include/aosp/cutils/properties.h:116:45: error: expected identifier
# __errordecl(__property_get_too_small_error, "property_get() called with too small of a buffer");
# ^
# /data/data/com.termux/files/usr/include/aosp/cutils/properties.h:119:5: error: static declaration of 'property_get' follows non-static declaration
# int property_get(const char *key, char *value, const char *default_value) {
# ^
# /data/data/com.termux/files/usr/include/aosp/cutils/properties.h:46:5: note: previous declaration is here
# int property_get(const char *key, char *value, const char *default_value);
$CC ${CFLAGS/-D_FORTIFY_SOURCE=2/} \
$LDFLAGS \
$CC $LDFLAGS \
-Dchar16_t=uint16_t \
-std=c11 \
-isystem $AOSP_INCLUDE_DIR \

View File

@ -13,17 +13,6 @@ TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--enable-gold --enable-plugins --disable-werror
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")))
# ^ ~~~~
# Avoid linking against libfl.so from flex if available:
export LEXLIB=

View File

@ -6,16 +6,3 @@ TERMUX_PKG_VERSION=1.7
TERMUX_PKG_SRCURL=https://mirrors.kernel.org/gnu/datamash/datamash-${TERMUX_PKG_VERSION}.tar.gz
TERMUX_PKG_SHA256=574a592bb90c5ae702ffaed1b59498d5e3e7466a8abf8530c5f2f3f11fa4adb3
TERMUX_PKG_BUILD_IN_SRC=true
termux_step_pre_configure() {
if $TERMUX_DEBUG; 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
}

View File

@ -10,11 +10,3 @@ TERMUX_PKG_DEPENDS="libiconv"
TERMUX_PKG_ESSENTIAL=true
TERMUX_PKG_EXTRA_CONFIGURE_ARGS="ac_cv_path_PR_PROGRAM=${TERMUX_PREFIX}/bin/pr"
termux_step_pre_configure() {
if $TERMUX_DEBUG; then
# When doing debug build, -D_FORTIFY_SOURCE=2 gives an
# error: use of undeclared identifier '__USE_FORTIFY_LEVEL'
export CFLAGS=${CFLAGS/-D_FORTIFY_SOURCE=2/}
fi
}

View File

@ -7,16 +7,3 @@ TERMUX_PKG_SRCURL=https://mirrors.kernel.org/gnu/grep/grep-${TERMUX_PKG_VERSION}
TERMUX_PKG_SHA256=667e15e8afe189e93f9f21a7cd3a7b3f776202f417330b248c2ad4f997d9373e
TERMUX_PKG_DEPENDS="libandroid-support, pcre"
TERMUX_PKG_ESSENTIAL=true
termux_step_pre_configure() {
if $TERMUX_DEBUG; 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
}

View File

@ -19,11 +19,5 @@ ac_cv_func_dn_expand=no
"
termux_step_pre_configure() {
if $TERMUX_DEBUG; then
#When doing debug build, -D_FORTIFY_SOURCE=2 gives this error:
# /home/builder/.termux-build/_lib/16-aarch64-21-v3/bin/../sysroot/usr/include/bits/fortify/string.h:79:26: error: use of undeclared identifier '__USE_FORTIFY_LEVEL'
export CFLAGS=${CFLAGS/-D_FORTIFY_SOURCE=2/}
fi
CXXFLAGS+=" -DNO_INLINE_GETPASS=1"
}

View File

@ -23,9 +23,4 @@ TERMUX_PKG_EXTRA_CONFIGURE_ARGS="
termux_step_pre_configure() {
CFLAGS+=" -DNO_INLINE_GETPASS=1"
if $TERMUX_DEBUG; then
# When doing debug build, -D_FORTIFY_SOURCE=2 gives this error:
# /home/builder/.termux-build/_cache/android-r20-api-24-v2/bin/../sysroot/usr/include/bits/fortify/string.h:157:22: error: use of undeclared identifier '__USE_FORTIFY_LEVEL'
export CFLAGS=${CFLAGS/-D_FORTIFY_SOURCE=2/}
fi
}

View File

@ -18,13 +18,3 @@ ac_cv_path_ZIP=$TERMUX_PREFIX/bin/zip
--with-ncurses-libs=$TERMUX_PREFIX/lib
--with-screen=ncurses
"
termux_step_pre_configure() {
if $TERMUX_DEBUG; then
# Debug build fails with:
# /home/builder/.termux-build/mc/src/src/filemanager/file.c:2019:37: error: 'umask' called with invalid mode
# src_mode = umask (-1);
# ^
export CFLAGS=${CFLAGS/-D_FORTIFY_SOURCE=2/}
fi
}

View File

@ -17,11 +17,6 @@ TERMUX_PKG_RM_AFTER_INSTALL="bin/rnano share/man/man1/rnano.1 share/nano/man-htm
termux_step_pre_configure() {
LDFLAGS+=" -landroid-glob"
if $TERMUX_DEBUG; then
#When doing debug build, -D_FORTIFY_SOURCE=2 gives this error:
# /home/builder/.termux-build/_lib/16-aarch64-21-v3/bin/../sysroot/usr/include/bits/fortify/string.h:79:26: error: use of undeclared identifier '__USE_FORTIFY_LEVEL'
export CFLAGS=${CFLAGS/-D_FORTIFY_SOURCE=2/}
fi
}
termux_step_post_make_install() {

View File

@ -9,12 +9,3 @@ TERMUX_PKG_DEPENDS="xmlsec, zlib"
TERMUX_PKG_BREAKS="oathtool-dev"
TERMUX_PKG_REPLACES="oathtool-dev"
TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--disable-pam"
termux_step_pre_configure() {
if $TERMUX_DEBUG; then
# When doing debug build, -D_FORTIFY_SOURCE=2 gives this error:
# /home/builder/.termux-build/oathtool/src/liboath/usersfile.c:482:46: error: 'umask' called with invalid mode
# old_umask = umask (~(S_IRUSR | S_IWUSR));
export CFLAGS=${CFLAGS/-D_FORTIFY_SOURCE=2/}
fi
}

View File

@ -9,10 +9,4 @@ TERMUX_PKG_DEPENDS="ncurses, file"
termux_step_pre_configure() {
autoreconf -if
if $TERMUX_DEBUG; then
# Debug build fails with:
# /home/builder/.termux-build/vifm/src/src/fops_common.c:745:27: error: 'umask' called with invalid mode
# saved_umask = umask(~0600);
export CFLAGS=${CFLAGS/-D_FORTIFY_SOURCE=2/}
fi
}