Commit ccddbbc0 by Jim Wilson Committed by Kito Cheng

Fix build failure with zstd versio9n 1.2.0 or older.

Extends the configure check for zstd.h to also verify the zstd version,
since gcc requires features that only exist in 1.3.0 and newer.  Without
this patch we get a build error for lto-compress.c when using an old zstd
version.

	Backported from master:
	2020-09-29  Jim Wilson  <jimw@sifive.com>

	gcc/
	PR bootstrap/97183
	* configure.ac (gcc_cv_header_zstd_h): Check ZSTD_VERISON_NUMBER.
	* configure: Regenerated.
parent 463e7cff
......@@ -10024,9 +10024,14 @@ $as_echo_n "checking for zstd.h... " >&6; }
if ${gcc_cv_header_zstd_h+:} false; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
# We require version 1.3.0 or later. This is the first version that has
# ZSTD_getFrameContentSize.
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <zstd.h>
#if ZSTD_VERSION_NUMBER < 10300
#error "need zstd 1.3.0 or better"
#endif
int
main ()
{
......@@ -19015,7 +19020,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
#line 19018 "configure"
#line 19023 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
......@@ -19121,7 +19126,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
#line 19124 "configure"
#line 19129 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
......
......@@ -1382,8 +1382,13 @@ LDFLAGS="$LDFLAGS $ZSTD_LDFLAGS"
AC_MSG_CHECKING(for zstd.h)
AC_CACHE_VAL(gcc_cv_header_zstd_h,
# We require version 1.3.0 or later. This is the first version that has
# ZSTD_getFrameContentSize.
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
[[#include <zstd.h>]])],
[[#include <zstd.h>
#if ZSTD_VERSION_NUMBER < 10300
#error "need zstd 1.3.0 or better"
#endif]])],
[gcc_cv_header_zstd_h=yes],
[gcc_cv_header_zstd_h=no])])
AC_MSG_RESULT($gcc_cv_header_zstd_h)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment