[riot-notifications] [RIOT-OS/RIOT] makefiles/toolchain: fallback to 'objdump' (#11547)

Ga√ętan Harter notifications at github.com
Mon May 20 13:52:42 CEST 2019


### Contribution description

When '$(PREFIX)objdump' is not present fallback to 'objdump'.
'objdump' is used when flashing for some boards but the toolchain may
not be installed when building in docker.

If none is found, I fallback to saying 'false' but not sure if it is a
decent solution or not. Maybe just always default to 'objdump' ?

This will allow using 'objdump' in 'cpu/kinetis/dist/check-fcfield-elf.sh'.


### Question

Should the default be `false` or `objdump` which may not be present ?

### Testing procedure

```
BOARD=samr21-xpro make --no-print-directory -C examples/hello-world/ info-debug-variable-OBJDUMP
/opt/gcc-arm-none-eabi-7-2018-q2-update/bin/arm-none-eabi-objdump
```

```
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" BOARD=samr21-xpro make --no-print-directory -C examples/hello-world/ info-debug-variable-OBJDUMP
/bin/sh: 1: arm-none-eabi-gcc: not found
/usr/bin/objdump
```

And another one, that I do not ask to test but review the result more

```
sudo mv /usr/bin/objdump /usr/bin/objdump.save

PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" BOARD=samr21-xpro make --no-print-directory -C examples/hello-world/ info-debug-variable-OBJDUMP
/bin/sh: 1: arm-none-eabi-gcc: not found
false

sudo mv /usr/bin/objdump.save /usr/bin/objdump
```

It also solves the main issue to use `objdump` when flashing `kinetis` boards when `arm-none-eabi-ojbdump` is not present. See main PR https://github.com/RIOT-OS/RIOT/pull/11545

### Issues/PRs references

Part of https://github.com/RIOT-OS/RIOT/pull/11545 to flash kinetis without arm toolchain.
Which is part of https://github.com/RIOT-OS/RIOT/pull/10870 to only use toolchain from docker.
You can view, comment on, or merge this pull request online at:

  https://github.com/RIOT-OS/RIOT/pull/11547

-- Commit Summary --

  * makefiles/toolchain: fallback to 'objdump'

-- File Changes --

    M makefiles/toolchain/gnu.inc.mk (2)
    M makefiles/toolchain/llvm.inc.mk (2)

-- Patch Links --

https://github.com/RIOT-OS/RIOT/pull/11547.patch
https://github.com/RIOT-OS/RIOT/pull/11547.diff

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/11547
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190520/6c64ffe8/attachment.html>


More information about the notifications mailing list