When specifying a non-system prefix with --with-zstd, the build fails because the header and library cannot be found (see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95005).
The attached patch fixes the problem and is what we use in Spack to make GCC build with zstd support. gcc/ * Makefile.in (ZSTD_INC): Define. (ZSTD_LIB): Include ZSTD_LDFLAGS. (CFLAGS-lto-compress.o): Add ZSTD_INC. * configure.ac (ZSTD_CPPFLAGS, ZSTD_LDFLAGS): New variables for AC_SUBST. * configure: Rebuilt.
This commit is contained in:
parent
84fa38d20a
commit
776256757b
@ -1081,7 +1081,8 @@ GNATMAKE = @GNATMAKE@
|
|||||||
# Libs needed (at present) just for jcf-dump.
|
# Libs needed (at present) just for jcf-dump.
|
||||||
LDEXP_LIB = @LDEXP_LIB@
|
LDEXP_LIB = @LDEXP_LIB@
|
||||||
|
|
||||||
ZSTD_LIB = @ZSTD_LIB@
|
ZSTD_INC = @ZSTD_CPPFLAGS@
|
||||||
|
ZSTD_LIB = @ZSTD_LDFLAGS@ @ZSTD_LIB@
|
||||||
|
|
||||||
# Likewise, for use in the tools that must run on this machine
|
# Likewise, for use in the tools that must run on this machine
|
||||||
# even if we are cross-building GCC.
|
# even if we are cross-building GCC.
|
||||||
@ -2286,7 +2287,7 @@ CFLAGS-version.o += -DBASEVER=$(BASEVER_s) -DDATESTAMP=$(DATESTAMP_s) \
|
|||||||
version.o: $(REVISION) $(DATESTAMP) $(BASEVER) $(DEVPHASE)
|
version.o: $(REVISION) $(DATESTAMP) $(BASEVER) $(DEVPHASE)
|
||||||
|
|
||||||
# lto-compress.o needs $(ZLIBINC) added to the include flags.
|
# lto-compress.o needs $(ZLIBINC) added to the include flags.
|
||||||
CFLAGS-lto-compress.o += $(ZLIBINC)
|
CFLAGS-lto-compress.o += $(ZLIBINC) $(ZSTD_INC)
|
||||||
|
|
||||||
CFLAGS-lto-streamer-in.o += -DTARGET_MACHINE=\"$(target_noncanonical)\"
|
CFLAGS-lto-streamer-in.o += -DTARGET_MACHINE=\"$(target_noncanonical)\"
|
||||||
|
|
||||||
|
2
gcc/configure
vendored
2
gcc/configure
vendored
@ -787,6 +787,8 @@ LTLIBICONV
|
|||||||
LIBICONV
|
LIBICONV
|
||||||
ZSTD_LIB
|
ZSTD_LIB
|
||||||
ZSTD_INCLUDE
|
ZSTD_INCLUDE
|
||||||
|
ZSTD_LDFLAGS
|
||||||
|
ZSTD_CPPFLAGS
|
||||||
DL_LIB
|
DL_LIB
|
||||||
LDEXP_LIB
|
LDEXP_LIB
|
||||||
EXTRA_GCC_LIBS
|
EXTRA_GCC_LIBS
|
||||||
|
@ -1340,6 +1340,8 @@ AC_SUBST(ZSTD_INCLUDE)
|
|||||||
AC_SUBST(ZSTD_LIB)
|
AC_SUBST(ZSTD_LIB)
|
||||||
ZSTD_CPPFLAGS=
|
ZSTD_CPPFLAGS=
|
||||||
ZSTD_LDFLAGS=
|
ZSTD_LDFLAGS=
|
||||||
|
AC_SUBST(ZSTD_CPPFLAGS)
|
||||||
|
AC_SUBST(ZSTD_LDFLAGS)
|
||||||
AC_ARG_WITH(zstd,
|
AC_ARG_WITH(zstd,
|
||||||
[AS_HELP_STRING([--with-zstd=PATH],
|
[AS_HELP_STRING([--with-zstd=PATH],
|
||||||
[specify prefix directory for installed zstd library.
|
[specify prefix directory for installed zstd library.
|
||||||
|
Loading…
Reference in New Issue
Block a user