public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug bootstrap/97183] New: zstd build failure for gcc 10 on Ubuntu 16.04
@ 2020-09-23 17:27 wilson at gcc dot gnu.org
  2020-09-24  7:16 ` [Bug bootstrap/97183] " rguenth at gcc dot gnu.org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: wilson at gcc dot gnu.org @ 2020-09-23 17:27 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97183

            Bug ID: 97183
           Summary: zstd build failure for gcc 10 on Ubuntu 16.04
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: bootstrap
          Assignee: unassigned at gcc dot gnu.org
          Reporter: wilson at gcc dot gnu.org
  Target Milestone: ---

This was originally reported here
    https://github.com/riscv/riscv-gnu-toolchain/issues/718

A build of gcc 10 on Ubuntu 16.04 with the libzstd-dev package installed gives
multiple errors.  Ubuntu 16.04 has zstd version 0.5.1 which lacks features that
gcc is trying to use.  The gcc configure test for zstd.h only verifies that it
exists, it doesn't verify the version, or that any of the functions or macros
we need are present.

Ubuntu 18.04 has zstd version 1.3.3, I verified that builds.  So we can maybe
verify the version is 1.3.3 or greater, or maybe check for the specific
functions and macros that we are trying to use.

Kito did a little research that suggests that we need verfsion 1.3.0 or
greater.  We haven't tried to verify that.

--without-zstd successfully works around the problem.

build log info from the original bug report:

g++ -fno-PIE -c   -g -O2 -DIN_GCC  -DCROSS_DIRECTORY_STRUCTURE  
-fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing
-Wwrite-strings -Wcast-qual -Wmissing-format-attribute -Woverloaded-virtual
-pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings  
-DHAVE_CONFIG_H -I. -I. -I../.././riscv-gcc/gcc -I../.././riscv-gcc/gcc/.
-I../.././riscv-gcc/gcc/../include -I../.././riscv-gcc/gcc/../libcpp/include 
-I../.././riscv-gcc/gcc/../libdecnumber
-I../.././riscv-gcc/gcc/../libdecnumber/dpd -I../libdecnumber
-I../.././riscv-gcc/gcc/../libbacktrace   -o optabs-tree.o -MT optabs-tree.o
-MMD -MP -MF ./.deps/optabs-tree.TPo ../.././riscv-gcc/gcc/optabs-tree.c
../.././riscv-gcc/gcc/lto-compress.c: In function ‘int
lto_normalized_zstd_level()’:
../.././riscv-gcc/gcc/lto-compress.c:120:36: error: ‘ZSTD_maxCLevel’ was not
declared in this scope
   else if (level > ZSTD_maxCLevel ())
                                    ^
../.././riscv-gcc/gcc/lto-compress.c: In function ‘void
lto_uncompression_zstd(lto_compression_stream*)’:
../.././riscv-gcc/gcc/lto-compress.c:160:74: error: ‘ZSTD_getFrameContentSize’
was not declared in this scope
   unsigned long long const rsize = ZSTD_getFrameContentSize (cursor, size);
                                                                          ^
../.././riscv-gcc/gcc/lto-compress.c:161:16: error: ‘ZSTD_CONTENTSIZE_ERROR’
was not declared in this scope
   if (rsize == ZSTD_CONTENTSIZE_ERROR)
                ^
../.././riscv-gcc/gcc/lto-compress.c:163:21: error: ‘ZSTD_CONTENTSIZE_UNKNOWN’
was not declared in this scope
   else if (rsize == ZSTD_CONTENTSIZE_UNKNOWN)
                     ^

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug bootstrap/97183] zstd build failure for gcc 10 on Ubuntu 16.04
  2020-09-23 17:27 [Bug bootstrap/97183] New: zstd build failure for gcc 10 on Ubuntu 16.04 wilson at gcc dot gnu.org
@ 2020-09-24  7:16 ` rguenth at gcc dot gnu.org
  2020-09-24  7:58 ` marxin at gcc dot gnu.org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2020-09-24  7:16 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97183

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
I think amending the configure test for the specific macro / API uses is better
than a version check.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug bootstrap/97183] zstd build failure for gcc 10 on Ubuntu 16.04
  2020-09-23 17:27 [Bug bootstrap/97183] New: zstd build failure for gcc 10 on Ubuntu 16.04 wilson at gcc dot gnu.org
  2020-09-24  7:16 ` [Bug bootstrap/97183] " rguenth at gcc dot gnu.org
