public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc(refs/users/aoliva/heads/testme)] When specifying a non-system prefix with --with-zstd, the build fails because the header and library
@ 2020-06-10  3:17 Alexandre Oliva
  0 siblings, 0 replies; only message in thread
From: Alexandre Oliva @ 2020-06-10  3:17 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:776256757b3d12830e5449c41f1dd6c13fdf2868

commit 776256757b3d12830e5449c41f1dd6c13fdf2868
Author: Michael Kuhn <gcc@ikkoku.de>
Date:   Tue Jun 9 14:05:07 2020 -0600

    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.

Diff:
---
 gcc/Makefile.in  | 5 +++--
 gcc/configure    | 2 ++
 gcc/configure.ac | 2 ++
 3 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/gcc/Makefile.in b/gcc/Makefile.in
index be11311b60d..4f70c189b9d 100644
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -1081,7 +1081,8 @@ GNATMAKE = @GNATMAKE@
 # Libs needed (at present) just for jcf-dump.
 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
 # 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)
 
 # 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)\"
 
diff --git a/gcc/configure b/gcc/configure
index 629c7c7e153..def9d9a48be 100755
--- a/gcc/configure
+++ b/gcc/configure
@@ -787,6 +787,8 @@ LTLIBICONV
 LIBICONV
 ZSTD_LIB
 ZSTD_INCLUDE
+ZSTD_LDFLAGS
+ZSTD_CPPFLAGS
 DL_LIB
 LDEXP_LIB
 EXTRA_GCC_LIBS
diff --git a/gcc/configure.ac b/gcc/configure.ac
index 9e7efd13ecc..e769c9c87d4 100644
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -1340,6 +1340,8 @@ AC_SUBST(ZSTD_INCLUDE)
 AC_SUBST(ZSTD_LIB)
 ZSTD_CPPFLAGS=
 ZSTD_LDFLAGS=
+AC_SUBST(ZSTD_CPPFLAGS)
+AC_SUBST(ZSTD_LDFLAGS)
 AC_ARG_WITH(zstd,
 	[AS_HELP_STRING([--with-zstd=PATH],
 		[specify prefix directory for installed zstd library.


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-06-10  3:17 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-10  3:17 [gcc(refs/users/aoliva/heads/testme)] When specifying a non-system prefix with --with-zstd, the build fails because the header and library Alexandre Oliva

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).