Re: [rust-dev] Rust (Servo) Cross-Compile to ARM

2014-06-08 Thread Skirmantas Kligys
On Sun, Jun 8, 2014 at 3:10 PM, Corey Richardson  wrote:
> You need to change the target, not just the target-cpu. `rustc
> --target arm-unknown-linux-gnueabihf ...`

Oh, apparently it built a compiler and a cross-compiler in the same
binary.  That was unexpected.

For the record, this is the correct way to compile:

rustc --target arm-unknown-linux-gnueabihf -C
linker=arm-linux-gnueabihf-g++ hello.rs

Thanks for help!


> On Sun, Jun 8, 2014 at 2:57 PM, Skirmantas Kligys
>  wrote:
>> Luqman Aden  writes:
>>>
>>> Building a Rust cross compiler that can target arm isn't too hard. You
>> just need the right toolchain installed. I personally use Debian with the
>> gcc-4.7-arm-linux-gnueabi package from the Emdebian repo. (I believe Ubuntu
>> and other distros have similar packages). From there it's just a simple
>> matter of passing the right triple to the configure script.
>>>
>>> ./configure --target=arm-unknown-linux-gnueabi && make
>>>
>>> That'll build a rustc that can target arm as well as all the libraries.
>> Then you can run it like so:
>>>
>>> rustc --target=arm-unknown-linux-gnueabi --linker=arm-linux-gnueabi-gcc
>> hello.rs
>>>
>>> That'll give you a binary, hello, which will run on arm/linux. So, that's
>> the basic gist of it.
>>
>> I am trying to follow these instructions and also
>>
>> https://gist.github.com/amatus/6665852
>>
>> unsuccessfully.
>>
>> export PATH=$PWD/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-
>> x64/bin:$PATH
>> cd rust
>> ./configure --prefix=/usr/local/stow/rust-pi-20140608 --target=arm-unknown-
>> linux-gnueabihf
>> make -j2
>> sudo make install
>>
>> cfg: build triple x86_64-unknown-linux-gnu
>> cfg: host triples x86_64-unknown-linux-gnu
>> cfg: target triples x86_64-unknown-linux-gnu arm-unknown-linux-gnueabihf
>> cfg: non-build target triples arm-unknown-linux-gnueabihf
>> cfg: enabling more debugging (CFG_ENABLE_DEBUG)
>> cfg: host for x86_64-unknown-linux-gnu is x86_64
>> cfg: host for arm-unknown-linux-gnueabihf is arm
>> cfg: os for x86_64-unknown-linux-gnu is unknown-linux-gnu
>> cfg: os for arm-unknown-linux-gnueabihf is unknown-linux-gnueabihf
>> cfg: using CC=gcc (CFG_CC)
>> cfg: no pdflatex found, deferring to xelatex
>> cfg: no xelatex found, deferring to lualatex
>> cfg: no lualatex found, disabling LaTeX docs
>> cfg: no pandoc found, omitting PDF and EPUB docs
>> cfg: no llnextgen found, omitting grammar-verification
>> ...
>>
>> A rustc gets built, but it targets Intel:
>>
>>  $ rustc -C target-cpu=help hello.rs
>> Available CPUs for this target:
>>
>>   amdfam10  - Select the amdfam10 processor.
>>   athlon- Select the athlon processor.
>>   athlon-4  - Select the athlon-4 processor.
>>   athlon-fx - Select the athlon-fx processor.
>>   athlon-mp - Select the athlon-mp processor.
>>   athlon-tbird  - Select the athlon-tbird processor.
>>   athlon-xp - Select the athlon-xp processor.
>>   athlon64  - Select the athlon64 processor.
>>   athlon64-sse3 - Select the athlon64-sse3 processor.
>> ...
>>
>> Any ideas?
>>
>> ___
>> Rust-dev mailing list
>> Rust-dev@mozilla.org
>> https://mail.mozilla.org/listinfo/rust-dev
>
>
>
> --
> http://octayn.net/
___
Rust-dev mailing list
Rust-dev@mozilla.org
https://mail.mozilla.org/listinfo/rust-dev


Re: [rust-dev] Rust (Servo) Cross-Compile to ARM

2014-06-08 Thread Corey Richardson
You need to change the target, not just the target-cpu. `rustc
--target arm-unknown-linux-gnueabihf ...`