@ 2020-09-24  7:58 ` marxin at gcc dot gnu.org
  2020-09-25  3:28 ` wilson at gcc dot gnu.org
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: marxin at gcc dot gnu.org @ 2020-09-24  7:58 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97183

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |marxin at gcc dot gnu.org
   Last reconfirmed|                            |2020-09-24
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1

--- Comment #2 from Martin Liška <marxin at gcc dot gnu.org> ---
Confirmed, can you please suggest a patch Jim?

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug bootstrap/97183] zstd build failure for gcc 10 on Ubuntu 16.04
  2020-09-23 17:27 [Bug bootstrap/97183] New: zstd build failure for gcc 10 on Ubuntu 16.04 wilson at gcc dot gnu.org
  2020-09-24  7:16 ` [Bug bootstrap/97183] " rguenth at gcc dot gnu.org
  2020-09-24  7:58 ` marxin at gcc dot gnu.org
@ 2020-09-25  3:28 ` wilson at gcc dot gnu.org
  2020-09-25  8:36 ` marxin at gcc dot gnu.org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: wilson at gcc dot gnu.org @ 2020-09-25  3:28 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97183

--- Comment #3 from Jim Wilson <wilson at gcc dot gnu.org> ---
I installed Ubuntu 16.04 on an old laptop so I can directly reproduce the build
failure.

Checking for the zstd version looks like the easier patch.

Checking for specific macros and functions might be better, but what do we do
with the info?  I'm not familiar with zstd or the lto-compress.c code, and it
doesn't look like we can easily change it to not use certain macros/functions
when they don't exist.  Checking for half a dozen macros/functions and
disabling all of the code if one or more is missing seems silly.  Though
looking at this, as Kito pointed out, it appears that
ZSTD_getFrameContentSize() is the most recently added function that we are
using, so maybe we only need to check for that one.  That was added in version
1.3.0.  Or we can check for the 1.3.0 version which seems simpler.  I do know
that version 1.3.3 of zstd works as this is what Ubuntu 18.04 has.  I haven't
tried the versions 1.3.[012].

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug bootstrap/97183] zstd build failure for gcc 10 on Ubuntu 16.04
  2020-09-23 17:27 [Bug bootstrap/97183] New: zstd build failure for gcc 10 on Ubuntu 16.04 wilson at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2020-09-25  3:28 ` wilson at gcc dot gnu.org
@ 2020-09-25  8:36 ` marxin at gcc dot gnu.org
  2020-09-29 22:27 ` cvs-commit at gcc dot gnu.org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: marxin at gcc dot gnu.org @ 2020-09-25  8:36 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97183

--- Comment #4 from Martin Liška <marxin at gcc dot gnu.org> ---
> Or we can check for the 1.3.0 version which seems simpler. 
> I do know that version 1.3.3 of zstd works as this is what Ubuntu 18.04 has.
> I haven't tried the versions 1.3.[012].

Yes, I would recommend checking for a specific minimal version (in this case
1.3.0).

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug bootstrap/97183] zstd build failure for gcc 10 on Ubuntu 16.04
  2020-09-23 17:27 [Bug bootstrap/97183] New: zstd build failure for gcc 10 on Ubuntu 16.04 wilson at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2020-09-25  8:36 ` marxin at gcc dot gnu.org
