Skip to content

configure: build without SVE when SVE targets are disabled - #29

Merged
yohanchatelain merged 1 commit into
verificarlo:mainfrom
yohanchatelain:configure-nosve
Oct 8, 2026
Merged

yohanchatelain merged 1 commit into
verificarlo:mainfrom
yohanchatelain:configure-nosve

Conversation

@yohanchatelain

Copy link
Copy Markdown
Collaborator

Follow-up to #28. This fix was pushed to the #28 branch after #28 was merged, so it never reached main.

Problem

SVE targets are disabled by default (--enable-experimental-sve is off), but the -march flag can still enable SVE, for example with -march=native on an SVE CPU or an explicit --with-arch=armv9-a. Highway's static target is then NEON while the translation units are compiled for SVE. GCC refuses to inline Highway's always_inline functions across that mismatch, so the static library fails to build:

inlining failed in call to 'always_inline' ...: target specific option mismatch

The compiler could also still emit SVE instructions outside Highway code.

Fix

When SVE targets are disabled and the -march flag enables SVE (__ARM_FEATURE_SVE), configure appends +nosve to the flag and warns that NEON is used. The MARCH_FLAG substitution moves after the Arm block so it picks up the change. Nothing changes on non-aarch64 or when SVE is enabled.

Testing

  • GB10 (Cortex-X925/A725), GCC: the static build with -march=armv9.2-a+sve2 and SVE disabled failed before this change and builds as NEON after it.

🤖 Generated with Claude Code

When the --with-arch (or native) flag enables SVE but SVE targets are
disabled, Highway's static target is NEON while the translation units are
compiled for SVE. GCC then rejects inlining always_inline functions across
the target mismatch ("target specific option mismatch"), so the static
library failed to build; the compiler could also still emit SVE outside
Highway. Append +nosve to the -march flag in that case.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@yohanchatelain
yohanchatelain merged commit 0a65335 into verificarlo:main Oct 8, 2026
13 of 15 checks passed
@yohanchatelain
yohanchatelain deleted the configure-nosve branch October 8, 2026 15:16
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