I've followed the adding a new target rustc-dev guide using a pre-built LLVM. Note that ARC is an experimental LLVM target (like m68k). I'm attempting to compile for the arc-unknown-none-elf target triple. What I've done so far:
Specify pre-built llvm-config path in config.toml.
After running ./x install above I get to the step:
Creating a sysroot for stage1 compiler (use rustup toolchain link 'name' build/host/stage1)
Building stage0 library artifacts (x86_64-unknown-linux-gnu -> arc-unknown-none-elf(arc-unknown-none-elf.json))
It fails due to the error: error: could not create LLVM TargetMachine for triple: arc-unknown-none-elf: No available targets are compatible with triple "arc-unknown-none-elf".
If you don't get an answer here, you may want to ask on the internals forum as well.
There's a bit of overlap, but most of the people on the user forums are end users of Rust, whereas most of the people on the internal forums are working on the language itself. There's also a Zulip server that a lot of the compiler people hang out on.
Thanks for the help.
I added the init_target! macro call and added arc to OPTIONAL_COMPONENTS in rustc_llvm/build.rs.
However after running ./x install I saw that ARC doesn't implement LLVMInitializeARCAsmParser like other ISA's (e.g. LLVMInitializeRISCVAsmParser) After removing the AsmParser from the macro, I got the same error I initially described. Is something like LLVMInitializeARCAsmParser necessary for Rust? Or is it only needed for inline assembly?
Hey @rusty0, I wanted to follow up and ask if you had any idea on how to use an external assembler for rustc and where in the LLVM directory reference's it's discussed.