You should be able to assemble standalone objects for any triple
through rustc itself, you'll likely have to specify a different linker
or assembler though:

    rustc foo.rs --target arm-non-linux-gnueabi \
        -C linker=arm-non-linux-gnueabi-ld \
        -C ar=arm-non-linux-gnueabi-ar

As you discovered, you can pass through arguments to LLVM via the "-C
llvm-args=foo" command line option to rustc. If you get complaints
that it's an unknown command line argument, it's LLVM telling you
those complaints, not rustc.

On Sun, Mar 23, 2014 at 8:54 AM, Vladimir Pouzanov <farcal...@gmail.com> wrote:
> I'm trying to experiment with rust and some embedded code. Currently I have
> to do a three-pass compilation:
>
> rustc --target arm-linux-eabi -O --emit bc main.rs -o main.bc
> llc -mtriple arm-none-eabi -march=thumb -mcpu=cortex-m0 main.bc -o main.s
> arm-none-linux-gnueabi-as main.s -o main.o
>
> First, I'm not sure how relevant is --target flag for rustc. I seems to
> change target datalayout/triple in generated bc, but that should be
> overriden by llc -mtriple anyway, right?
>
> Second, I can pass -Ctarget-cpu=cortex-m0, but I cannot pass down
> -march=thumb, tried this way: -Cllvm-args='--march=thumb', failed with
> "rustc: Unknown command line argument '--march=thumb'".
>
> Any hints on how can I drop explicit llc and as steps here?
>
> --
> Sincerely,
> Vladimir "Farcaller" Pouzanov
> http://farcaller.net/
>
> _______________________________________________
> Rust-dev mailing list
> Rust-dev@mozilla.org
> https://mail.mozilla.org/listinfo/rust-dev
>
_______________________________________________
Rust-dev mailing list
Rust-dev@mozilla.org
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to