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

add support for arm-unknown-linux-gnueabihf #158

Closed
wants to merge 1 commit into from

Conversation

gnzlbg
Copy link
Contributor

@gnzlbg gnzlbg commented Nov 14, 2017

No description provided.

@japaric
Copy link
Contributor

japaric commented Nov 14, 2017

@gnzlbg The Dockerfile is missing.

@gnzlbg
Copy link
Contributor Author

gnzlbg commented Nov 14, 2017

@japaric sorry about that, should be fixed.

@gnzlbg
Copy link
Contributor Author

gnzlbg commented Nov 14, 2017

Moved this into #157 to launch a homu build.

@gnzlbg gnzlbg closed this Nov 14, 2017
@gnzlbg gnzlbg reopened this Nov 14, 2017
@gnzlbg
Copy link
Contributor Author

gnzlbg commented Nov 14, 2017

@japaric said:

I just remembered:

apt-get install -y --no-install-recommends g++-arm-linux-gnueabihf

This is wrong for arm-unknown-linux-gnueabihf because that targets supports both ARMv6 and ARMv7 but g++-arm-linux-gnueabihf targets ARMv7 thus with this combination the binary will contain ARMv7 instructions and will crash when executed on a ARMv6 device. You won't detect this problem when testing under QEMU because qemu-arm emulates an ARMv7 processor by default. But quite a few people, including me, have run into this runtime crash (SIGILL) when using the Ubuntu toolchain for cross compilation.

TL;DR The C toolchain (gcc + libc) must be compiled from scratch to target ARMv6

and then also said:

You can probably copy paste some of the Docker build stuff from rust-lang/rust. There they use crosstool-ng to build an ARMv6 toolchain.

So this is what I have tried to do by basically copying rust-lang/rust's dist-armhf-linux.

However, without a way to test this locally, I am basically going in blind.

@japaric
Copy link
Contributor

japaric commented Nov 14, 2017

I ran locally and it errored with:

Step 4/10 : RUN bash /crosstool-ng.sh
 ---> Running in 2f4ad86e3f0d
+ url=http://crosstool-ng.org/download/crosstool-ng/crosstool-ng-1.22.0.tar.bz2
+ curl -f http://crosstool-ng.org/download/crosstool-ng/crosstool-ng-1.22.0.tar.bz2
+ tar xjf -
/crosstool-ng.sh: line 14: curl: command not found

I can probably take a closer look at this tomorrow. I can also give you "try rights" so you can do @homu try yourself but edit-test loops on Travis are rather slow.

@gnzlbg
Copy link
Contributor Author

gnzlbg commented Nov 15, 2017

@japaric I've added curl to the list of packages to install but yeah, the edit-debug cycle over travis or homu is going to be very long.

@japaric
Copy link
Contributor

japaric commented Nov 15, 2017

Sorry, I won't have time to look into this at least until the weekend. I have given you "try right" though in case you want to try to get a bit further using travis.

@gnzlbg
Copy link
Contributor Author

gnzlbg commented Nov 15, 2017

@homunkulus try

