Skip to content
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

Fix build on Raspberry Pi2. #75

Merged
merged 2 commits into from Jun 18, 2015
Merged

Fix build on Raspberry Pi2. #75

merged 2 commits into from Jun 18, 2015

Conversation

@Adenilson
Copy link
Contributor

Adenilson commented Jun 16, 2015

As the debian based linux distro uses 'alternatives' to allow selecting
tools (i.e. compiler), hardcoding the CC compiler to arm-linux-gnueabihf-gcc
may not point to the user selected default compiler.

@Adenilson
Copy link
Contributor Author

Adenilson commented Jun 16, 2015

Output of running vanilla:
pi@raspberrypi /media/iso/stuff/deps-servo/rust-png $ cargo build --release
Updating registry https://github.com/rust-lang/crates.io-index
Compiling png-sys v1.6.16 (file:///media/iso/stuff/deps-servo/rust-png)
Compiling gcc v0.3.8
Compiling libc v0.1.8
Build failed, waiting for other jobs to finish...
failed to run custom build command for png-sys v1.6.16 (file:///media/iso/stuff/deps-servo/rust-png)
Process didn't exit successfully: /media/iso/stuff/deps-servo/rust-png/target/release/build/png-sys-10e5e57738c3b96a/build-script-build (exit code: 101)
--- stdout
running: "/media/iso/stuff/deps-servo/rust-png/png-sys/libpng-1.6.16/configure" "--with-libpng-prefix=RUST_" "--host=arm-unknown-linux-gnueabihf"
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for arm-unknown-linux-gnueabihf-strip... no
checking for strip... strip
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking for arm-unknown-linux-gnueabihf-gcc... arm-unknown-linux-gnueabihf-gcc
checking whether the C compiler works... no

--- stderr
configure: error: in `/media/iso/stuff/deps-servo/rust-png/target/release/build/png-sys-10e5e57738c3b96a/out':
configure: error: C compiler cannot create executables

@metajack
Copy link
Contributor

metajack commented Jun 16, 2015

As is, I believe this patch breaks android, whose target triple is arm-linux-androideabi. @mmatyas might have better suggestions on how to solve this too.

@Adenilson
Copy link
Contributor Author

Adenilson commented Jun 16, 2015

Added the change where it will test for: gnueabihf.

As the debian based linux distro uses 'alternatives' to allow selecting
tools (i.e. compiler), hardcoding the CC compiler to arm-linux-gnueabihf-gcc
may not point to the user selected default compiler.

After discussion, it makes sense to only set the tools if you are crosscompiling.
@Adenilson Adenilson force-pushed the Adenilson:fixRPI2Build01 branch from cb91245 to 517b7b5 Jun 16, 2015
@mmatyas
Copy link
Contributor

mmatyas commented Jun 17, 2015

I'm going to try this on my board, will report back.

@Adenilson
Copy link
Contributor Author

Adenilson commented Jun 17, 2015

Any feedback on this?

@mmatyas
Copy link
Contributor

mmatyas commented Jun 17, 2015

Sorry, my board is a tiny bit slow, took several hours to build the latest rust and servo. I have a weird configuration error right now, even if I apply this patch, modify or even delete build.rs, my changes don't get used at all. I've double checked my paths, so I'm not really sure how this happened.

Anyway, this issue probably affects most dependencies, so I'll apply the other ARM patches and see how many of them fail. Again, sorry for the delay.

PS. The link in the comment section throws 404, it should be https://wiki.debian.org/DebianAlternatives, with an extra S at the end.

@Adenilson
Copy link
Contributor Author

Adenilson commented Jun 17, 2015

You don't need to compile servo & Inc to test this, just compile rust-png. :-)

And I faced the same error (i.e. pointing to wrong compiler) in libfreetype2 and rust-stb-image after the ARM specific patches.

I'm working on fixing those as we speak, but I would really like to get this landed ASAP.

@Adenilson
Copy link
Contributor Author

Adenilson commented Jun 17, 2015

If it helps, I can share the servo required rustc (i.e. specific hash) as it takes 8hs to compile it.

@mmatyas
Copy link
Contributor

mmatyas commented Jun 18, 2015

Ok, this patch works for me, for both on board and cross compile. As for the other patches, in most makefiles CC is set like CC := $(TARGET)-gcc, changing them to CC ?= $(TARGET)-gcc should work, and that would allow the users to override this setting.

@metajack
Copy link
Contributor

metajack commented Jun 18, 2015

Adenilson added a commit to Adenilson/libfreetype2 that referenced this pull request Jun 18, 2015
Further details on the issue, check discussion at:
servo/rust-png#75
@metajack metajack closed this Jun 18, 2015
@metajack metajack reopened this Jun 18, 2015
@metajack
Copy link
Contributor

metajack commented Jun 18, 2015

@bors-servo
Copy link

bors-servo commented Jun 18, 2015

📌 Commit 42c92c8 has been approved by metajack

@bors-servo
Copy link

bors-servo commented Jun 18, 2015

Testing commit 42c92c8 with merge 1c8dacf...

bors-servo pushed a commit that referenced this pull request Jun 18, 2015
Fix build on Raspberry Pi2.

As the debian based linux distro uses 'alternatives' to allow selecting
tools (i.e. compiler), hardcoding the CC compiler to arm-linux-gnueabihf-gcc
may not point to the user selected default compiler.
@bors-servo
Copy link

bors-servo commented Jun 18, 2015

☀️ Test successful - travis

@bors-servo bors-servo merged commit 42c92c8 into servo:master Jun 18, 2015
1 of 3 checks passed
1 of 3 checks passed
continuous-integration/appveyor AppVeyor build failed
Details
homu Testing commit 42c92c8 with merge 1c8dacf...
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
bors-servo pushed a commit to servo/libfreetype2 that referenced this pull request Jun 18, 2015
Fix build in Raspberry Pi2.

Further details on the issue, check discussion at:
servo/rust-png#75
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants
You can’t perform that action at this time.