From: Olivier Houchard Date: Tue, 10 Nov 2026 15:48:50 +0000 (+0100) Subject: BUILD: Makefile: force $(shell command -v ...) to run through the shell X-Git-Tag: v3.5-dev12~35 X-Git-Url: https://git.kaiwu.me/%7B@url%7D?a=commitdiff_plain;h=1d75af865ee38319e136a97dd93503fc19acd2af;p=haproxy.git BUILD: Makefile: force $(shell command -v ...) to run through the shell $(shell) commands with no metacharacter and not starting with a shell builtin may be execvp()'d directly instead of being run through the shell. "command" is a shell builtin that only appears in make's own builtin list since version 4.3, so with make <= 4.2 the USE_MINIDEBUG probe failed with "Command not found" and silently disabled the embedded symbol table. Adding "2>/dev/null || :" brings metacharacters which force the shell path on all make versions. This should fix build on older distributions such as Ubuntu 18.04. --- diff --git a/Makefile b/Makefile index 050f1e2a0..a2d493993 100644 --- a/Makefile +++ b/Makefile @@ -597,7 +597,7 @@ EXTRA_OBJS = # This should work with GNU binutils, LLVM tools, elftoolchain, and OpenBSD's # nm. ifeq ($(origin USE_MINIDEBUG),undefined) -USE_MINIDEBUG := $(if $(and $(shell command -v $(XZ)),$(shell $(CC) -dM -E -xc - /dev/null | grep __ELF__),$(shell \ +USE_MINIDEBUG := $(if $(and $(shell command -v $(XZ) 2>/dev/null || :),$(shell $(CC) -dM -E -xc - /dev/null | grep __ELF__),$(shell \ printf 'static int _probe_local;\nint _probe_global;\nint main(void){ return _probe_local + _probe_global; }\n' > .minidbg_probe.c && \ $(CC) -rdynamic .minidbg_probe.c -o .minidbg_probe >/dev/null 2>&1 && \ $(NM) -P .minidbg_probe 2>/dev/null | grep -q '^_probe_local ' && \