Skip to content

FIX: arm64 amalgamations + better CI coverage#3931

Merged
randombit merged 7 commits intorandombit:masterfrom
Rohde-Schwarz:ci/arm64_amalgamation
Mar 22, 2024
Merged

FIX: arm64 amalgamations + better CI coverage#3931
randombit merged 7 commits intorandombit:masterfrom
Rohde-Schwarz:ci/arm64_amalgamation

Conversation

@reneme
Copy link
Copy Markdown
Collaborator

@reneme reneme commented Mar 5, 2024

This continues the work @lieser started in #3780. It aims to fix #3927 and #3774. It also incorporates #3930.

Along with fixes to the relevant BOTAN_FUNC_ISA() annotations, this adds CI targets for amalgamation builds on arm64 (using GCC) and Android NDK arm64 (using clang). Also, this adds builds on the macos-14 runner released a month ago, that is based on Apple Silicon, i.e. arm64 😅.

Note: This also fixes an issue in the Python wrapper, where the ffi_api() declaration failed to explicitly specify a c_int buffer length parameter. On Apple silicon that resulted in this parameter being 0 on the C/C++ side. Not entirely sure how that ever worked on all other platforms we test in CI.

@randombit I'm somewhat worried that these inline ISA-annotations aren't necessarily in sync with whatever is defined in the src/build-data/cc/*.txt files. Currently, for arm64 the definitions are as such:

clang.txt

arm64:armv8crypto -> "-march=armv8+crypto"
arm64:armv8sha512 -> "-march=armv8.2-a+sha3"

gcc.txt

arm64:armv8crypto -> ""
arm64:armv8sm3 -> "-march=armv8.2-a+sm4"
arm64:armv8sm4 -> "-march=armv8.2-a+sm4"
arm64:armv8sha512 -> "-march=armv8.2-a+sha3"
arm64:armv8sha3 -> "-march=armv8.2-a+sha3"

... i.e. clang.txt doesn't even define all of them. I'm guessing that the inline annotations using BOTAN_FUNC_ISA() are saving the day for those, no?

@coveralls
Copy link
Copy Markdown

coveralls commented Mar 5, 2024

Coverage Status

coverage: 92.025% (-0.006%) from 92.031%
when pulling b88819c on Rohde-Schwarz:ci/arm64_amalgamation
into 3fed83d on randombit:master.

@reneme reneme marked this pull request as ready for review March 5, 2024 16:45
@reneme reneme requested review from lieser and randombit March 5, 2024 16:45
@reneme reneme self-assigned this Mar 5, 2024
@reneme reneme changed the title CI: arm64 amalgamations FIX: arm64 amalgamations Mar 5, 2024
@reneme reneme force-pushed the ci/arm64_amalgamation branch 2 times, most recently from 1a5e8ec to df6dcab Compare March 5, 2024 17:48
@reneme reneme changed the title FIX: arm64 amalgamations FIX: arm64 amalgamations + better CI coverage Mar 5, 2024
@reneme

This comment was marked as outdated.

reneme and others added 7 commits March 6, 2024 14:39
This is a follow up for randombit#3780 that fixes the ISA issues for both
clang (for Android NDK) and gcc.

Co-Authored-By: Philippe Lieser <philippe.lieser@rohde-schwarz.com>
On Apple Silicon, when disabling 'neon' via BOTAN_CLEAR_CPUID, _all_
other CPUID flags went away, leaving the result of the CLI invocation
empty. The test didn't handle that correctly and failed.
Unclear how that worked on other platforms. It did fail on macOS with Apple silicon.
@reneme reneme force-pushed the ci/arm64_amalgamation branch from 5c3a1d8 to b88819c Compare March 6, 2024 13:40
@reneme
Copy link
Copy Markdown
Collaborator Author

reneme commented Mar 6, 2024

Rebased after merging #3932

Copy link
Copy Markdown
Owner

@randombit randombit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree things are not necessarily in sync with the info files. I also don’t like the repetition of having these magic (compiler-specific, sometimes undocumented) strings everywhere - ideally we’d have a header that encapsulates this like we do for the SIMD API annotations. (No need to do this here.)

Change itself lgtm.

@randombit
Copy link
Copy Markdown
Owner

Good to merge? Not sure if more was going to happen here.

@reneme
Copy link
Copy Markdown
Collaborator Author

reneme commented Mar 21, 2024

Should be fine to merge. I didn't plan to address the discussed ISA flag duplication here.

@randombit randombit merged commit f03c6a9 into randombit:master Mar 22, 2024
@reneme reneme deleted the ci/arm64_amalgamation branch March 22, 2024 12:38
@reneme reneme mentioned this pull request Mar 22, 2024
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.

Build failure, 3.3.0 amalgamation arm64

3 participants