]> git.ipfire.org Git - thirdparty/gcc.git/commit
build: Save/restore CXXFLAGS for zstd tests
authorRainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
Tue, 25 Nov 2025 21:25:48 +0000 (22:25 +0100)
committerRainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
Tue, 25 Nov 2025 21:25:48 +0000 (22:25 +0100)
commit56889bfec25e467deedb2750bdae7ec456a8f92c
tree0541e0a5ed934e6a5ddbe2e1d035ed5a1aa7a793
parent48f58eb854ece652241cc27e80534f02a7c7aded
build: Save/restore CXXFLAGS for zstd tests

I recently encountered a bootstrap failure on trunk caused by the fact
that an older out-of-tree version of ansidecl.h was found before the
in-tree one in $top_srcdir/include, so some macros from that header
that are used in gcc weren't defined.

The out-of-tree version was located in $ZSTD_INC (-I/vol/gcc/include)
which caused that directory to be included in gcc's CXXFLAGS like

CXXFLAGS='-g -O2 -fchecking=1 -I/vol/gcc/include'

causing it to be searched before $srcdir/../include.

I could trace this to the zstd.h test in gcc/configure.ac which sets
CXXFLAGS and LDFLAGS before the actual test, but doesn't reset them
afterwards.

So this patch does just that.

Bootstrapped without regressions on i386-pc-solaris2.11 and
x86_64-pc-linux-gnu.

2025-10-22  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

gcc:
* configure.ac (gcc_cv_header_zstd_h): Save, restore CXXFLAGS,
LDFLAGS.
* configure: Regenerate.
gcc/configure
gcc/configure.ac