kbuild: dtc: use env to resolve echo
PATCH 1/1 kbuild: dtc: use env to resolve echo
Posix does not mandate to have binaries within a certain path, but rather that the utilities may be available. Use env to resolve and call echo from PATH.
--- scripts/Makefile.lib | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/Makefile.lib +1 -1
@@ -340,7 +340,7 @@ dts-frags = $(subst $(quote),,$(CONFIG_EXTERNAL_DTS_FRAGMENTS)) quiet_cmd_dtc = DTC $@ # For compatibility between make 4.2 and 4.3 H := \# -cmd_dtc = /bin/echo -e '$(H)define $(subst -,_,$(*F))_dts 1\n'$(foreach f,$< $(dts-frags),'$(H)include "$(f)"\n') | \ +cmd_dtc = /usr/bin/env echo -e '$(H)define $(subst -,_,$(*F))_dts 1\n'$(foreach f,$< $(dts-frags),'$(H)include "$(f)"') | \ $(CPP) $(dtc_cpp_flags) -x assembler-with-cpp -o $(dtc-tmp) - ; \ $(objtree)/scripts/dtc/dtc -O dtb -o $@ -b 0 \ -i $(srctree)/arch/$(SRCARCH)/dts $(DTC_FLAGS) \
Signature · 7 lines
2.34.1 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
There's another in scripts/Kbuild.include
Quoted 29 lines · Rouven Czerwinski
Posix does not mandate to have binaries within a certain path, but rather that the utilities may be available. Use env to resolve and call echo from PATH.
Fixes 2ae7ac7ab2f1 ("kbuild: dtc: Allow adding device tree fragments via config")Signed-off-by Rouven Czerwinski <[email protected]>--- scripts/Makefile.lib | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)scripts/Makefile.lib +1
-2@@ -340,7 +340,7 @@ dts-frags = $(subst $(quote),,$(CONFIG_EXTERNAL_DTS_FRAGMENTS)) quiet_cmd_dtc = DTC $@ # For compatibility between make 4.2 and 4.3 H := \# -cmd_dtc = /bin/echo -e '$(H)define $(subst -,_,$(*F))_dts 1\n'$(foreach f,$< $(dts-frags),'$(H)include "$(f)"\n') | \ +cmd_dtc = /usr/bin/env echo -e '$(H)define $(subst -,_,$(*F))_dts 1\n'$(foreach f,$< $(dts-frags),'$(H)include "$(f)"') | \ $(CPP) $(dtc_cpp_flags) -x assembler-with-cpp -o $(dtc-tmp) - ; \ $(objtree)/scripts/dtc/dtc -O dtb -o $@ -b 0 \ -i $(srctree)/arch/$(SRCARCH)/dts $(DTC_FLAGS) \ --2.34.1
Quoted 4 lines
_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
Hi Trent,
Quoted 1 line · Trent Piepho
There's another in
scripts/Kbuild.include
Yep, I have a patch for that as well. We haven't hit this since as- instr isn't used anywhere within barebox.
- rcz
_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
Quoted 16 lines · Rouven Czerwinski
Posix does not mandate to have binaries within a certain path, but rather that the utilities may be available. Use env to resolve and call echo from PATH.
Fixes 2ae7ac7ab2f1 ("kbuild: dtc: Allow adding device tree fragments via config")Signed-off-by Rouven Czerwinski <[email protected]>--- scripts/Makefile.lib | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)scripts/Makefile.lib +0
-0
scripts/Makefile.lib dts-frags = $(subst $(quote),,$(CONFIG_EXTERNAL_DTS_FRAGMENTS)) · line 343
Quoted 4 lines
scripts/Makefile.lib +0
-1@@ -340,7 +340,7 @@ dts-frags = $(subst $(quote),,$(CONFIG_EXTERNAL_DTS_FRAGMENTS)) quiet_cmd_dtc = DTC $@ # For compatibility between make 4.2 and 4.3 H := \# -cmd_dtc = /bin/echo -e '$(H)define $(subst -,_,$(*F))_dts 1\n'$(foreach f,$< $(dts-frags),'$(H)include "$(f)"\n') | \
Why hardcode /bin/echo anyway and not use plain 'echo' instead. I assume because echo can be a shell builtin, but are there shells out there where the builtin is not enough?
Sascha
Signature · 9 lines
Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
Quoted 12 lines · Sascha Hauer
Quoted 11 lines · Rouven Czerwinski
Posix does not mandate to have binaries within a certain path, but rather that the utilities may be available. Use env to resolve and call echo from PATH.
Fixes 2ae7ac7ab2f1 ("kbuild: dtc: Allow adding device tree fragments via config")Signed-off-by Rouven Czerwinski <[email protected]>--- scripts/Makefile.lib | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 13 lines
scripts/Makefile.lib dts-frags = $(subst $(quote),,$(CONFIG_EXTERNAL_DTS_FRAGMENTS)) · line 343
Quoted 9 lines
scripts/Makefile.lib +0
-1@@ -340,7 +340,7 @@ dts-frags = $(subst $(quote),,$(CONFIG_EXTERNAL_DTS_FRAGMENTS)) quiet_cmd_dtc = DTC $@ # For compatibility between make 4.2 and 4.3 H := \# -cmd_dtc = /bin/echo -e '$(H)define $(subst -,_,$(*F))_dts 1\n'$(foreach f,$< $(dts-frags),'$(H)include "$(f)"\n') | \Why hardcode
/bin/echoanyway and not use plain 'echo' instead. I assume because echo can be a shell builtin, but are there shells out there where the builtin is not enough?
The builtin echo implementations are not very compatible. Better use printf instead. For example, echo from dash (the default /bin/sh in Debian) does not support '-e'.
Michael
Signature · 9 lines
Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
Sascha Hauer
AppliedQuoted 10 lines · Rouven Czerwinski
Posix does not mandate to have binaries within a certain path, but rather that the utilities may be available. Use env to resolve and call echo from PATH.
Fixes 2ae7ac7ab2f1 ("kbuild: dtc: Allow adding device tree fragments via config")Signed-off-by Rouven Czerwinski <[email protected]>--- scripts/Makefile.lib | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Applied, thanks
Sascha
Signature · 9 lines
Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox