Skip to content

Respect configured -march when building libargon2 - #1247

Merged
crazywhalecc merged 1 commit into
v3from
fix/libargon2-portable-v3-2684
Oct 7, 2026
Merged

crazywhalecc merged 1 commit into
v3from
fix/libargon2-portable-v3-2684

Conversation

@henderkes

Copy link
Copy Markdown
Collaborator

Summary

Argon2's Makefile defaults OPTTARGET to native, which can compile host-specific instructions into redistributable binaries. Use the last -march in the library's configured CFLAGS. If none is set, pass OPTTARGET=none to select Argon2's portable implementation. Apply the same target to clean, build, and install.

This addresses the Argon2 SIGILL reported in php/frankenphp#2684. The same fix is already on feat/pgo-v3.

Verification

  • php -l src/Package/Library/libargon2.php
  • Built the pinned Argon2 source with OPTTARGET=none and ran its test suite successfully on aarch64.
  • Built it with -march=armv8-a / OPTTARGET=armv8-a and ran the test suite successfully.
  • Checked extraction of x86-64 and Arm -march values, multiple flags, and the unset fallback.

@henderkes
henderkes requested a review from crazywhalecc October 4, 2026 22:13
@crazywhalecc crazywhalecc added need-test This PR has not been tested yet, cannot merge now test/tier2 Trigger Tier 2 environment build test labels Oct 5, 2026
@github-actions

github-actions Bot commented Oct 5, 2026

Copy link
Copy Markdown

StaticPHP Test Bot

Detected: Extensions: none | Libraries: libargon2 | Targets: none
Active labels: test/tier2
Available labels: need-test (gate), test/linux test/windows test/macos (platform), test/tier2 (extra arch), test/php-83 test/php-84 (PHP version), sapi/frankenphp (extra FrankenPHP SAPI build)
Config: Linux x86_64 + Windows x86_64 + macOS arm64 + Linux aarch64 (Tier2) + macOS x86_64 (Tier2) | PHP 8.5 NTS

@crazywhalecc
crazywhalecc merged commit f60c636 into v3 Oct 7, 2026
47 of 57 checks passed
@crazywhalecc
crazywhalecc deleted the fix/libargon2-portable-v3-2684 branch October 7, 2026 07:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

need-test This PR has not been tested yet, cannot merge now test/tier2 Trigger Tier 2 environment build test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants