Skip to content

Cross-compiled build for Linux/aarch64#734

Closed
gebner wants to merge 1 commit intoleanprover:masterfrom
gebner:aarch64
Closed

Cross-compiled build for Linux/aarch64#734
gebner wants to merge 1 commit intoleanprover:masterfrom
gebner:aarch64

Conversation

@gebner
Copy link
Member

@gebner gebner commented Oct 20, 2021

This adds a new build for Linux/aarch64, which is cross-compiled on github actions. The tests are run using CPU emulation.

The release tarball is called lean-x.y.z-linux_aarch64.tar.gz, this is supported by recent elan versions.

The main difficulty was getting stage0 to work as a cross-compiler (i.e., compile the stage0 compiler for amd64 but have it generate oleans and C files that run on aarch64). It turns out that the oleans were not architecture-independent, because of the hash function we use for strings. This function had a parameter of type char const *, on amd64 this is signed char const *, on aarch64 this is unsigned char const *. I have changed it to unsigned char independent of the architecture (requiring a stage0 update).

(Thanks to @Kha for pointing me to the olean files as a source of troubles. In order to debug the olean differences, I wrote a small and very incomplete olean parser in Lean: https://github.com/gebner/oleanparser)

@Kha
Copy link
Member

Kha commented Oct 20, 2021

I'll cherry-pick the fix to master tomorrow. For the remainder it might make more sense to wait for #733 first.

@Kha Kha self-assigned this Dec 15, 2021
@leodemoura
Copy link
Member

@gebner @Kha Should we close or merge this PR?

@gebner
Copy link
Member Author

gebner commented Mar 21, 2022

I believe Sebastian wants to do this in a completely different way.

@gebner gebner closed this Mar 21, 2022
@Kha
Copy link
Member

Kha commented Mar 21, 2022

For what it's worth, the first alpha release of Asahi Linux might increase the priority of this feature a little; personally I'm waiting for better 16K pages support in Emacs & libunwind. There are even reports about Linux on M1 being faster than macOS. I'll try cross-compiling LLVM as soon as this PC has been upgraded to more than 8GB RAM.

ChrisHughes24 pushed a commit to ChrisHughes24/lean4 that referenced this pull request Dec 2, 2022
mathlib3 SHA: 71ca477041bcd6d7c745fe555dc49735c12944b7

porting notes: mostly smooth but:

1. there were two places where I had to add `MulZeroClass` explicitly (toward the end of the file), which was weird
2. one declaration is surprisingly slow for no apparent reason
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