diff --git a/scripts/build/termux_step_setup_toolchain.sh b/scripts/build/termux_step_setup_toolchain.sh index bfb8f19ae..ce37b5553 100644 --- a/scripts/build/termux_step_setup_toolchain.sh +++ b/scripts/build/termux_step_setup_toolchain.sh @@ -2,6 +2,7 @@ termux_step_setup_toolchain() { [ "$TERMUX_PKG_METAPACKAGE" = "true" ] && return export CFLAGS="" + export CPPFLAGS="" export LDFLAGS="-L${TERMUX_PREFIX}/lib" export AS=$TERMUX_HOST_PLATFORM-clang @@ -69,13 +70,14 @@ termux_step_setup_toolchain() { LDFLAGS+=" -Wl,-z,relro,-z,now" if [ "$TERMUX_DEBUG" = "true" ]; then - CFLAGS+=" -g3 -O1 -D_FORTIFY_SOURCE=2" + CFLAGS+=" -g3 -O1" + CPPFLAGS+=" -D_FORTIFY_SOURCE=2 -D__USE_FORTIFY_LEVEL=2" else CFLAGS+=" -Oz" fi export CXXFLAGS="$CFLAGS" - export CPPFLAGS="-I${TERMUX_PREFIX}/include" + export CPPFLAGS+=" -I${TERMUX_PREFIX}/include" # If libandroid-support is declared as a dependency, link to it explicitly: if [ "$TERMUX_PKG_DEPENDS" != "${TERMUX_PKG_DEPENDS/libandroid-support/}" ]; then