diff options
author | Kyle Evans <kevans@FreeBSD.org> | 2024-01-09 04:21:36 +0000 |
---|---|---|
committer | Kyle Evans <kevans@FreeBSD.org> | 2024-01-09 04:22:25 +0000 |
commit | 5d1ecf0b6184748a51bca01b497c808c3e13aa67 (patch) | |
tree | bf17d8eff8c8390c003d5e902a8ea3f23c897b03 | |
parent | cef5e56f3fea33d6c421276af49f2967453ad4ff (diff) | |
download | src-5d1ecf0b6184748a51bca01b497c808c3e13aa67.tar.gz src-5d1ecf0b6184748a51bca01b497c808c3e13aa67.zip |
build: only inspect the first word of toolchain tools
CC/CXX/CPP/LD may all have arguments supplied in various circumstances,
which break the logic here. We only need to determine which of these
tools we're expecting to invoke from PATH, which just requires
examination of the first word. Limit our scope to exactly that.
Patch suggested by: jrtc27
Reviewed by: imp, jrtc27
Differential Revision: https://reviews.freebsd.org/D43372
-rw-r--r-- | tools/build/Makefile | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/build/Makefile b/tools/build/Makefile index 187d5593564d..e60c8694d56d 100644 --- a/tools/build/Makefile +++ b/tools/build/Makefile @@ -370,9 +370,9 @@ _WRAP_HOST_TOOL= ${_LINK_HOST_TOOL} .endif .for var in CC CXX CPP LD .for X in $${_empty_var_} X -.if !empty(${X}${var}) && !${${X}${var}:M/*} && \ - !${_toolchain_tools_to_symlink:U:M${${X}${var}}} -_toolchain_tools_to_symlink+= ${${X}${var}} +.if !empty(${X}${var}) && !${${X}${var}:[1]:M/*} && \ + !${_toolchain_tools_to_symlink:U:M${${X}${var}:[1]}} +_toolchain_tools_to_symlink+= ${${X}${var}:[1]} .endif .endfor .endfor |