Repository navigation
configure: build without SVE when SVE targets are disabled - #29
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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-sveis off), but the-marchflag can still enable SVE, for example with-march=nativeon 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'salways_inlinefunctions across that mismatch, so the static library fails to build:The compiler could also still emit SVE instructions outside Highway code.
Fix
When SVE targets are disabled and the
-marchflag enables SVE (__ARM_FEATURE_SVE),configureappends+nosveto the flag and warns that NEON is used. TheMARCH_FLAGsubstitution moves after the Arm block so it picks up the change. Nothing changes on non-aarch64 or when SVE is enabled.Testing
-march=armv9.2-a+sve2and SVE disabled failed before this change and builds as NEON after it.🤖 Generated with Claude Code