makefiles/toolchain: fix command -v multiple commands#10889
makefiles/toolchain: fix command -v multiple commands#10889jcarrano merged 1 commit intoRIOT-OS:masterfrom
Conversation
`command -v first second third` only works in `bash` and not in `sh`. So replace with multiple calls to `command`. This fixes using `objcopy` when the toolchain `objcopy` is not available.
|
Another update could be to define |
|
Tested on OS X, this is what I get, so... no change compared to master? |
|
We checked IRL, and @emmanuelsearch does not have RIOT/boards/native/Makefile.include Lines 28 to 33 in 782b181 When replacing the last |
smlng
left a comment
There was a problem hiding this comment.
tested, works on macOS too (just to be sure).
Side node: looks like some tools should be queried for in a more central part of the build system than twice (the same) for gcc and llvm.
|
btw. I have |
|
We noticed with @jcarrano while discussing this, that the case from |
Contribution description
command -v first second thirdonly works inbashand not insh.So replace with multiple calls to
command.This fixes using
objcopywhen the toolchainobjcopyis not available.Testing procedure
I found this when building in docker with a machine without toolchain.
If you have your
armtoolchain installed outside of the normal path you can try with the same procedure of changing the PATH.Or use another board you do not have the toolchain for.
With this PR
It fallback to
objcopy:Original behavior is kept:
The
arm-none-eabi-gccerror is unrelated to this PR and I think is related to #10850 and is also present inmaster.Behavior in master
Master does not fallback to
objcopy.Normal behavior was the same
Low level justification
Difference between bash and sh and
makeusesshby default.Issues/PRs references
I notified this in #10870
Follow ups
Other boards/cpus are defining
objcopyand other toolchains in their ownMakefile.includewhen they should be using this one. It also goes for all the compiler variables.