depends: remove workaround for Make older than 4.2.90
What changed, and why it matters
This commit removes a compatibility workaround in Bitcoin Core's build system for older versions of GNU Make (before 4.2.90). It simplifies how the build scripts find compiler and toolchain programs. There is no security issue here; it is a routine cleanup that assumes users building for macOS, FreeBSD, or Windows are now on a newer version of Make.
No security action required. Users building Bitcoin Core dependencies for macOS, FreeBSD, or Windows should ensure their system uses GNU Make 4.2.90 or newer; otherwise the build may fail to locate the correct toolchain.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch replaces invocations of $(shell $(SHELL) $(.SHELLFLAGS) "command -v <tool>") with the simpler $(shell command -v <tool>) in depends/hosts/darwin.mk, depends/hosts/freebsd.mk, and depends/hosts/mingw32.mk. The removed wrapper was a workaround because GNU Make prior to 4.2.90 did not recognize command as a POSIX shell builtin. The commit message states that supported distributions for these cross-compilation targets now ship Make >= 4.2.90, so the workaround is no longer needed.
Changed components
depends/hosts/darwin.mkdepends/hosts/freebsd.mkdepends/hosts/mingw32.mkInspect captured patch +19 / −33
diff --git a/depends/hosts/darwin.mk b/depends/hosts/darwin.mk
index 214bafaf..373ab74e 100644
--- a/depends/hosts/darwin.mk
+++ b/depends/hosts/darwin.mk
@@ -6,22 +6,15 @@ LLD_VERSION=711
OSX_SDK=$(SDK_PATH)/Xcode-$(XCODE_VERSION)-$(XCODE_BUILD_ID)-extracted-SDK-with-libcxx-headers
-# We can't just use $(shell command -v clang) because GNU Make handles builtins
-# in a special way and doesn't know that `command` is a POSIX-standard builtin
-# prior to 1af314465e5dfe3e8baa839a32a72e83c04f26ef, first released in v4.2.90.
-# At the time of writing, GNU Make v4.2.1 is still being used in supported
-# distro releases.
-#
-# Source: https://lists.gnu.org/archive/html/bug-make/2017-11/msg00017.html
-clang_prog=$(shell $(SHELL) $(.SHELLFLAGS) "command -v clang")
-clangxx_prog=$(shell $(SHELL) $(.SHELLFLAGS) "command -v clang++")
+clang_prog=$(shell command -v clang)
+clangxx_prog=$(shell command -v clang++)
-darwin_AR=$(shell $(SHELL) $(.SHELLFLAGS) "command -v llvm-ar")
-darwin_NM=$(shell $(SHELL) $(.SHELLFLAGS) "command -v llvm-nm")
-darwin_OBJCOPY=$(shell $(SHELL) $(.SHELLFLAGS) "command -v llvm-objcopy")
-darwin_OBJDUMP=$(shell $(SHELL) $(.SHELLFLAGS) "command -v llvm-objdump")
-darwin_RANLIB=$(shell $(SHELL) $(.SHELLFLAGS) "command -v llvm-ranlib")
-darwin_STRIP=$(shell $(SHELL) $(.SHELLFLAGS) "command -v llvm-strip")
+darwin_AR=$(shell command -v llvm-ar)
+darwin_NM=$(shell command -v llvm-nm)
+darwin_OBJCOPY=$(shell command -v llvm-objcopy)
+darwin_OBJDUMP=$(shell command -v llvm-objdump)
+darwin_RANLIB=$(shell command -v llvm-ranlib)
+darwin_STRIP=$(shell command -v llvm-strip)
# Flag explanations:
#
diff --git a/depends/hosts/freebsd.mk b/depends/hosts/freebsd.mk
index bcbf2f77..240180f2 100644
--- a/depends/hosts/freebsd.mk
+++ b/depends/hosts/freebsd.mk
@@ -1,22 +1,15 @@
FREEBSD_VERSION ?= 15.0
FREEBSD_SDK=$(SDK_PATH)/freebsd-$(host)-$(FREEBSD_VERSION)/
-# We can't just use $(shell command -v clang) because GNU Make handles builtins
-# in a special way and doesn't know that `command` is a POSIX-standard builtin
-# prior to 1af314465e5dfe3e8baa839a32a72e83c04f26ef, first released in v4.2.90.
-# At the time of writing, GNU Make v4.2.1 is still being used in supported
-# distro releases.
-#
-# Source: https://lists.gnu.org/archive/html/bug-make/2017-11/msg00017.html
-clang_prog=$(shell $(SHELL) $(.SHELLFLAGS) "command -v clang")
-clangxx_prog=$(shell $(SHELL) $(.SHELLFLAGS) "command -v clang++")
-
-freebsd_AR=$(shell $(SHELL) $(.SHELLFLAGS) "command -v llvm-ar")
-freebsd_NM=$(shell $(SHELL) $(.SHELLFLAGS) "command -v llvm-nm")
-freebsd_OBJCOPY=$(shell $(SHELL) $(.SHELLFLAGS) "command -v llvm-objcopy")
-freebsd_OBJDUMP=$(shell $(SHELL) $(.SHELLFLAGS) "command -v llvm-objdump")
-freebsd_RANLIB=$(shell $(SHELL) $(.SHELLFLAGS) "command -v llvm-ranlib")
-freebsd_STRIP=$(shell $(SHELL) $(.SHELLFLAGS) "command -v llvm-strip")
+clang_prog=$(shell command -v clang)
+clangxx_prog=$(shell command -v clang++)
+
+freebsd_AR=$(shell command -v llvm-ar)
+freebsd_NM=$(shell command -v llvm-nm)
+freebsd_OBJCOPY=$(shell command -v llvm-objcopy)
+freebsd_OBJDUMP=$(shell command -v llvm-objdump)
+freebsd_RANLIB=$(shell command -v llvm-ranlib)
+freebsd_STRIP=$(shell command -v llvm-strip)
freebsd_CC=$(clang_prog) --target=$(host) \
diff --git a/depends/hosts/mingw32.mk b/depends/hosts/mingw32.mk
index 7db6afae..d433636f 100644
--- a/depends/hosts/mingw32.mk
+++ b/depends/hosts/mingw32.mk
@@ -1,7 +1,7 @@
-ifneq ($(shell $(SHELL) $(.SHELLFLAGS) "command -v $(host)-gcc-posix"),)
+ifneq ($(shell command -v $(host)-gcc-posix),)
mingw32_CC := $(host)-gcc-posix
endif
-ifneq ($(shell $(SHELL) $(.SHELLFLAGS) "command -v $(host)-g++-posix"),)
+ifneq ($(shell command -v $(host)-g++-posix),)
mingw32_CXX := $(host)-g++-posix
endif
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.