Open tguenth opened 11 months ago
Hi @tguenth! We appreciate you submitting your first issue for our open-source project. 🌟
Even though I'm a bot, I can assure you that the whole community is genuinely grateful for your time and effort. 🤖💙
Doesn't seem like a bug, the docker image isn't shipped with llvm for arm targets, unless @stephanosio says otherwise
this is not a bug.
you would need a runtime library for cross-compiling to arm.
With llvm, that would be compiler-rt
, however you must build compiler-rt yourself.
For a bit more info as to why this is the case, you may checkout this thread: https://discord.com/channels/636084430946959380/636732781086638081/1144584586387538002
Note, it is planned to create a small doc page on how to compile a basic / bare-metal compiler-rt lib for a simple Zephyr use-case, however distributing a compiler-rt with Zephyr has until recently been challenging due to lack of multilib support in llvm. (multilib support seems to have been included with llvm 18, but I have yet to look into the details and new possibilities)
Changed from bug to enhancement and update title changed to reflect that this is not a bug, but can be considered for enhancement.
this is not a bug.
you would need a runtime library for cross-compiling to arm. With llvm, that would be
compiler-rt
, however you must build compiler-rt yourself. For a bit more info as to why this is the case, you may checkout this thread: https://discord.com/channels/636084430946959380/636732781086638081/1144584586387538002
Thanks for the clarification. Would you mind checking the URL of the discussion on Discord? Unfortunately, I can't see the discussion there, even though I've already joined the zephyrproject discord server.
Note, it is planned to create a small doc page on how to compile a basic / bare-metal compiler-rt lib for a simple Zephyr use-case, however distributing a compiler-rt with Zephyr has until recently been challenging due to lack of multilib support in llvm. (multilib support seems to have been included with llvm 18, but I have yet to look into the details and new possibilities)
Would you mind checking the URL of the discussion on Discord? Unfortunately, I can't see the discussion there, even though I've already joined the zephyrproject discord server.
because the discussion is on the LLVM discord server, not the Zephyr one. For ease, i've copied some of the comments here: From https://discord.com/channels/636084430946959380/636732781086638081/1144584586387538002
carles — 08/25/2023 12:50 PM Hi all, posted this on Discourse before I realized there is a Discord server for LLVM (also, there seems to be no compiler-rt channel so posting it here instead). Is there a reason why there seems to be no binary distribution of the compiler-rt builtins (libclang_rt.builtins-
.a) for all supported architectures? The reason I ask is that clang is a cross-compiler out of the box, but without the builtins one typically cannot link. Is the user expected to build their own copy of the builtins for their target arch? Note: I do realize that the builtins are provided in the default clang/llvm distro, but only for the host arch. tobiashieta — 08/25/2023 2:04 PM @carles
yeah to build the runtime's for a specific target you need to have a copy of the headers for that target.@carles
so maintaining a set of "correct" headers for different platforms not knowing what you want to target is pretty timeconsuming and hard.@carles
so I say it's expected that you'll do that yourself for something that fits your usecase. carles — 08/25/2023 2:14 PM@tobiashieta
thanks for the response. Note that I am talking about a bare metal target here, Linux is just the host. Aren't the headers needed to build the runtime part of the regular LLVM/Clang source distro? tobiashieta — 08/25/2023 2:16 PM@carles
I think the current set of binaries are just a easy way to get into clang / llvm for the mainstream platform it's compiled for. if you want anything more than just a quick start you would need to setup your own compile. Which I recommend in any case to get the highest performance and it targeted specifically for what you need.
Describe the bug Building the hello world sample with llvm toolchain (shipped with docker image zephyrprojectrtos/ci:v0.26.6) breaks on linking.
compilation succeeds until linking
reproduce with following docker file
Expected behavior compilation should pass
Logs and console output