On Sun, Jun 8, 2014 at 2:57 PM, Skirmantas Kligys
 wrote:
> Luqman Aden  writes:
>>
>> Building a Rust cross compiler that can target arm isn't too hard. You
> just need the right toolchain installed. I personally use Debian with the
> gcc-4.7-arm-linux-gnueabi package from the Emdebian repo. (I believe Ubuntu
> and other distros have similar packages). From there it's just a simple
> matter of passing the right triple to the configure script.
>>
>> ./configure --target=arm-unknown-linux-gnueabi && make
>>
>> That'll build a rustc that can target arm as well as all the libraries.
> Then you can run it like so:
>>
>> rustc --target=arm-unknown-linux-gnueabi --linker=arm-linux-gnueabi-gcc
> hello.rs
>>
>> That'll give you a binary, hello, which will run on arm/linux. So, that's
> the basic gist of it.
>
> I am trying to follow these instructions and also
>
> https://gist.github.com/amatus/6665852
>
> unsuccessfully.
>
> export PATH=$PWD/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-
> x64/bin:$PATH
> cd rust
> ./configure --prefix=/usr/local/stow/rust-pi-20140608 --target=arm-unknown-
> linux-gnueabihf
> make -j2
> sudo make install
>
> cfg: build triple x86_64-unknown-linux-gnu
> cfg: host triples x86_64-unknown-linux-gnu
> cfg: target triples x86_64-unknown-linux-gnu arm-unknown-linux-gnueabihf
> cfg: non-build target triples arm-unknown-linux-gnueabihf
> cfg: enabling more debugging (CFG_ENABLE_DEBUG)
> cfg: host for x86_64-unknown-linux-gnu is x86_64
> cfg: host for arm-unknown-linux-gnueabihf is arm
> cfg: os for x86_64-unknown-linux-gnu is unknown-linux-gnu
> cfg: os for arm-unknown-linux-gnueabihf is unknown-linux-gnueabihf
> cfg: using CC=gcc (CFG_CC)
> cfg: no pdflatex found, deferring to xelatex
> cfg: no xelatex found, deferring to lualatex
> cfg: no lualatex found, disabling LaTeX docs
> cfg: no pandoc found, omitting PDF and EPUB docs
> cfg: no llnextgen found, omitting grammar-verification
> ...
>
> A rustc gets built, but it targets Intel:
>
>  $ rustc -C target-cpu=help hello.rs
> Available CPUs for this target:
>
>   amdfam10  - Select the amdfam10 processor.
>   athlon- Select the athlon processor.
>   athlon-4  - Select the athlon-4 processor.
>   athlon-fx - Select the athlon-fx processor.
>   athlon-mp - Select the athlon-mp processor.
>   athlon-tbird  - Select the athlon-tbird processor.
>   athlon-xp - Select the athlon-xp processor.
>   athlon64  - Select the athlon64 processor.
>   athlon64-sse3 - Select the athlon64-sse3 processor.
> ...
>
> Any ideas?
>
> ___
> Rust-dev mailing list
> Rust-dev@mozilla.org
> https://mail.mozilla.org/listinfo/rust-dev



-- 
http://octayn.net/
___
Rust-dev mailing list
Rust-dev@mozilla.org
https://mail.mozilla.org/listinfo/rust-dev


Re: [rust-dev] Rust (Servo) Cross-Compile to ARM

2014-06-08 Thread Skirmantas Kligys
Luqman Aden  writes:
> 
> Building a Rust cross compiler that can target arm isn't too hard. You 
just need the right toolchain installed. I personally use Debian with the 
gcc-4.7-arm-linux-gnueabi package from the Emdebian repo. (I believe Ubuntu 
and other distros have similar packages). From there it's just a simple 
matter of passing the right triple to the configure script.
> 
> ./configure --target=arm-unknown-linux-gnueabi && make
> 
> That'll build a rustc that can target arm as well as all the libraries. 
Then you can run it like so:
> 
> rustc --target=arm-unknown-linux-gnueabi --linker=arm-linux-gnueabi-gcc 
hello.rs
> 
> That'll give you a binary, hello, which will run on arm/linux. So, that's 
the basic gist of it.

I am trying to follow these instructions and also

https://gist.github.com/amatus/6665852

unsuccessfully.

export PATH=$PWD/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-
x64/bin:$PATH
cd rust
./configure --prefix=/usr/local/stow/rust-pi-20140608 --target=arm-unknown-
linux-gnueabihf
make -j2
sudo make install

