LLVM-embedded-toolchain-for-Arm icon indicating copy to clipboard operation
LLVM-embedded-toolchain-for-Arm copied to clipboard

Support Zephyr Project as an ARM official toolchain

Open andy0808 opened this issue 3 years ago • 3 comments

Zephyr Project is becoming more and more popular in the RTOS area. For ARM Cortex architecture, they have their own toolchain/SDK based on GCC. And the ARM maintained arm-none-eabi-gcc also works perfectly with this project.

They have discussed supporting LLVM a few years ago, but seems there's not any progress yet! I think the main reason is that there's no official LLVM toolchain maintained for ARM Cortex before.

Since you are supporting LLVM officially, is there any schedule to support these modern RTOS? Thank you : )

I think combining LLVM + modern RTOS makes it easier to use modern languages on microcontrollers such as Rust and Swift, they both are based on LLVM : ) This would help application development on microcontrollers a lot!

andy0808 avatar Nov 24 '21 03:11 andy0808

I think you could compile Rust code as a library by suitably declaring the exported interface (no name mangling and extern "C") and include that to your application using ExternalProject, maybe add some scripts to export C headers for the library for convenience. Having a binary crate as the cross-compiled application might be a lot trickier, but nice. There's also https://github.com/SiegeLord/RustCMake which doesn't seem to be maintained, but might serve as a starting point for something.

lindblandro avatar Jan 23 '22 11:01 lindblandro

@lindblandro, I think that is one way to do it, but brings in one issue. cross-language LTO won't be possible. I myself found LTO can save space quite a bit in the final binary and can also improve speeds quite a bit. Having LLVM directly support will improve on that.

adityashah1212 avatar Jul 21 '23 20:07 adityashah1212

I noticed this issue https://github.com/zephyrproject-rtos/zephyr/issues/54826 in Zephyr project that refers to LLVMEmbeddedToolchainForArm-15.0.2, however seems to be stale by now.

voltur01 avatar Jul 24 '23 08:07 voltur01