Skip to content

Add Linux ARM64 (aarch64) native build support - #1561

Draft
gnodet wants to merge 1 commit into
masterfrom
arm64-glibc-master
Draft

Add Linux ARM64 (aarch64) native build support#1561
gnodet wants to merge 1 commit into
masterfrom
arm64-glibc-master

Conversation

@gnodet

@gnodet gnodet commented Mar 17, 2026

Copy link
Copy Markdown
Contributor

Summary

Port of #1527 (ARM64 builds for mvnd-1.x) to the master branch:

  • CI runners: Add ubuntu-24.04-arm to the build matrix for native Linux ARM64 builds
  • Matrix fix: Fix broken exclude rules that referenced macos-latest and windows-latest instead of actual runner names (macos-15, windows-2025)
  • glibc pinning: Add glibc.redef.aarch64 that pins all symbols to GLIBC_2.17 (the first glibc version with ARM64 support)
  • Arch-conditional compilation: Add #if defined(__aarch64__) in dynamic-libc-start.c for correct dlsym/dlvsym symver
  • gcc wrapper: Add uname -m detection to select the correct redef file
  • Maven profile: Add linux-aarch64-image-only-require-glibc-2.17 profile in client/pom.xml
  • Release workflow: Add ARM64 glibc patch/verify steps + linux-aarch64 release asset uploads

Test plan

  • CI builds should pass on all platforms (ubuntu x64, ubuntu arm64, macOS Intel, macOS ARM, Windows)
  • Linux AMD64 binary should still only require glibc 2.12
  • Linux ARM64 binary should only require glibc 2.17

🤖 Generated with Claude Code

Port ARM64 build support from mvnd-1.x PR #1527 to master:
- Add ubuntu-24.04-arm runner for Linux ARM64 builds
- Fix broken matrix exclude rules (macos-latest→macos-15, windows-latest→windows-2025)
- Add glibc.redef.aarch64 pinning all symbols to GLIBC_2.17
- Add #if defined(__aarch64__) conditional in dynamic-libc-start.c
- Add uname -m arch detection in gcc wrapper script
- Add linux-aarch64-image-only-require-glibc-2.17 profile in client/pom.xml
- Add ARM64 glibc patch/verify steps in CI workflows
- Add linux-aarch64 release asset upload steps

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