cfg: build triple x86_64-unknown-linux-gnu
cfg: host triples x86_64-unknown-linux-gnu
cfg: target triples x86_64-unknown-linux-gnu arm-unknown-linux-gnueabihf
cfg: non-build target triples arm-unknown-linux-gnueabihf
cfg: enabling more debugging (CFG_ENABLE_DEBUG)
cfg: host for x86_64-unknown-linux-gnu is x86_64
cfg: host for arm-unknown-linux-gnueabihf is arm
cfg: os for x86_64-unknown-linux-gnu is unknown-linux-gnu
cfg: os for arm-unknown-linux-gnueabihf is unknown-linux-gnueabihf
cfg: using CC=gcc (CFG_CC)
cfg: no pdflatex found, deferring to xelatex
cfg: no xelatex found, deferring to lualatex
cfg: no lualatex found, disabling LaTeX docs
cfg: no pandoc found, omitting PDF and EPUB docs
cfg: no llnextgen found, omitting grammar-verification
...

A rustc gets built, but it targets Intel:

 $ rustc -C target-cpu=help hello.rs
Available CPUs for this target:

  amdfam10  - Select the amdfam10 processor.
  athlon- Select the athlon processor.
  athlon-4  - Select the athlon-4 processor.
  athlon-fx - Select the athlon-fx processor.
  athlon-mp - Select the athlon-mp processor.
  athlon-tbird  - Select the athlon-tbird processor.
  athlon-xp - Select the athlon-xp processor.
  athlon64  - Select the athlon64 processor.
  athlon64-sse3 - Select the athlon64-sse3 processor.
...

Any ideas?

___
Rust-dev mailing list
Rust-dev@mozilla.org
https://mail.mozilla.org/listinfo/rust-dev


Re: [rust-dev] Rust (Servo) Cross-Compile to ARM

2014-02-12 Thread Edit Balint

Dear Rust Developers,

Yesterday I tried to Compile Rust on a Panda board with Ubuntu 12.04.
I reused Luqman's Rust binary (armhf), but I got the following error:

compile_and_link: 
arm-unknown-linux-gnu/stage0/lib/rustc/arm-unknown-linux-gnu/lib/libstd.so
arm-unknown-linux-gnu/stage0/bin/rustc: error while loading shared 
libraries: libgreen-83b1c0e5-0.9.so: cannot open shared object file: No 
such file or directory
make: *** 
[arm-unknown-linux-gnu/stage0/lib/rustc/arm-unknown-linux-gnu/lib/libstd.so] 
Error 127


Then I copied this lib from the Luqman's Rust libs to this folder: 
arm-unknown-linux-gnu/stage0/lib/. After that a new error came:


