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