wg icon indicating copy to clipboard operation
wg copied to clipboard

Using LLVM C Backend?

Open sapir opened this issue 6 years ago • 2 comments
trafficstars

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?

sapir avatar Jul 05 '19 12:07 sapir

FYI, there's an LLVM Xtensa (WIP) backend: https://github.com/espressif/llvm-xtensa

tarcieri avatar Jul 05 '19 14:07 tarcieri

Inline assembly doesn't work, because the asm! macro parses the assembly as belonging to the current target.

sapir avatar Jul 13 '19 19:07 sapir

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.

jannic avatar Jun 11 '24 19:06 jannic

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.

MabezDev avatar Jun 11 '24 19:06 MabezDev