Hi Chris,
On 11/1/24 1:00 PM, Chris Kay wrote:
Hi Quentin,
To allow the usual multi-toolchain mechanisms to kick in for the M0 toolchain you’ll need to add `rk3399-m0-{as,cc,ld,..}-parameter` variables to `make_helpers/toolchains/rk3399-m0.mk`, a la:
diff --git a/make_helpers/toolchains/rk3399-m0.mk b/make_helpers/toolchains/rk3399-m0.mk index 3a7f173a3..c9902b955 100644 --- a/make_helpers/toolchains/rk3399-m0.mk +++ b/make_helpers/toolchains/rk3399-m0.mk @@ -6,24 +6,31 @@ rk3399-m0-name := RK3399 M0 +rk3399-m0-cc-parameter := M0_CC rk3399-m0-cc-default-id := gnu-gcc rk3399-m0-cc-default := $(or $(M0_CROSS_COMPILE),arm-none-eabi-)gcc +rk3399-m0-cpp-parameter := M0_CPP rk3399-m0-cpp-default-id := gnu-gcc rk3399-m0-cpp-default := $(or $(M0_CROSS_COMPILE),arm-none-eabi-)gcc +rk3399-m0-as-parameter := M0_AS rk3399-m0-as-default-id := gnu-gcc rk3399-m0-as-default := $(or $(M0_CROSS_COMPILE),arm-none-eabi-)gcc +rk3399-m0-ld-parameter := M0_LD rk3399-m0-ld-default-id := gnu-gcc rk3399-m0-ld-default := $(or $(M0_CROSS_COMPILE),arm-none-eabi-)gcc +rk3399-m0-oc-parameter := M0_OC rk3399-m0-oc-default-id := gnu-objcopy rk3399-m0-oc-default := $(or $(M0_CROSS_COMPILE),arm-none-eabi-)objcopy +rk3399-m0-od-parameter := M0_OD rk3399-m0-od-default-id := gnu-objdump rk3399-m0-od-default := $(or $(M0_CROSS_COMPILE),arm-none-eabi-)objdump +rk3399-m0-ar-parameter := M0_AR rk3399-m0-ar-default-id := gnu-ar rk3399-m0-ar-default := $(or $(M0_CROSS_COMPILE),arm-none-eabi-)gcc-ar
Ah, nice... though I basically end up needing to reimplement all the compiler and linker checks we have in the top Makefile for LLVM/clang-specific options vs GCC-specific ones. It'd be nice if we could move some of those in some make_helpers maybe?
Seems like a big rework though, so I'm fine with "too much work for this one SoC with a peculiar setup". To come clean, I don't use clang for compiling this piece of software but some people using meta-rockchip Yocto layer do, and I hate having -dirty in my version number because of local patches to fix clang support, hence why I pushed most commits for reviews and fixing the warnings I could.
Thanks a lot for the help!
Cheers, Quentin