Skip to content

How to run the toolchain binaries use bazel run @bazel_embedded//toolchains/..... #54

Answered by nathaniel-brough
cbrune asked this question in Q&A
Discussion options

You must be logged in to vote

All the tools downloaded as part of gcc-arm-none are exported and available under the target;

@com_gcc_arm_none_eabi_compiler//:bin/arm-none-eabi-*

So you could put together a quick prototype to build something using objdump like so (untested);

genrule(
    name = "my_elf_symbols",
    srcs = [":my_elf"],
    outs = ["my_elf_symbols.txt"],
    cmd = "./$(location @com_gcc_arm_none_eabi_compiler//:bin/arm-none-eabi-objdump) -TC $(location :my_elf) > $@",
    tools = ["@com_gcc_arm_none_eabi_compiler//:bin/arm-none-eabi-objdump"],
)

If you are after something more sophisticated you might consider building some custom rules.

You can also run those binaries directly e.g.

bazel run @com_gcc_ar…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@cbrune
Comment options

Answer selected by cbrune
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants