]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
build: Correctly restore CXXFLAGS/LDFLAGS for zstd test
authorDimitry Andric <dimitry@andric.com>
Tue, 10 Feb 2026 18:51:58 +0000 (19:51 +0100)
committerAndrew Pinski <andrew.pinski@oss.qualcomm.com>
Tue, 10 Feb 2026 21:32:42 +0000 (13:32 -0800)
Commit r16-5592-g56889bfec25 added saving and restoring of CXXFLAGS and
LDFLAGS in the gcc configure script, to avoid including the wrong zstd
headers.

However, due to misleading indentation in the configure script, the
restoration of CXXFLAGS and LDFLAGS was put after the if block where the
values were saved. This could cause various interesting effects, among
others segfaults while building gcc in the FreeBSD ports system.

Move the restoration of CXXFLAGS and LDFLAGS to just before the end of
the same if block to fix this.

Thanks to Mark Millard for spotting the actual mistake.

2026-02-10  Dimitry Andric  <dimitry@andric.com>

gcc:
PR libfortran/123366
* configure.ac: Move restoring of CXXFLAGS/LDFLAGS for zstd test to
the correct place.
* configure: Regenerate.

Signed-off-by: Dimitry Andric <dimitry@andric.com>
gcc/configure
gcc/configure.ac

index bad73081a9b8b6fed6d54ac16faeed2505f9f542..100e6e100120918ab243308e4b8cb7fad3f51c24 100755 (executable)
@@ -10661,10 +10661,10 @@ $as_echo "#define HAVE_ZSTD_H 1" >>confdefs.h
 elif test "x$with_zstd" != x; then
     as_fn_error $? "Unable to find zstd.h.  See config.log for details." "$LINENO" 5
 fi
-fi
 
 CXXFLAGS="$saved_CXXFLAGS"
 LDFLAGS="$saved_LDFLAGS"
+fi
 
 
 
index 7eb86146a104063463e1daed150ec513456a647b..35af1382cf1a492bb0867bf3baf7b9ddb8ef0c6c 100644 (file)
@@ -1565,10 +1565,10 @@ if test $gcc_cv_header_zstd_h = yes; then
 elif test "x$with_zstd" != x; then
     as_fn_error $? "Unable to find zstd.h.  See config.log for details." "$LINENO" 5
 fi
-fi
 
 CXXFLAGS="$saved_CXXFLAGS"
 LDFLAGS="$saved_LDFLAGS"
+fi
 
 dnl Disabled until we have a complete test for buggy enum bitfields.
 dnl gcc_AC_C_ENUM_BF_UNSIGNED