Questions regarding adding a new llvm based cross-compiler


Cody P Schafer <dev@...>
 

Hi all,

I'm working on creating a layer for the rust compiler (which uses
llvm) and was wondering if there were any best practices and/or
examples people could point me at.

The compiler is designed to be built for multiple targets at once
(unlike the gcc model of having a single compiler build for each
target).

Q: Does this mean that I don't need to create a '-cross' package? (And
just use '-native'?)
Q: What about a -runtime package? Will one be needed? (The compiler
can build runtime libs for multiple targets, so a '-native' could
include the target runtime libs).

Thanks
--
Cody


Paul Barker <paul@...>
 

On 16 October 2014 18:46, Cody P Schafer <dev@...> wrote:
Hi all,

I'm working on creating a layer for the rust compiler (which uses
llvm) and was wondering if there were any best practices and/or
examples people could point me at.
I can't really offer much help on the LLVM side, but I can say this
will be really useful work. I'm slowly learning Rust and researching
how it can be used for embedded development and it will be excellent
to have a rust compiler working as part of OpenEmbedded/Yocto.

If you need any testing of this layer once it's created, just let me know.

Cheers,

--
Paul Barker

Email: paul@...
http://www.paulbarker.me.uk


Martin Jansa
 

On Fri, Oct 17, 2014 at 09:07:19AM +0100, Paul Barker wrote:
On 16 October 2014 18:46, Cody P Schafer <dev@...> wrote:
Hi all,

I'm working on creating a layer for the rust compiler (which uses
llvm) and was wondering if there were any best practices and/or
examples people could point me at.
Are you using llvm recipes from meta-oe (or at least starting from
them)?

I can't really offer much help on the LLVM side, but I can say this
will be really useful work. I'm slowly learning Rust and researching
how it can be used for embedded development and it will be excellent
to have a rust compiler working as part of OpenEmbedded/Yocto.

If you need any testing of this layer once it's created, just let me know.
I'm also interested.

I haven't tried it yet, but I've asked Servo developer, how they do
cross-builds and he said that it's really simple with Rust and Cargo,
which support cross-compilation by design.

Now reading:
http://doc.crates.io/faq.html#does-cargo-handle-multi-platform-projects-or-cross-compilation?
it doesn't looks so convincing, but I would be happy to test.

Regards,
--
Martin 'JaMa' Jansa jabber: Martin.Jansa@...


Khem Raj
 



On Friday, October 17, 2014, Paul Barker <paul@...> wrote:
On 16 October 2014 18:46, Cody P Schafer <dev@...> wrote:
> Hi all,
>
> I'm working on creating a layer for the rust compiler (which uses
> llvm) and was wondering if there were any best practices and/or
> examples people could point me at.

I can't really offer much help on the LLVM side, but I can say this
will be really useful work. I'm slowly learning Rust and researching
how it can be used for embedded development and it will be excellent
to have a rust compiler working as part of OpenEmbedded/Yocto.

If you need any testing of this layer once it's created, just let me know.

I have started to integrate clang into oe
Which probably is quitquite similar to this effortwise. Its very prelimpreliminary. Check my github repo. I should add it to layer index 

Cheers,

--
Paul Barker

Email: paul@...
http://www.paulbarker.me.uk
--
_______________________________________________
yocto mailing list
yocto@...
https://lists.yoctoproject.org/listinfo/yocto


Cody P Schafer <dev@...>
 

On Fri, Oct 17, 2014 at 1:48 PM, Martin Jansa <martin.jansa@...> wrote:
On Fri, Oct 17, 2014 at 09:07:19AM +0100, Paul Barker wrote:
On 16 October 2014 18:46, Cody P Schafer <dev@...> wrote:
Hi all,

I'm working on creating a layer for the rust compiler (which uses
llvm) and was wondering if there were any best practices and/or
examples people could point me at.
Are you using llvm recipes from meta-oe (or at least starting from
them)?
I wasn't. Rust packages a particular llvm version already (and ties it
into it's build scripts). I'm planning on just using that one.

I haven't tried it yet, but I've asked Servo developer, how they do
cross-builds and he said that it's really simple with Rust and Cargo,
which support cross-compilation by design.
Well:

From what I've found, crossbuilds work fine if you're using one of a
small set of blessed triples (ie: not arm-poky-linux-gnueabi, but
arm-unknown-linux-gnueabihf), and you don't set any special
CFLAGS/LDFLAGS variables (which oe does).
And the infrastructure is not in place to allow packagers to easily
add/use different triples and "linkers" (rustc calls gcc/cc to link
it's programs, and as a result needs to know where it is).


Cody P Schafer <dev@...>
 

On Sun, Oct 19, 2014 at 4:10 AM, Khem Raj <raj.khem@...> wrote:
[...]
I have started to integrate clang into oe
Which probably is quitquite similar to this effortwise. Its very
prelimpreliminary. Check my github repo. I should add it to layer index
(repo link for the interested: https://github.com/kraj/meta-clang)

Khem: the complication for me is rustc doesn't magically build for all
targets it supports (at the moment) when using gcc as the
compiler/linker (rustc calls an external binary, typically gcc or cc
to link it's code). As a result, I can't just build for -native. I'm
currently fighting with cross.bbclass to convince it to do what I
want.