Skip to content

arm64: drop the stale crypto/openssl/aarch64/arm_arch.h copy - #525

Merged
laffer1 merged 1 commit into
masterfrom
fix-arm64-openssl-arm-arch
Sep 25, 2026
Merged

laffer1 merged 1 commit into
masterfrom
fix-arm64-openssl-arm-arch

Conversation

@laffer1

@laffer1 laffer1 commented Sep 25, 2026 •

Copy link
Copy Markdown
Member

Follow-up to #523 and #524. With those in, both amd64 Cross-build Kernel jobs are green and both arm64 jobs fail on the next genuine source bug, which also breaks native arm64 GENERIC builds:

sys/crypto/openssl/aarch64/aesv8-armx.S:18:2: error: unrecognized instruction mnemonic

The OpenSSL aarch64 .S files #include "arm_arch.h", which resolves to a sibling copy in sys/crypto/openssl/aarch64/ before any -I path. That copy dates from OpenSSL 1.1 (2018) and lacks AARCH64_VALID_CALL_TARGET, so the macro is assembled literally.

Removed the stale copy so the maintained sys/crypto/openssl/arm_arch.h is found, added -I$S/crypto/openssl to the aarch64 OpenSSL assembly rules in files.arm64 as FreeBSD does, and repointed the one C consumer (ossl_aarch64.c) at the surviving header. No assembly was modified.

Verified locally: aesv8-armx.o, ghashv8-armx.o, sha1/sha256/sha512-armv8.o, poly1305-armv8.o, chacha-armv8.o, ossl_aarch64.o, armv8_crypto.o and armv8_crypto_wrap.o all cross-compile for aarch64 from a GENERIC+ossl config; the first two fail identically before the change. This PR's CI run is the end-to-end test for arm64.

AI-Assisted-by: Claude Fable 5.1

🤖 Generated with Claude Code

Summary by Sourcery

Fix arm64 OpenSSL compilation by removing the stale architecture-header copy and using the maintained shared header.

Bug Fixes:

  • Fix arm64 OpenSSL builds by ensuring assembly and C consumers use the maintained architecture header with the required call-target macro.

Enhancements:

  • Remove the stale duplicated arm64 OpenSSL architecture header.

Build:

  • Update arm64 OpenSSL assembly include paths to resolve the shared architecture header.

Tests:

  • Verify the affected OpenSSL arm64 objects cross-compile successfully.

The OpenSSL aarch64 assembly files #include "arm_arch.h", which resolves
to the sibling copy in sys/crypto/openssl/aarch64/ before any -I path.
That copy dates from OpenSSL 1.1 (2018) and lacks the macros the current
3.0 assembly uses, so AARCH64_VALID_CALL_TARGET is left unexpanded and
every arm64 GENERIC build fails:

    sys/crypto/openssl/aarch64/aesv8-armx.S:18:2: error: unrecognized instruction mnemonic

Remove the stale copy so the include resolves to the maintained
sys/crypto/openssl/arm_arch.h, add -I$S/crypto/openssl to the aarch64
OpenSSL assembly rules in files.arm64 as FreeBSD does, and repoint the
one C consumer (ossl_aarch64.c) at the surviving header.

Verified: aesv8-armx.o, ghashv8-armx.o, sha1/sha256/sha512-armv8.o,
poly1305-armv8.o, chacha-armv8.o, ossl_aarch64.o, armv8_crypto.o and
armv8_crypto_wrap.o all cross-compile for aarch64 from a GENERIC+ossl
config; the first two fail identically before the change.

AI-Assisted-by: Claude Fable 5.1
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Signed-off-by: Lucas Holt <luke@foolishgames.com>
@sourcery-ai

sourcery-ai Bot commented Sep 25, 2026 •

Copy link
Copy Markdown
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Removes the stale AArch64 OpenSSL header and adjusts C and assembly include paths so all AArch64 consumers resolve the maintained header containing the required call-target macro, fixing native and cross-compiled arm64 builds without changing assembly code.

File-Level Changes

Change Details Files
Removed the stale architecture-specific OpenSSL header so AArch64 sources use the maintained shared header.
  • Delete the obsolete OpenSSL 1.1-era AArch64 header copy.
  • Update the C consumer to include the surviving shared header.
  • Ensure the shared header is selected through the existing OpenSSL include path.
sys/crypto/openssl/aarch64/arm_arch.h
sys/crypto/openssl/ossl_aarch64.c
Updated AArch64 kernel build rules to make the shared OpenSSL header available during assembly.
  • Add the OpenSSL source include directory to AArch64 assembly compilation rules.
  • Preserve the existing assembly sources without modifying their contents.
sys/conf/files.arm64

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hey - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

@laffer1
laffer1 merged commit dae9a79 into master Sep 25, 2026
9 of 10 checks passed
@laffer1
laffer1 deleted the fix-arm64-openssl-arm-arch branch September 25, 2026 22:58
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.

1 participant