@ 2020-09-29 22:27 ` cvs-commit at gcc dot gnu.org
  2020-09-30 20:09 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-09-29 22:27 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97183

--- Comment #5 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jim Wilson <wilson@gcc.gnu.org>:

https://gcc.gnu.org/g:6649df18f98d5baf89b56a09b816b5eeb5f67bcb

commit r11-3536-g6649df18f98d5baf89b56a09b816b5eeb5f67bcb
Author: Jim Wilson <jimw@sifive.com>
Date:   Mon Sep 28 17:13:40 2020 -0700

    Fix GCC 10+ build failure with zstd version 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.

            gcc/
            PR bootstrap/97183
            * configure.ac (gcc_cv_header_zstd_h): Check ZSTD_VERISON_NUMBER.
            * configure: Regenerated.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug bootstrap/97183] zstd build failure for gcc 10 on Ubuntu 16.04
  2020-09-23 17:27 [Bug bootstrap/97183] New: zstd build failure for gcc 10 on Ubuntu 16.04 wilson at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2020-09-29 22:27 ` cvs-commit at gcc dot gnu.org
@ 2020-09-30 20:09 ` cvs-commit at gcc dot gnu.org
  2020-09-30 20:12 ` wilson at gcc dot gnu.org
  2020-09-30 20:13 ` wilson at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-09-30 20:09 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97183

--- Comment #6 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-10 branch has been updated by Jim Wilson <wilson@gcc.gnu.org>:

https://gcc.gnu.org/g:9d85b9880e1772ead961c7b5a2bd8caab57815bf

commit r10-8831-g9d85b9880e1772ead961c7b5a2bd8caab57815bf
Author: Jim Wilson <jimw@sifive.com>
Date:   Wed Sep 30 13:06:28 2020 -0700

    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.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug bootstrap/97183] zstd build failure for gcc 10 on Ubuntu 16.04
  2020-09-23 17:27 [Bug bootstrap/97183] New: zstd build failure for gcc 10 on Ubuntu 16.04 wilson at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2020-09-30 20:09 ` cvs-commit at gcc dot gnu.org
@ 2020-09-30 20:12 ` wilson at gcc dot gnu.org
  2020-09-30 20:13 ` wilson at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: wilson at gcc dot gnu.org @ 2020-09-30 20:12 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97183

--- Comment #7 from Jim Wilson <wilson at gcc dot gnu.org> ---
Fixed on mainline and the gcc-10 branch.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug bootstrap/97183] zstd build failure for gcc 10 on Ubuntu 16.04
  2020-09-23 17:27 [Bug bootstrap/97183] New: zstd build failure for gcc 10 on Ubuntu 16.04 wilson at gcc dot gnu.org
                   ` (6 preceding siblings ...)
  2020-09-30 20:12 ` wilson at gcc dot gnu.org
@ 2020-09-30 20:13 ` wilson at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: wilson at gcc dot gnu.org @ 2020-09-30 20:13 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97183

Jim Wilson <wilson at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|NEW                         |RESOLVED

--- Comment #8 from Jim Wilson <wilson at gcc dot gnu.org> ---
Remember to set it to resolved/fixed this tine,

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2020-09-30 20:13 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-23 17:27 [Bug bootstrap/97183] New: zstd build failure for gcc 10 on Ubuntu 16.04 wilson at gcc dot gnu.org
2020-09-24  7:16 ` [Bug bootstrap/97183] " rguenth at gcc dot gnu.org
2020-09-24  7:58 ` marxin at gcc dot gnu.org
2020-09-25  3:28 ` wilson at gcc dot gnu.org
2020-09-25  8:36 ` marxin at gcc dot gnu.org
2020-09-29 22:27 ` cvs-commit at gcc dot gnu.org
2020-09-30 20:09 ` cvs-commit at gcc dot gnu.org
2020-09-30 20:12 ` wilson at gcc dot gnu.org
2020-09-30 20:13 ` wilson at gcc dot gnu.org

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).