From 38ac8aef6a2caf0b29a052c4e6b90b35eed02525 Mon Sep 17 00:00:00 2001 From: joonicks Date: Wed, 5 Nov 2025 21:30:27 +0100 Subject: [PATCH] conflicting compiler flags --- configure | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/configure b/configure index 243f9ef..e2b37af 100755 --- a/configure +++ b/configure @@ -554,7 +554,7 @@ cf_cflags= if [ -n "$CFLAGS" ]; then if $CC $CFLAGS -c -o $TESTO $TESTC 1> /dev/null 2> /dev/null && test -r $TESTO; then cf_cflags="$CFLAGS" - echo $ac_n "$CFLAGS "$ac_c + echo $ac_n "$CFLAGS (from environment CFLAGS) "$ac_c fi fi @@ -616,12 +616,10 @@ if [ -z "$cf_cflags" -a -n "$cf_GNUCC" ]; then # # -fomit-frame-pointer # - if [ ! "$ft_prof" = yes ]; then - if [ -z "$cc_ofp_opt" -o "$cc_ofp_opt" = yes ]; then - if $CC -fomit-frame-pointer -c -o $TESTO $TESTC 1> /dev/null 2> /dev/null && test -r $TESTO; then - cc_ofp_flag=-fomit-frame-pointer - echo $ac_n "-fomit-frame-pointer "$ac_c - fi + if [ -z "$cc_ofp_opt" -o "$cc_ofp_opt" = yes ]; then + if $CC -fomit-frame-pointer -c -o $TESTO $TESTC 1> /dev/null 2> /dev/null && test -r $TESTO; then + cc_ofp_flag=-fomit-frame-pointer + echo $ac_n "-fomit-frame-pointer "$ac_c fi fi fi @@ -635,7 +633,7 @@ fi oflag="-O2" if [ "$optitype" = size ]; then - oflag="-Os -fcf-protection=none" + oflag="-Os" fi if [ -z "$cf_cflags" -a -z "$cc_optimize_opt" ]; then @@ -651,6 +649,14 @@ if [ -z "$cf_cflags" -a -z "$cc_optimize_opt" ]; then fi fi +cc_omitprotect_flag="" +if [ "$optitype" = size ]; then + if $CC $oflag -fcf-protection=none -o $TESTO $TESTC 1> /dev/null 2> /dev/null; then + cc_omitprotect_flag="-fcf-protection=none " + echo $ac_n "$cc_omitprotect_flag "$ac_c + fi +fi + echo $ac_t "" if [ "$ft_prof" = yes ]; then @@ -1420,7 +1426,7 @@ test -z "$ans" -o "$ans" = y -o "$ans" = Y -o "$ans" = yes -o "$ans" = YES -o "$ $out '' echo "Creating src/Makefile" -O_FLAGS="$cc_optimize_flag $cc_arch_flag $cc_march_flag $cc_ofp_flag" +O_FLAGS="$cc_optimize_flag $cc_arch_flag $cc_march_flag $cc_ofp_flag $cc_omitprotect_flag" W_FLAGS="$cc_wall_flag $cc_wshadow_flag $cc_fnostrictalias" libflags="$libcrypt $libtcl $libnsl $libsocket $libresolv $libpython $libperl" lflags="$cc_g_flag -o"