cp: 
arm-unknown-linux-gnu/stage0/lib/rustc/arm-unknown-linux-gnu/lib/librustrt.a
compile_and_link: 
arm-unknown-linux-gnu/stage0/lib/rustc/arm-unknown-linux-gnu/lib/libstd.so
/home/ebalint/Work/rust_servo_version_cross/rust/src/libstd/managed.rs:36:26: 
36:29 error: found `mut` in ident position
/home/ebalint/Work/rust_servo_version_cross/rust/src/libstd/managed.rs:36 pub 
fn mut_ptr_eq(a: @mut T, b: @mut T) -> bool {

^~~
/home/ebalint/Work/rust_servo_version_cross/rust/src/libstd/managed.rs:36:30: 
36:31 error: expected `,` but found `T`
/home/ebalint/Work/rust_servo_version_cross/rust/src/libstd/managed.rs:36 pub 
fn mut_ptr_eq(a: @mut T, b: @mut T) -> bool {

^
task 'rustc' failed at 'explicit failure', 
/scratch/laden/rust/src/libsyntax/diagnostic.rs:41
task '' failed at 'explicit failure', 
/scratch/laden/rust/src/librustc/lib.rs:448
make: *** 
[arm-unknown-linux-gnu/stage0/lib/rustc/arm-unknown-linux-gnu/lib/libstd.so] 
Error 101



Can you write me how you did the compiling on your RK3188?

Thank you,
Best Regards:
Edit


On 2014-02-11 17:25, Edit Balint wrote:

Dear Rust Developers,
Thank you for your answers.

Cross-compiling Rust HelloWorld to ARM was working fine.

Passing --target-triples=arm-unknown-linux-gnueabihf to the servo 
configure script wasn't working. The result servo binary was x86-64.


Today I'm going to try to compile Rust on ARM platform, reusing 
Luqman's compiled binaries as a snapshot.


Best Regards,

Edit

On 2014-02-06 18:06, Simon Sapin wrote:

On 06/02/2014 16:30, Edit Balint wrote:

Dear Rust Developers!

My name is Edit Balint, I'm a software developer at University of
Szeged, Hungary.
We have a research project regarding Servo and Rust.
Our main goal is to cross-compile and run Rust and Servo on ARM Linux
(not  Android).
We have several issues with the cross-compiling procedure. Is there any
guide how to achieve this?


Although you’re not using Android, this

https://github.com/mozilla/servo/wiki/Building-for-Android#wiki-build-servo 



suggests that you need to pass --target-triples=arm-linux-SOMETHING 
to the configure script, but I don’t know what value of SOMETHING is 
relevant to you. It may be gnu, the default triple on my machine is 
x86_64-unknown-linux-gnu.




___
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


Re: [rust-dev] Rust (Servo) Cross-Compile to ARM

2014-02-11 Thread Edit Balint

Dear Rust Developers,
Thank you for your answers.

Cross-compiling Rust HelloWorld to ARM was working fine.

Passing --target-triples=arm-unknown-linux-gnueabihf to the servo 
configure script wasn't working. The result servo binary was x86-64.


Today I'm going to try to compile Rust on ARM platform, reusing Luqman's 
compiled binaries as a snapshot.


Best Regards,

Edit

On 2014-02-06 18:06, Simon Sapin wrote:

On 06/02/2014 16:30, Edit Balint wrote:

Dear Rust Developers!

My name is Edit Balint, I'm a software developer at University of
Szeged, Hungary.
We have a research project regarding Servo and Rust.
Our main goal is to cross-compile and run Rust and Servo on ARM Linux
(not  Android).
We have several issues with the cross-compiling procedure. Is there any
guide how to achieve this?


Although you’re not using Android, this

https://github.com/mozilla/servo/wiki/Building-for-Android#wiki-build-servo 



suggests that you need to pass --target-triples=arm-linux-SOMETHING to 
the configure script, but I don’t know what value of SOMETHING is 
relevant to you. It may be gnu, the default triple on my machine is 
x86_64-unknown-linux-gnu.




___
Rust-dev mailing list
Rust-dev@mozilla.org
https://mail.mozilla.org/listinfo/rust-dev


Re: [rust-dev] Rust (Servo) Cross-Compile to ARM

2014-02-06 Thread Luqman Aden
Building a Rust cross compiler that can target arm isn't too hard. You just
need the right toolchain installed. I personally use Debian with the
gcc-4.7-arm-linux-gnueabi package from the Emdebian repo. (I believe Ubuntu
and other distros have similar packages). From there it's just a simple
matter of passing the right triple to the configure script.

./configure --target=arm-unknown-linux-gnueabi && make


That'll build a rustc that can target arm as well as all the libraries.
Then you can run it like so:

rustc --target=arm-unknown-linux-gnueabi --linker=arm-linux-gnueabi-gcc
hello.rs

That'll give you a binary, hello, which will run on arm/linux. So, that's
the basic gist of it. Cross compiling rustc itself is a bit more annoying
right now. You basically need to cross compile LLVM, libsyntax, librustc &
rustc.

As for Servo, I know they cross compile to android so there seems to be at
least some level of support in terms of cross compilation.

In any case, if you have any more question feel free to ping me on IRC (my
nick is just Luqman).


On Thu, Feb 6, 2014 at 11:30 AM, Edit Balint wrote:

> Dear Rust Developers!
>
> My name is Edit Balint, I'm a software developer at University of Szeged,
> Hungary.
> We have a research project regarding Servo and Rust.
> Our main goal is to cross-compile and run Rust and Servo on ARM Linux (not
>  Android).
> We have several issues with the cross-compiling procedure. Is there any
> guide how to achieve this?
>
> Any help would be appreciated.
>
> Best regards:
> Edit Balint
> ___
> 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


Re: [rust-dev] Rust (Servo) Cross-Compile to ARM

2014-02-06 Thread Ian Daniher
You probably want arm-unknown-linux-gnueabihf or arm-unknown-linux-gnueabi.


On Thu, Feb 6, 2014 at 12:06 PM, Simon Sapin  wrote:

> On 06/02/2014 16:30, Edit Balint wrote:
>
>> Dear Rust Developers!
>>
>> My name is Edit Balint, I'm a software developer at University of
>> Szeged, Hungary.
>> We have a research project regarding Servo and Rust.
>> Our main goal is to cross-compile and run Rust and Servo on ARM Linux
>> (not  Android).
>> We have several issues with the cross-compiling procedure. Is there any
>> guide how to achieve this?
>>
>
> Although you’re not using Android, this
>
> https://github.com/mozilla/servo/wiki/Building-for-
> Android#wiki-build-servo
>
> suggests that you need to pass --target-triples=arm-linux-SOMETHING to
> the configure script, but I don’t know what value of SOMETHING is relevant
> to you. It may be gnu, the default triple on my machine is
> x86_64-unknown-linux-gnu.
>
> --
> Simon Sapin
>
> ___
> 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


Re: [rust-dev] Rust (Servo) Cross-Compile to ARM

2014-02-06 Thread Simon Sapin

On 06/02/2014 16:30, Edit Balint wrote:

Dear Rust Developers!

My name is Edit Balint, I'm a software developer at University of
Szeged, Hungary.
We have a research project regarding Servo and Rust.
Our main goal is to cross-compile and run Rust and Servo on ARM Linux
(not  Android).
We have several issues with the cross-compiling procedure. Is there any
guide how to achieve this?


Although you’re not using Android, this

https://github.com/mozilla/servo/wiki/Building-for-Android#wiki-build-servo

suggests that you need to pass --target-triples=arm-linux-SOMETHING to 
the configure script, but I don’t know what value of SOMETHING is 
relevant to you. It may be gnu, the default triple on my machine is 
x86_64-unknown-linux-gnu.


--
Simon Sapin
___
Rust-dev mailing list
Rust-dev@mozilla.org
https://mail.mozilla.org/listinfo/rust-dev


Re: [rust-dev] Rust (Servo) Cross-Compile to ARM

2014-02-06 Thread Ian Daniher
I've done a lot of work with Rust on ARMHF, but mostly bootstrapped.

Luqman's binary builds are a great cheatcode for spinning up a build -
using --enable-local-rust and the images downloadable from
http://luqman.ca/rust-builds, it's pretty trivial to get Rust building on
a $50 RK3188 ARMv7 quad-core computer with 2GB of RAM. I've found it to be
easier than cross-compiling.

For floating point intrinsics to work on ARMHF,
https://github.com/mozilla/rust/issues/10482#issuecomment-32097769 needs to
be applied. I'll be endeavoring to get this merged up within the next week.

Depending upon your platform, you may need to patch configure to support
your particular set of CPU config etc. I had to manually add arm7 as a
CPUTYPE.

If you're stuck on cross-compiling, Luqman seems to be the domain expert. I
don't know what, if any, out of build patches he uses.

Delighted to see ARM getting more love! I'll endeavor to make myself of use
- drop an email to the list or to me personally with specific issues as
they come up!

Best,
--
Ian



On Thu, Feb 6, 2014 at 11:30 AM, Edit Balint wrote:

> Dear Rust Developers!
>
> My name is Edit Balint, I'm a software developer at University of Szeged,
> Hungary.
> We have a research project regarding Servo and Rust.
> Our main goal is to cross-compile and run Rust and Servo on ARM Linux (not
>  Android).
> We have several issues with the cross-compiling procedure. Is there any
> guide how to achieve this?
>
> Any help would be appreciated.
>
> Best regards:
> Edit Balint
> ___
> 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


[rust-dev] Rust (Servo) Cross-Compile to ARM

2014-02-06 Thread Edit Balint

Dear Rust Developers!

My name is Edit Balint, I'm a software developer at University of 
Szeged, Hungary.

We have a research project regarding Servo and Rust.
Our main goal is to cross-compile and run Rust and Servo on ARM Linux 
(not  Android).
We have several issues with the cross-compiling procedure. Is there any 
guide how to achieve this?


Any help would be appreciated.

Best regards:
Edit Balint
___
Rust-dev mailing list
Rust-dev@mozilla.org
https://mail.mozilla.org/listinfo/rust-dev