New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ARM cross compile support #6327

Closed
mmatyas opened this Issue Jun 10, 2015 · 4 comments

Comments

Projects
None yet
4 participants
@mmatyas
Contributor

mmatyas commented Jun 10, 2015

This is a meta issue, after applying the following set of patches, it should be possible to cross compile servo for ARM devices by simply calling mach --target=arm-unknown-linux-gnueabihf

[more will come]

@nox nox added the I-enhancement label Jun 12, 2015

This was referenced Jun 15, 2015

bors-servo pushed a commit that referenced this issue Jun 20, 2015

bors-servo
Auto merge of #6421 - mmatyas:arm_build2, r=larsbergstrom
Fix ARM linker

By default, `cc` is used for the final linking of servo, which points to the host's compiler. This patch ensures that the correct linker is used for cross-compiling to ARM.

Part of #6327

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6421)
<!-- Reviewable:end -->
@mmatyas

This comment has been minimized.

Show comment
Hide comment
@mmatyas

mmatyas Jul 3, 2015

Contributor

With the last set of patches, it is now possible to cross compile Servo to ARM. I've wrote a guide for that here: https://mmatyas.github.io/blog/cross-compiling-servo-to-arm/

@pcwalton, @Adenilson: could you check if this guide works for you too?

Contributor

mmatyas commented Jul 3, 2015

With the last set of patches, it is now possible to cross compile Servo to ARM. I've wrote a guide for that here: https://mmatyas.github.io/blog/cross-compiling-servo-to-arm/

@pcwalton, @Adenilson: could you check if this guide works for you too?

@Adenilson

This comment has been minimized.

Show comment
Hide comment
@Adenilson

Adenilson Jul 3, 2015

Contributor

Matyas

Quite funny that I wrote something similar for OSG Blog but didn't
published it yet.
:-)

I will be back from vacations on 14th July and then can test the
instructions.

Cheers

Adenilson

On Fri, Jul 3, 2015 at 1:25 PM, Mátyás Mustoha notifications@github.com
wrote:

With the last set of patches, it is now possible to cross compile Servo to
ARM. I've wrote a guide for that here:
https://mmatyas.github.io/blog/cross-compiling-servo-to-arm/

@pcwalton https://github.com/pcwalton, @Adenilson
https://github.com/Adenilson: could you check if this guide works for
you too?


Reply to this email directly or view it on GitHub
#6327 (comment).

Contributor

Adenilson commented Jul 3, 2015

Matyas

Quite funny that I wrote something similar for OSG Blog but didn't
published it yet.
:-)

I will be back from vacations on 14th July and then can test the
instructions.

Cheers

Adenilson

On Fri, Jul 3, 2015 at 1:25 PM, Mátyás Mustoha notifications@github.com
wrote:

With the last set of patches, it is now possible to cross compile Servo to
ARM. I've wrote a guide for that here:
https://mmatyas.github.io/blog/cross-compiling-servo-to-arm/

@pcwalton https://github.com/pcwalton, @Adenilson
https://github.com/Adenilson: could you check if this guide works for
you too?


Reply to this email directly or view it on GitHub
#6327 (comment).

bors-servo pushed a commit to servo/rust-mozjs that referenced this issue Jul 28, 2015

bors-servo
Auto merge of #167 - mmatyas:arm_build2, r=jdm
Allow to override CC and AR for cross compilation.

Requires servo/servo#6531
Part of servo/servo#6327

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/rust-mozjs/167)
<!-- Reviewable:end -->

bors-servo pushed a commit to servo/mozjs that referenced this issue Jul 28, 2015

bors-servo
Auto merge of #48 - mmatyas:arm_build2, r=jdm
Improve ARM cross compilation

The first patch fixes some configuration flags for ARM, which also means `jemalloc` is now disabled for all targets.
The second patch fixes zlib flags, which caused moz.build errors during cross compilation. I'm not sure if this is the correct way to solve this of if this works for all platforms, could you check it?

Requires servo/servo#6531
Part of servo/servo#6327

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/mozjs/48)
<!-- Reviewable:end -->

bors-servo pushed a commit that referenced this issue Jul 29, 2015

bors-servo
Auto merge of #6531 - mmatyas:arm_build2, r=metajack
Allow to override CXX and AR for cross compilation.

**Update:** Please see issue #6537 

Required by some ARM patches.

Part of #6327

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6531)
<!-- Reviewable:end -->

bors-servo pushed a commit to servo/rust-azure that referenced this issue Jul 30, 2015

bors-servo
Auto merge of #189 - mmatyas:arm_build3, r=jdm
Fix cross compilation issues