-- @japaric if this fails (which probably will do) I'll disable temporarily all other build bots and see how far I come before the weekend. It is not a pressing issue, but I'd really love to migrate the stdsimd crate to cross, in particular since @malbarbo is working towards allowing qemu-system to run which is something we need to properly test run-time feature detection (qemu-user doesn't emulate /proc/cpuinfo, auxv, etc.).

@homunkulus
Copy link
Contributor

⌛ Trying commit 3115d90 with merge 5ae8b2b...

japaric pushed a commit that referenced this pull request Nov 15, 2017
add support for arm-unknown-linux-gnueabihf
@homunkulus
Copy link
Contributor

💔 Test failed - status-travis

@gnzlbg
Copy link
Contributor Author

gnzlbg commented Nov 16, 2017

@homunkulus try

japaric pushed a commit that referenced this pull request Nov 16, 2017
add support for arm-unknown-linux-gnueabihf
@homunkulus
Copy link
Contributor

⌛ Trying commit 46b39f8 with merge 0188f14...

@homunkulus
Copy link
Contributor

☀️ Test successful - status-travis
State: approved= try=True

@gnzlbg
Copy link
Contributor Author

gnzlbg commented Nov 16, 2017

Looks like this worked, doing a full run: @homunkulus try

japaric pushed a commit that referenced this pull request Nov 16, 2017
add support for arm-unknown-linux-gnueabihf
@homunkulus
Copy link
Contributor

⌛ Trying commit 24bd3de with merge e1779e8...

@homunkulus
Copy link
Contributor

💔 Test failed - status-travis

@gnzlbg
Copy link
Contributor Author

gnzlbg commented Nov 16, 2017

@homunkulus try

@homunkulus
Copy link
Contributor

⌛ Trying commit 7f7298b with merge fec6640...

japaric pushed a commit that referenced this pull request Nov 16, 2017
add support for arm-unknown-linux-gnueabihf
@homunkulus
Copy link
Contributor

💔 Test failed - status-travis

Dylan-DPC-zz
Dylan-DPC-zz previously approved these changes Oct 9, 2018
@Dylan-DPC-zz
Copy link

bors: r+

@bors
Copy link
Contributor

bors bot commented Oct 9, 2018

Merge conflict

@Dylan-DPC-zz
Copy link

@gnzlbg can you merge these conflicts if possible? Looking to merge this after that.

@gnzlbg
Copy link
Contributor Author

gnzlbg commented Oct 23, 2018

This never passed tests because of what @malbarbo mentioned here: #158 (comment)

@gnzlbg gnzlbg closed this Oct 23, 2018
@Dylan-DPC-zz
Copy link

Yeah but we resolved that issue in the other PRs which we already merged.

@gnzlbg gnzlbg reopened this Oct 23, 2018
@Dylan-DPC-zz
Copy link

@gnzlbg can you resolve the conflicts? want to test this next

@gnzlbg
Copy link
Contributor Author

gnzlbg commented Oct 30, 2018

So i've resolved the conflicts here, but I don't think this will work as is.

@gnzlbg
Copy link
Contributor Author

gnzlbg commented Oct 30, 2018

If someone wants to pick it up the best would probably be to just fetch my branch and submit a new PR.

@Dylan-DPC-zz
Copy link

What's missing right now? If you can list it, it will be easier for someone to pick it up

@gnzlbg
Copy link
Contributor Author

gnzlbg commented Oct 30, 2018

The whole building our own crosstools-ng never worked, so a different solution has to be found to get a proper cross-compilation toolchain for the target.

@legokichi
Copy link

@Dylan-DPC-zz
Copy link

@legokichi great. Are you open to making a PR/pushing a commit to this PR to make the relevant changes?

@legokichi
Copy link

i have no time

bors bot added a commit that referenced this pull request Jan 10, 2019
245: Add `arm-linux-gnueabihf`. r=Dylan-DPC a=reitermarkus

I took the suggestion from #158 (comment) and used a pre-compiled toolchain.

There are two commits here, the first one uses https://github.com/raspberrypi/tools, in the second one I switched to https://toolchains.bootlin.com/releases_armv6-eabihf.html.

I am not sure however if the `sysroot` is set correctly, since everything except `qemu` also works without `LD_LIBRARY_PATH=/usr/arm-linux-gnueabihf/lib:/usr/arm-linux-gnueabihf/arm-buildroot-linux-gnueabihf/lib`.

Co-authored-by: Markus Reiter <[email protected]>
bors bot added a commit that referenced this pull request Jan 11, 2019
245: Add `arm-linux-gnueabihf`. r=Dylan-DPC a=reitermarkus

I took the suggestion from #158 (comment) and used a pre-compiled toolchain.

There are two commits here, the first one uses https://github.com/raspberrypi/tools, in the second one I switched to https://toolchains.bootlin.com/releases_armv6-eabihf.html.

I am not sure however if the `sysroot` is set correctly, since everything except `qemu` also works without `LD_LIBRARY_PATH=/usr/arm-linux-gnueabihf/lib:/usr/arm-linux-gnueabihf/arm-buildroot-linux-gnueabihf/lib`.

Co-authored-by: Markus Reiter <[email protected]>
@reitermarkus
Copy link
Member

This can probably be closed now that #245 has been merged.

@Dylan-DPC-zz
Copy link

closing this in favour of #245. If anything wasn't added in that PR, we can make a new PR out of it.

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

Successfully merging this pull request may close these issues.

7 participants