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

misc: detect CPU architecture from C compiler #84

Merged
merged 2 commits into from
Oct 17, 2020

Conversation

EduardoRFS
Copy link
Contributor

@EduardoRFS EduardoRFS commented Oct 13, 2020

This allows to cross-compile from x86_64 -> ARM64.

EduardoRFS added a commit to EduardoRFS/reason-mobile that referenced this pull request Oct 14, 2020
@hannesm
Copy link
Member

hannesm commented Oct 14, 2020

this looks fine to me (travis failure is unrelated).. do you know of a CI setup to test cross-compilation (to ensure we don't break it in the future)?

@rizo
Copy link

rizo commented Oct 14, 2020

I can confirm that this patch resolves the issue. We have a private cross-compiling CI that targets ARM and uses some mirage packages, would be nice to make it available for open-source projects at some point.

@EduardoRFS
Copy link
Contributor Author

@hannesm My tooling uses esy for that, if you don't mind I can setup a CI to build for Android ARM64

@hannesm
Copy link
Member

hannesm commented Oct 14, 2020

@EduardoRFS if you can add a commit here that extends e.g. the GitHub actions (or travis) with such a job, that'd be great. Thanks a lot.

@EduardoRFS EduardoRFS force-pushed the better-arch-detection branch 6 times, most recently from bfa9dc9 to b2b4214 Compare October 15, 2020 00:59
@hannesm
Copy link
Member

hannesm commented Oct 15, 2020

@EduardoRFS thanks for your second commit, somehow the CI job fails to find ndk.zip - is it expected to work, should I restart the action, or do you have an adjustment to the runner for this?

@EduardoRFS
Copy link
Contributor Author

@hannesm I'm debugging it, it's something related to the shell used on the CI, I should finish it today

@hannesm
Copy link
Member

hannesm commented Oct 15, 2020

@EduardoRFS great, thanks. if you rebase onto master, the travis CI should also turn green.

* this allows to cross architecture cross-compiling
@EduardoRFS EduardoRFS force-pushed the better-arch-detection branch 2 times, most recently from ab98a9a to 0380f88 Compare October 15, 2020 20:06
@EduardoRFS
Copy link
Contributor Author

EduardoRFS commented Oct 15, 2020

Ok now it should work for both Android ARM64 and Linux Musl ARM64

Dependencies

Most dependencies are extracted from opam and every commit esy solve will look for a new version, if no dependency changed it will keep cached.

mtime, zarith and num, is a pinned commit to dune-universe. Because to build to another platform is way easier to just use the dune version

esy-gmp is also pinned because for cross compile there is a need for gmp 6.2.0 as soon as it is published I will remove it

@EduardoRFS EduardoRFS force-pushed the better-arch-detection branch 2 times, most recently from ef87c85 to ab555a0 Compare October 16, 2020 07:55
@EduardoRFS
Copy link
Contributor Author

@hannesm sorry for all the CI noise. Zarith and GMP was a small problem and there was also an intermittent compile bug(solved)

@hannesm
Copy link
Member

hannesm commented Oct 16, 2020

@EduardoRFS thanks for your work on this, one minor nit: could you squash the last 3 commits (CI-related) into one. then this is fine to be merged. I can also do a release to opam-repository if this eases your workflow.

@EduardoRFS EduardoRFS force-pushed the better-arch-detection branch from ab555a0 to ff324b0 Compare October 16, 2020 20:07
@hannesm hannesm merged commit 9a0631e into mirage:master Oct 17, 2020
@EduardoRFS EduardoRFS deleted the better-arch-detection branch October 17, 2020 10:55
hannesm added a commit to hannesm/opam-repository that referenced this pull request Oct 21, 2020
…mirage-crypto-rng-mirage (0.8.6)

CHANGES:

* Detect CPU architecture from C compiler, allowing cross-compiling to Android
  and iOS (mirage/mirage-crypto#84 by @EduardoRFC)
* Upgrade to dune2, use a Makefile for building freestanding libraries, drop
  mirage-xen-posix support (solo5-based PVH exists now) mirage/mirage-crypto#86 by @hannesm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants