Recent Solaris 11.4 SRUs bundle zstd, but only the 64-bit libraries (no idea why). Because of this, in 32-bit builds cc1 etc. fail to link with undefined references to various ZSTD_* functions from lto-compress.o. This happens because currently only the presence of is necessary to enable zstd support in lto-compress.cc etc. This patch checks for libzstd first and disables zstd support if missing. Tested on sparc-sun-solaris2.11 with the system installation of zstd (64-bit only) and a locally-compiled one (specified with --with-zstd). Ok for trunk? * Setting the cache variable first might be considered a hack: alternatively, one could use AC_LINK_IFELSE instead of AC_COMPILE_IFELSE, adjusting the test program accordingly. * All the code withing if test "x$with_zstd" != xno; then lacks indentation, which makes it harder to read. I've left that out of this patch, though. Rainer -- ----------------------------------------------------------------------------- Rainer Orth, Center for Biotechnology, Bielefeld University 2023-03-28 Rainer Orth gcc: * configure.ac (ZSTD_LIB): Move before zstd.h check. Unset gcc_cv_header_zstd_h without libzstd. * configure: Regenerate.