You can currently (unless it has changed) specify the linker to use when calling rustc. I don't have rustc on this box, but I think it is similar to "-C linker=". This doesn't work with cargo at the moment, you can only really specify the target and then use that JSON to specify the target in more detail.
Yes. As long as your target is supported by LLVM, the linker is the only external build tool required to get a binary. You also need a compatible libc and either libgcc or libcompiler-rt built for your target to provide some stubs. On 16 October 2014 15:35, Cody P Schafer <[email protected]> wrote: > On Thu, Oct 16, 2014 at 3:54 PM, Ilya Dmitrichenko > <[email protected]> wrote: > > Thanks Ben, I was just about to reply with the link: > > https://github.com/rust-lang/rust/pull/16156/ > > > > Cody, you are welcome to test out the branch, as you are to compile rust > > with OE anyway ;) > > > > On 16 Oct 2014 20:52, "Ben Harris" <[email protected]> wrote: > >> > >> This will be available very soon. There is a pull request in the final > >> stages of review that will allow you to define custom targets with > custom > >> linkers, link args, PIC options, etc. > >> > >> That is for building binaries using rustc. I'm not sure what the > solution > >> would be for building rustc itself. > > Looks promising. A few questions: > > - In my case I have what is essentially a supported platform but needs > to select a set of build tools with a different prefix. From looking > at the current diff of that pr, it appears I'll need to create a json > file that copies a bunch of values I don't really care about from an > existing target (with no automated way of extracting that json from > the existing target) just to change the value of the linker. > > - Is the linker ("cc", presently) the only target build tool needed > when building the cross compiler? > > I suppose the other piece of this is how well cargo handles cross > compiling things and what target tools it needs. >
_______________________________________________ Rust-dev mailing list [email protected] https://mail.mozilla.org/listinfo/rust-dev
