38.10.1. run-toolchain

While you could just manually find/learn the path to toolchain tools, e.g. in LKMC b15a0e455d691afa49f3b813ad9b09394dfb02b7 they are:

./out/buildroot/build/default/aarch64/host/bin/aarch64-buildroot-linux-gnu-gcc userland/c/hello.c
./out/buildroot/build/default/aarch64/host/bin/aarch64-buildroot-linux-gnu-objdump -D a.out

you can save some typing and get portability across directory structure changes with our run-toolchain helper:

./run-toolchain --arch aarch64 gcc -- userland/c/hello.c
./run-toolchain --arch aarch64 objdump -- -D a.out

This plays nicely with getvar e.g. you could disassembly userland/c/hello.c with:

./run-toolchain --arch aarch64 objdump -- -D $(./getvar --arch aarch64 userland_build_dir)/c/hello.out

however disassembly is such a common use case that we have a shortcut for it: disas.

Alternatively, if you just need a variable to feed into your own Build system, you can also use getvar:

./getvar --arch aarch64 toolchain_prefix

which outputs as of LKMC b15a0e455d691afa49f3b813ad9b09394dfb02b7:

/path/to/linux-kernel-module-cheat/out/buildroot/build/default/aarch64/host/usr/bin/aarch64-buildroot-linux-gnu