Skip to content

Only fetch sse2neon on ARM targets and pin it to v1.9.1 - #298

Open
Erica4fr wants to merge 1 commit into
HarbourMasters:mainfrom
Erica4fr:cmake/sse2neon-arm-only
Open

Erica4fr wants to merge 1 commit into
HarbourMasters:mainfrom
Erica4fr:cmake/sse2neon-arm-only

Conversation

@Erica4fr

Copy link
Copy Markdown

sse2neon.h is only used by src/audio/mixer.c on __aarch64__ (x86_64 takes the <emmintrin.h> path), but CMakeLists.txt downloaded it on every configure, on every platform, from refs/heads/master.

This PR:

  • only downloads it (and adds the include dir) when not targeting x86, or on Apple, since universal builds contain an arm64 slice. Other or empty CMAKE_SYSTEM_PROCESSOR values still download it, so ARM toolchains keep the current behavior;
  • pins the URL to the v1.9.1 release tag and checks it with EXPECTED_HASH, so the header can no longer change silently between builds.

Testing

  • Linux x86_64 (GCC 16.2.1, Ninja, Release): configure and full build succeed, and _deps/sse2neon is no longer created.
  • I evaluated the new condition with cmake -P. It skips the download for x86_64, AMD64, x86 and i686. It downloads for aarch64, arm64, ARM64, armv7l, ppc, an empty value, and Apple x86_64/arm64.
  • file(DOWNLOAD ... EXPECTED_HASH ...) succeeds with the pinned hash and fails as expected with a wrong one.
  • src/audio/mixer.c passes a syntax-only aarch64 check (clang --target=aarch64-linux-gnu -fsyntax-only) against both the current master header and v1.9.1, with no errors or warnings. I haven't done a full ARM build; the macOS universal CI job should cover that.

Note: v1.9.1 is 20 commits behind sse2neon's master, but all the SSE intrinsics used by mixer.c are available in v1.9.1.

sse2neon.h is only included by src/audio/mixer.c when building for
aarch64 (x86_64 uses <emmintrin.h>), but it was downloaded on every
configure for every platform, from the moving master branch.

- Skip the download on non-Apple x86 targets. Apple builds keep it,
  since universal builds include an arm64 slice. Other or unknown
  processors keep the previous behavior.
- Pin the download to the v1.9.1 release tag and verify it with
  EXPECTED_HASH, so the header cannot change between configures.
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