Skip to content

misc: detect CPU architecture from C compiler - #84

Merged
hannesm merged 2 commits into
mirage:masterfrom
EduardoRFS:better-arch-detection
Oct 17, 2020
Merged

hannesm merged 2 commits into
mirage:masterfrom
EduardoRFS:better-arch-detection

Conversation

@EduardoRFS

@EduardoRFS EduardoRFS commented Oct 13, 2020 •

Copy link
Copy Markdown
Contributor

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

hannesm commented Oct 14, 2020

Copy link
Copy Markdown
Member

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

rizo commented Oct 14, 2020

Copy link
Copy Markdown

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
Copy Markdown
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

hannesm commented Oct 14, 2020

Copy link
Copy Markdown
Member

@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

hannesm commented Oct 15, 2020

Copy link
Copy Markdown
Member

@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
Copy Markdown
Contributor Author

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

@hannesm

hannesm commented Oct 15, 2020

Copy link
Copy Markdown
Member

@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

EduardoRFS commented Oct 15, 2020 •

Copy link
Copy Markdown
Contributor Author

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
Copy Markdown
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

hannesm commented Oct 16, 2020

Copy link
Copy Markdown
Member

@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 mentioned this pull request Oct 17, 2020
3 of 4 tasks
@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