wg
wg copied to clipboard
Using LLVM C Backend?
Would it be possible to use the LLVM C Backend to generate code for architectures that currently don't have LLVM support, like Xtensa? I've made some PRs there to try to get it to compile rustc's LLVM IR output, so I think it's pretty close to working, at least partially. Is there some reason this wouldn't work? And if it did, how would I add a correct target definition to rustc?
FYI, there's an LLVM Xtensa (WIP) backend: https://github.com/espressif/llvm-xtensa
Inline assembly doesn't work, because the asm! macro parses the assembly as belonging to the current target.
By now, Xtensa support is working quite well (even if still out-of-tree).
As there was no progress on this ticket for years, I suggest closing it as part of 2024 triage.
Patches are slowly being upstreamed for Xtensa too. The current LLVM main branch can even generate Xtensa machine code (it's not yet usable in Rust though).
Closing as LLVM C backend is unlikely to be the answer here.