Searched hist:cfc2d7668b18dded0055bed5619710e630ff8a8a (Results 1 – 1 of 1) sorted by relevance
| /rk3399_ARM-atf/make_helpers/ |
| H A D | utilities.mk | cfc2d7668b18dded0055bed5619710e630ff8a8a Tue Nov 11 12:06:13 UTC 2025 Chris Kay <chris.kay@arm.com> fix(build): fix incorrect parentheses expansion in `shell-map`
The previous commit which attempted to fix the expansions in `shell-map` doubled up on the dollar signs for all of the escape substitutions; this "fixed" the Windows build.
However, the expansion of the parentheses is actually still wrong. Consider the following example:
print = $(warning $(1))
$(call shell-map,print,'$$' '$(lparen)' '$(rparen)')
... which prints:
make_helpers/utilities.mk:620: $ make_helpers/utilities.mk:620: ${lparen} make_helpers/utilities.mk:620: ${rparen}
However, what we expect to see is:
make_helpers/utilities.mk:620: $ make_helpers/utilities.mk:620: ( make_helpers/utilities.mk:620: )
The reason we do these substitutions is because, behind the scenes, the function generates a small snippet of Make which calls the map function provided by the user. To do that safely, we need to escape characters which can cause premature expansion (`$`), and any characters which can interfere with the syntax of the `call` function (`(` and `)`).
The shell snippet that we *expected* the example above to generate was:
$(call print,$$,1) $(call print,${lparen},2) $(call print,${rparen},3)
However, as of the last "fix", what it is actually generating is:
$(call print,$$,1) $(call print,$${lparen},2) $(call print,$${rparen},3)
This breaks the Windows build again but that's because this bug was actually three bugs from the start.
Change-Id: Ibaf044806101334ddf4080df8da18f9aac8667e5 Signed-off-by: Chris Kay <chris.kay@arm.com>
|