-
Notifications
You must be signed in to change notification settings - Fork 246
Fix QT_ARCH Apple Silicon build bug #3745
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
ann0see
wants to merge
1
commit into
jamulussoftware:main
Choose a base branch
from
ann0see:macOS/fixASBuild
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+16
−7
Draft
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -188,7 +188,6 @@ win32 { | |
|
|
||
| HEADERS += src/mac/activity.h src/mac/badgelabel.h | ||
| OBJECTIVE_SOURCES += src/mac/activity.mm src/mac/badgelabel.mm | ||
| CONFIG += x86 | ||
| QMAKE_TARGET_BUNDLE_PREFIX = app.jamulussoftware | ||
|
|
||
| OSX_ENTITLEMENTS.files = mac/Jamulus.entitlements | ||
|
|
@@ -686,20 +685,30 @@ SOURCES_OPUS_X86_SSE4 = libs/opus/celt/x86/celt_lpc_sse4_1.c \ | |
| libs/opus/silk/x86/VAD_sse4_1.c \ | ||
| libs/opus/silk/x86/VQ_WMat_EC_sse4_1.c | ||
|
|
||
| contains(QT_ARCH, armeabi-v7a) | contains(QT_ARCH, arm64-v8a) { | ||
| contains(QT_ARCH, armeabi-v7a) | contains(QT_ARCH, arm64-v8a) | contains(QT_ARCH, arm64) { | ||
| HEADERS_OPUS += $$HEADERS_OPUS_ARM | ||
| SOURCES_OPUS_ARCH += $$SOURCES_OPUS_ARM | ||
| DEFINES_OPUS += OPUS_ARM_PRESUME_NEON=1 OPUS_ARM_PRESUME_NEON_INTR=1 | ||
| contains(QT_ARCH, arm64-v8a):DEFINES_OPUS += OPUS_ARM_PRESUME_AARCH64_NEON_INTR | ||
| } else:contains(QT_ARCH, x86) | contains(QT_ARCH, x86_64) { | ||
| HEADERS_OPUS += $$HEADERS_OPUS_X86 | ||
| SOURCES_OPUS_ARCH += $$SOURCES_OPUS_X86_SSE $$SOURCES_OPUS_X86_SSE2 $$SOURCES_OPUS_X86_SSE4 | ||
| DEFINES_OPUS += OPUS_X86_MAY_HAVE_SSE OPUS_X86_MAY_HAVE_SSE2 OPUS_X86_MAY_HAVE_SSE4_1 | ||
| # x86_64 implies SSE2 | ||
| contains(QT_ARCH, x86_64):DEFINES_OPUS += OPUS_X86_PRESUME_SSE=1 OPUS_X86_PRESUME_SSE2=1 | ||
| !macx { | ||
| # x86_64 implies SSE2, macOS does not support it due to the current QT_ARCH being x86_64 on macOS even if compiled on apple silicon (as of 06/2026). | ||
| SOURCES_OPUS_ARCH += $$SOURCES_OPUS_X86_SSE $$SOURCES_OPUS_X86_SSE2 $$SOURCES_OPUS_X86_SSE4 | ||
| contains(QT_ARCH, x86_64):DEFINES_OPUS += OPUS_X86_PRESUME_SSE=1 OPUS_X86_PRESUME_SSE2=1 | ||
| } | ||
| DEFINES_OPUS += CPU_INFO_BY_C | ||
| } | ||
| DEFINES_OPUS += OPUS_BUILD=1 USE_ALLOCA=1 OPUS_HAVE_RTCD=1 HAVE_LRINTF=1 HAVE_LRINT=1 | ||
| DEFINES_OPUS += OPUS_BUILD=1 USE_ALLOCA=1 HAVE_LRINTF=1 HAVE_LRINT=1 | ||
|
|
||
| !macx | !contains(QT_ARCH, x86_64) { | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would hope that there is some variable which is definitely arm64 on apple silicon and x86 on intel... Then we could probably use it. |
||
| # all but x86 macOS. | ||
| # macOS fails unless disabled due to QT_ARCH being x86_64 even on apple silicon builds | ||
| DEFINES_OPUS += OPUS_HAVE_RTCD=1 | ||
| } else { | ||
| message(Skipping Opus RTCD due to incompatibility on macOS) | ||
| } | ||
|
|
||
| DISTFILES += ChangeLog \ | ||
| COMPILING.md \ | ||
|
|
@@ -1137,7 +1146,7 @@ contains(CONFIG, "opus_shared_lib") { | |
| DISTFILES += $$DISTFILES_OPUS | ||
|
|
||
| contains(QT_ARCH, x86) | contains(QT_ARCH, x86_64) { | ||
| msvc | macx-xcode { | ||
| msvc | macx { | ||
| # According to opus/win32/config.h, "no special compiler | ||
| # flags necessary" when using msvc. It always supports | ||
| # SSE intrinsics, but does not auto-vectorize. | ||
|
|
||
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will potentially enable vectorisation on arm64 devices.