Likely caused by upgrading to GNU Make 4.3, programs/Makefile fails to properly detect support for pthread, zlib, and liblzma. The offending line(s) in the Makefile all look like this: HAVE_PTHREAD := $(shell printf '\#include <pthread.h>\nint main(void) { return 0; }' > have_pthread.c && $(CC) $(FLAGS) -o have_pthread$(EXT) have_pthread.c -pthread 2> $(VOID) && rm have_pthread$(EXT) && echo 1 || echo 0; rm have_pthread.c) At the beginning of the printf string, the \# escape sequence no longer works, and the literal characters \# are printed directly to the "have_pthread.c" file. This causes the following output to appear when compiling the test: have_pthread.c:1:1: error: stray '\' in program have_pthread.c:1:2: error: stray '#' in program have_pthread.c:1:11: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token Since \ is invalid in the C program, the Makefile assumes that pthreads are not available in the system. I don't know the history behind why \# instead of # was used in the first place, but it was likely escaped to provide compatibility with older or non-GNU versions of "make". So assuming it is needed, we can change the \# escape to \043 to always produce a literal # in the output. Patch attached. Reproducible: Always
Created attachment 611502 [details, diff] Patch Makefile to fix pthread/zlib/etc detection
Compile output when pthreads is not auto-detected: ==> no threads, building without multithreading support ==> no zlib, building zstd without .gz support ==> no liblzma, building zstd without .xz/.lzma support ==> no liblz4, building zstd without .lz4 support Expected output on my system: ==> building with threading support ==> building zstd with .gz compression support ==> building zstd with .xz/.lzma compression support ==> no liblz4, building zstd without .lz4 support
Just stumbled across this myself. After filing a bug upstream I found that it's already fixed in: https://github.com/facebook/zstd/commit/06a57cf57e3c4e887cadcf688e3081154f3f6db4 Dropping that into /etc/portage/patches does the trick.
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7dd359a8181e14f2bf0bdc11236e287f845ad70f commit 7dd359a8181e14f2bf0bdc11236e287f845ad70f Author: Matt Turner <mattst88@gentoo.org> AuthorDate: 2020-03-20 18:26:52 +0000 Commit: Matt Turner <mattst88@gentoo.org> CommitDate: 2020-03-20 18:31:20 +0000 app-arch/zstd: Fix feature detection with make-4.3 Closes: https://bugs.gentoo.org/708110 Signed-off-by: Matt Turner <mattst88@gentoo.org> ...ue-More-portable-header-prefix-usage-1987.patch | 60 ++++++++++++++++++++++ .../{zstd-1.4.4-r2.ebuild => zstd-1.4.4-r3.ebuild} | 1 + 2 files changed, 61 insertions(+)