@gnodet gnodet left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This PR needs a rebase — most of the changes are now superseded by commit 99bd55d ("Fix CI: GraalVM 25 native builds with glibc backward compatibility", PR #1611) which already landed on master.

Merge state: DIRTY/CONFLICTING

Superseded changes (drop after rebase):

  • early-access.yaml — master already has full ARM64 support
  • dynamic-libc-start.c — aarch64 symver directives already on master
  • glibc.redef.aarch64 — master has all entries plus stat stat@GLIBC_2.17
  • gcc wrapper — master uses a separate gcc-aarch64 wrapper instead of modifying the shared one
  • client/pom.xml profile rename — master keeps the original name; ARM64 profile linux-image-only-require-glibc-2.17 already exists

Genuinely needed: Adding ARM64 support to release.yaml (ARM runner, glibc patching, verification, deploy steps). However, the current implementation uses patterns that are incompatible with GraalVM 25:

  1. Hardcoded ls -1 for svm/clibraries — GraalVM 25 removed libjvm.a and liblibchelper.a. Master's early-access.yaml uses find ... -name '*.a' 2>/dev/null instead.

  2. ldd 4-library count check — Intentionally removed from master because GraalVM 25 with +StaticExecutableWithDynamicLibC only dynamically links libc.so. This check will fail.

  3. Missing stat stat@GLIBC_2.17 in glibc.redef.aarch64 — Without this, the ARM64 binary requires glibc 2.33+ for stat().

  4. Missing stat-compat.c shim — Master's early-access.yaml compiles and links this to handle GraalVM 25's stat@GLIBC_2.33 dependency.

  5. Re-introduces macos-15-intel — Oracle dropped macOS x64 support in GraalVM 25.0.2+. This was intentionally removed from master.

Suggested path forward: Rebase onto current master, drop all changes already merged via #1611, and rework the release.yaml ARM64 additions to mirror early-access.yaml's working GraalVM 25 patterns.

This review was generated by an AI agent and may contain inaccuracies. Please verify all suggestions before applying.

Claude Code on behalf of gnodet

@gnodet gnodet left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This PR is largely superseded by commit 99bd55d (PR #1611) already on master, which added comprehensive ARM64 + GraalVM 25 support. In its current state, the PR would re-introduce GraalVM 25 build failures.

Key issues (all verified independently):

  1. early-access.yaml fully superseded — Master already has ubuntu-24.04-arm, arch-conditional glibc patching, ARM64 verification, and removed macos-15-intel. This PR re-introduces macos-15-intel which will fail (Oracle dropped macOS x64 GraalVM 25 support).

  2. Missing stat stat@GLIBC_2.17 — Master's glibc.redef.aarch64 includes this because GraalVM 25 links against stat@GLIBC_2.33. Without it, the ARM64 binary requires glibc 2.33+, defeating the purpose of pinning.

  3. Hardcoded ls -1 for GraalVM library files — GraalVM 25 removed libjvm.a/liblibchelper.a. Master switched to find. Affects both early-access.yaml and release.yaml.

  4. ldd 4-library count assertion — GraalVM 25 with +StaticExecutableWithDynamicLibC only links libc.so. The (( 4 == ... )) check fails. Master removed it. Affects both early-access.yaml and release.yaml.

  5. Profile rename conflicts with master — Renaming linux-image-only-require-glibc-2.12 conflicts with master which keeps the original name.

Remaining unique value:

The PR has two improvements worth preserving:

  • ARM64 deploy steps in release.yaml (not yet on master)
  • ARM64 verification regex 2\.1[0-7] is more correct than master's 2\.1[017] (master's character class only allows 2.10, 2.11, 2.17, not the full range 2.10–2.17)

Recommendation: Rebase onto master, drop all changes already merged via #1611, and rework the release.yaml ARM64 additions to use master's GraalVM 25-compatible patterns.

This review was generated by an AI agent and may contain inaccuracies. Please verify all suggestions before applying.

Claude Code on behalf of gnodet

@gnodet gnodet left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This PR appears to be superseded by commit 99bd55d ("Fix CI: GraalVM 25 native builds with glibc backward compatibility (#1611)"), which was merged to master on May 19, 2026 — two months after this PR was opened.

The PR is currently in CONFLICTING merge state and cannot be merged as-is. Key issues after verification:

  1. Merge conflicts — master's early-access.yaml, release.yaml, client/pom.xml, glibc.redef.aarch64, and gcc wrapper already contain ARM64 support from commit 99bd55d.

  2. Missing stat stat@GLIBC_2.17 entry — master added this in glibc.redef.aarch64 to handle GraalVM 25's direct stat() call against glibc 2.33+ headers. Without it, the ARM64 binary would require glibc 2.33 for stat().

  3. Re-adds macos-15-intel — removed on master because Oracle dropped macOS x64 support in GraalVM 25.0.2+.

  4. Retains (( 4 == ... )) ldd library count assertion — master removed this because GraalVM 25 with +StaticExecutableWithDynamicLibC only dynamically links libc.so.

  5. Design divergence — PR uses single gcc wrapper with uname -m detection; master uses separate gcc-aarch64 script.

Positive note: the PR's ARM64 verify regex [0-7] is more correct than master's [017] for matching glibc 2.10-2.17 versions — consider backporting this fix.

This PR should likely be closed as superseded, or rebased and reduced to only the release workflow ARM64 changes if those are still needed.

This review was generated by an AI agent and may contain inaccuracies. Please verify all suggestions before applying.

Claude Code on behalf of Guillaume Nodet

@gnodet gnodet left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

AI Review — Needs Rework ⚠️

This PR (created March 2026) adds Linux ARM64 native build support but has been largely superseded by commit 99bd55d (PR #1611, merged May 2026), which independently added ARM64 support with additional GraalVM 25 fixes. The PR is in CONFLICTING merge state and cannot be merged as-is.

Confirmed Issues

Functional (would cause CI failures):

  1. Hardcoded ls -1 for libjvm.a/liblibchelper.a — GraalVM 25 removed these files. Master already switched to find ... -name '*.a'. The patching step will fail.

  2. 4-library ldd assertion — GraalVM 25 with +StaticExecutableWithDynamicLibC only dynamically links libc.so. Master already removed this assertion. The verification step will fail.

  3. Missing stat stat@GLIBC_2.17 in glibc.redef.aarch64 — Master's version includes this line. Without it, the ARM64 binary would require glibc 2.33+ for stat() calls, breaking backward compatibility.

  4. Re-introduces macos-15-intel — Oracle dropped macOS x64 GraalVM support in 25.0.2+. Master intentionally removed this runner.

Design differences (merge conflicts):

  1. Profile renamed linux-image-only-require-glibc-2.12linux-amd64-... — master kept the original name.
  2. PR modifies shared gcc wrapper with uname -m detection — master uses a separate gcc-aarch64 script.
  3. dynamic-libc-start.c aarch64 directives already on master — redundant change.

What's Still Valuable

The release.yaml ARM64 additions (deploy assets, ARM64 patching/verification steps) are NOT on master and would still be needed. However, they require the same GraalVM 25 fixes before they can work.

Also, the PR's verify regex 2\.1[0-7] is actually more correct than master's 2\.1[017] (which misses versions 2.12-2.16).

Recommendation

Rebase onto current master, drop all superseded changes, and rework the release.yaml ARM64 additions to mirror early-access.yaml's working GraalVM 25 patterns.

This review was generated by an AI agent and may contain inaccuracies. Please verify all suggestions before applying.

Claude Code on behalf of Guillaume Nodet

@slachiewicz slachiewicz added the waiting-for-feedback Waiting for 90 days until issues or pull request will be closed label Aug 24, 2026
@slachiewicz
slachiewicz marked this pull request as draft August 24, 2026 19:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

waiting-for-feedback Waiting for 90 days until issues or pull request will be closed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants