Skip to content

Commit

Permalink
build: only inspect the first word of toolchain tools
Browse files Browse the repository at this point in the history
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
  • Loading branch information
kevans91 committed Jan 9, 2024
1 parent cef5e56 commit 5d1ecf0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tools/build/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5d1ecf0

Please sign in to comment.