This fixes cross compilation issues, so it now builds correctly for both Android and ARM.
(See servo/servo#6537)

Part of servo/servo#6327.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/rust-azure/189)
<!-- Reviewable:end -->

bors-servo pushed a commit to servo/skia that referenced this issue Jul 30, 2015

bors-servo
Auto merge of #64 - mmatyas:arm_build2, r=jdm
Fix cross compilation issues

This fixes cross compilation issues, so Skia now builds correctly for both Android and ARM.
(See servo/servo#6537)

Part of servo/servo#6327.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/skia/64)
<!-- Reviewable:end -->

bors-servo pushed a commit to servo/libfreetype2 that referenced this issue Jul 30, 2015

bors-servo
Auto merge of #14 - mmatyas:arm_build2, r=jdm
Disable initial values set by `make`.

This fixes cross compilation issues, so freetype now builds correctly for both Android and ARM.
(See servo/servo#6537)

Part of servo/servo#6327.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/libfreetype2/14)
<!-- Reviewable:end -->

bors-servo pushed a commit to servo/rust-azure that referenced this issue Jul 30, 2015

bors-servo
Auto merge of #189 - mmatyas:arm_build3, r=jdm,metajack
Fix cross compilation issues

This fixes cross compilation issues, so it now builds correctly for both Android and ARM.
(See servo/servo#6537)

Part of servo/servo#6327.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/rust-azure/189)
<!-- Reviewable:end -->

bors-servo pushed a commit to servo/rust-png that referenced this issue Jul 30, 2015

bors-servo
Auto merge of #77 - mmatyas:arm_build2, r=jdm
Allow to override CC, AR and RANLIB for cross compilation.

Part of servo/servo#6327

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/rust-png/77)
<!-- Reviewable:end -->

bors-servo pushed a commit to servo/libfontconfig that referenced this issue Jul 30, 2015

bors-servo
Auto merge of #11 - mmatyas:arm_build2, r=metajack
Fix missing configuration flags when cross compiling to ARM.

Part of servo/servo#6327

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/libfontconfig/11)
<!-- Reviewable:end -->

bors-servo pushed a commit to servo/rust-stb-image that referenced this issue Aug 4, 2015

bors-servo
Auto merge of #78 - mmatyas:arm_build2, r=metajack
Disable initial values set by `make`.

This fixes cross compilation issues, so it now builds correctly for both Android and ARM.
(See servo/servo#6537)

Part of servo/servo#6327.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/rust-stb-image/78)
<!-- Reviewable:end -->

bors-servo pushed a commit to servo/libexpat that referenced this issue Aug 4, 2015

bors-servo
Auto merge of #6 - mmatyas:arm_build2, r=metajack
Add ARM cross-compile support.

Probably requires servo/servo#6531
Part of servo/servo#6327

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/libexpat/6)
<!-- Reviewable:end -->

bors-servo pushed a commit to servo/rust-harfbuzz that referenced this issue Aug 27, 2015

bors-servo
Auto merge of #50 - mmatyas:arm_build2, r=jdm
Allow to override CC and AR for cross compilation.

In some cases cross compilation fails with harfbuzz, this fixes the issue. 
Part of servo/servo#6327

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/rust-harfbuzz/50)
<!-- Reviewable:end -->

bors-servo pushed a commit that referenced this issue Sep 1, 2015

bors-servo
Auto merge of #6531 - mmatyas:arm_build2, r=metajack
Allow to override CXX and AR for cross compilation.

**Update:** Please see issue #6537 

Required by some ARM patches.

Part of #6327

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6531)
<!-- Reviewable:end -->
@mmatyas

This comment has been minimized.

Show comment
Hide comment
@mmatyas

mmatyas Nov 3, 2015

Contributor

Now that the patches landed and most dependencies work fine, I've updated the guide again: https://mmatyas.github.io/blog/cross-compiling-servo-to-arm (mirror: http://browser.sed.hu/blog/20150717/cross-compiling-servo-arm)

In short, if you've set up the ARM and Rust libs, you can now build by simply calling

PKG_CONFIG_ALLOW_CROSS=1 \
PKG_CONFIG_PATH=/usr/lib/arm-linux-gnueabihf/pkgconfig \
EXPAT_NO_PKG_CONFIG=1 \
CC=arm-linux-gnueabihf-gcc \
CXX=arm-linux-gnueabihf-g++ \
CPP="arm-linux-gnueabihf-gcc -E" \
LD=arm-linux-gnueabihf-ld \
AR=arm-linux-gnueabihf-ar \
RANLIB=arm-linux-gnueabihf-ranlib \
./mach build --target=arm-unknown-linux-gnueabihf --dev

The only bug left is in libexpat which causes compile error for me (DEP_EXPAT_OUTDIR doesn't get defined, so the build fails at libfontconfig), This can be avoided by defining EXPAT_NO_PKG_CONFIG.

Contributor

mmatyas commented Nov 3, 2015

Now that the patches landed and most dependencies work fine, I've updated the guide again: https://mmatyas.github.io/blog/cross-compiling-servo-to-arm (mirror: http://browser.sed.hu/blog/20150717/cross-compiling-servo-arm)

In short, if you've set up the ARM and Rust libs, you can now build by simply calling

PKG_CONFIG_ALLOW_CROSS=1 \
PKG_CONFIG_PATH=/usr/lib/arm-linux-gnueabihf/pkgconfig \
EXPAT_NO_PKG_CONFIG=1 \
CC=arm-linux-gnueabihf-gcc \
CXX=arm-linux-gnueabihf-g++ \
CPP="arm-linux-gnueabihf-gcc -E" \
LD=arm-linux-gnueabihf-ld \
AR=arm-linux-gnueabihf-ar \
RANLIB=arm-linux-gnueabihf-ranlib \
./mach build --target=arm-unknown-linux-gnueabihf --dev

The only bug left is in libexpat which causes compile error for me (DEP_EXPAT_OUTDIR doesn't get defined, so the build fails at libfontconfig), This can be avoided by defining EXPAT_NO_PKG_CONFIG.

@jdm jdm added the A-documentation label Nov 3, 2015

@mmatyas

This comment has been minimized.

Show comment
Hide comment
@mmatyas

mmatyas Mar 18, 2016

Contributor

So now that we have automatic ARM32/ARM64 builds (servo/saltfs#239), I guess it's safe to close this.

Contributor

mmatyas commented Mar 18, 2016

So now that we have automatic ARM32/ARM64 builds (servo/saltfs#239), I guess it's safe to close this.

@mmatyas mmatyas closed this Mar 18, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment