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 Linux ARM64 native support #61

Merged
merged 16 commits into from
May 25, 2022

Conversation

garyschulte
Copy link
Contributor

@garyschulte garyschulte commented May 21, 2022

fixes #57

Adds support for building linux arm64 libs :

  • adds arn64 gravition executor to circle ci
  • adds arm64 lib copy task for secp256k1 and r1, ipa-multipoint, altbn128
  • uses c_lib platform-specific char type in altbn128 to avoid unsigned char problem on linux arm64 / libc6 2.28
  • adds OSARCH prefixing of build artifacts to prevent lib name conflicts
  • adds linux arm64 arch detection to skip bls12-381 build (due to unsigned char type mismatch in rust)

BLS12-381 is intentionally omitted from the linux-arm64 build because:

  1. we want to switch to blst
  2. it is unnecessary to merge unsigned char fix upstream
  3. the precompile isn't currently part of any besu protocol schedule

since this is a change to the layout of the native jars, I tested besu with 0.5.0-SNAPSHOT libs on all three platform identifiers:
linux-gnu-x86_64

2022-05-23 15:05:21.111-07:00 | main | INFO  | Besu | Using LibEthPairings native alt bn128
2022-05-23 15:05:21.112-07:00 | main | INFO  | Besu | Using the native implementation of the signature algorithm
2022-05-23 15:05:21.115-07:00 | main | INFO  | Besu | Starting Besu version: besu/v22.4.2-dev-7ea97fd5/linux-x86_64/openjdk-java-11
...

darwin (m1)

2022-05-23 15:10:21.616-07:00 | main | INFO  | Besu | Using LibEthPairings native alt bn128
2022-05-23 15:10:21.617-07:00 | main | INFO  | Besu | Using the native implementation of the signature algorithm
2022-05-23 15:10:21.620-07:00 | main | INFO  | Besu | Starting Besu version: besu/v22.4.2-dev-7ea97fd5/osx-aarch_64/oracle-java-17
...

linux-gnu-aarch64

2022-05-23 15:54:47.362-07:00 | main | INFO  | Besu | Using LibEthPairings native alt bn128
2022-05-23 15:54:47.389-07:00 | main | INFO  | Besu | Using the native implementation of the signature algorithm
2022-05-23 15:54:47.419-07:00 | main | INFO  | Besu | Starting Besu version: besu/v22.4.2-dev-5cdda94a/linux-aarch_64/oracle-java-17
...

For contrast, besu running on arm64-linux currently gives this output at startup:

2022-05-23 22:17:43.912+00:00 | main | INFO  | SECP256K1 | Native secp256k1 not available
2022-05-23 22:17:43.915+00:00 | main | INFO  | Besu | Using the Java implementation of alt bn128
2022-05-23 22:17:43.915+00:00 | main | INFO  | Besu | Using the Java implementation of the signature algorithm
2022-05-23 22:17:43.918+00:00 | main | INFO  | Besu | Starting Besu version: besu/v22.4.1/linux-aarch_64/openjdk-java-11
...
2022-05-23 22:17:44.467+00:00 | main | INFO  | AbstractAltBnPrecompiledContract | Native alt bn128 not available
2022-05-23 22:17:44.468+00:00 | main | INFO  | AbstractAltBnPrecompiledContract | Native alt bn128 not available
2022-05-23 22:17:44.469+00:00 | main | INFO  | AbstractAltBnPrecompiledContract | Native alt bn128 not available

Signed-off-by: garyschulte <garyschulte@gmail.com>
@garyschulte garyschulte force-pushed the feature/linux-arm64 branch 2 times, most recently from 1e4cb6e to 2829dac Compare May 21, 2022 09:40
Signed-off-by: garyschulte <garyschulte@gmail.com>
@garyschulte garyschulte force-pushed the feature/linux-arm64 branch from 2829dac to e1e5b9c Compare May 21, 2022 09:43
@jclapis
Copy link

jclapis commented May 22, 2022

👀

…en linux x86_64 and linux aarch64

Signed-off-by: garyschulte <garyschulte@gmail.com>
Signed-off-by: garyschulte <garyschulte@gmail.com>
@garyschulte garyschulte marked this pull request as ready for review May 22, 2022 12:53
@garyschulte garyschulte changed the title initial linux arm64 support for secp256* libs Add linux arm64 native support May 22, 2022
@garyschulte garyschulte changed the title Add linux arm64 native support Add Linux ARM64 native support May 22, 2022
Signed-off-by: garyschulte <garyschulte@gmail.com>
Signed-off-by: garyschulte <garyschulte@gmail.com>
Signed-off-by: garyschulte <garyschulte@gmail.com>
Signed-off-by: garyschulte <garyschulte@gmail.com>
Signed-off-by: garyschulte <garyschulte@gmail.com>
Signed-off-by: garyschulte <garyschulte@gmail.com>
…ndition into the function

Signed-off-by: garyschulte <garyschulte@gmail.com>
Signed-off-by: garyschulte <garyschulte@gmail.com>
Signed-off-by: garyschulte <garyschulte@gmail.com>
Signed-off-by: garyschulte <garyschulte@gmail.com>
Signed-off-by: garyschulte <garyschulte@gmail.com>
Signed-off-by: garyschulte <garyschulte@gmail.com>
@garyschulte garyschulte merged commit ee42d04 into hyperledger:main May 25, 2022
@garyschulte garyschulte deleted the feature/linux-arm64 branch May 25, 2022 05:08
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.

Add Linux arm64 support
3 participants