Skip to content

Mac os/fix as build - #254

Open
ann0see wants to merge 5 commits into
mainfrom
macOS/fixASBuild
Open

Mac os/fix as build#254
ann0see wants to merge 5 commits into
mainfrom
macOS/fixASBuild

Conversation

@ann0see

@ann0see ann0see commented Jun 19, 2026

Copy link
Copy Markdown
Owner

Short description of changes

Fixes macOS Xcode build. Not yet 100% validated as this also does some potentially unrelated changes. The QT_ARCH variable wrongly contains x86 even on apple silicon.

CHANGELOG: Fix compilation errors on apple silicon via Xcode.
CHANGELOG:

Context: Fixes an issue?

Does this change need documentation? What needs to be documented and how?

Status of this Pull Request

What is missing until this pull request can be merged?

Checklist

  • I've verified that this Pull Request follows the general code principles
  • I tested my code and it does what I want
  • My code follows the style guide
  • I waited some time after this Pull Request was opened and all GitHub checks completed without errors.
  • I've filled all the content above

@ann0see
ann0see force-pushed the macOS/fixASBuild branch 2 times, most recently from 15ddc58 to 6d6e6a5 Compare June 19, 2026 21:16
@greptile-apps

greptile-apps Bot commented Jun 19, 2026

Copy link
Copy Markdown

Greptile Summary

This PR fixes macOS Apple Silicon Xcode builds by removing CONFIG += x86 from the macOS section (which was wrongly forcing QT_ARCH to x86_64 even on arm64 hardware) and updating the Opus ARM architecture detection to match arm64 instead of only arm64-v8a.

  • Removes CONFIG += x86 from the macx block so Apple Silicon is no longer misidentified as x86_64 by the Xcode generator, preventing the wrong SSE source paths from being selected.
  • Updates the Opus ARM NEON source/define logic to use arm64 throughout and adds a macx {} guard to skip explicit NEON code paths (which fail to compile on macOS) while still populating ARM headers and AARCH64 NEON defines.
  • Restructures x86 SSE source handling so SOURCES_OPUS_ARCH is always added first and selectively removed/replaced with per-flag compiler rules, removing the now-redundant macx-xcode special case.

Confidence Score: 4/5

The core fix (removing CONFIG += x86) is sound, but a new inconsistency in the ARM NEON define placement will likely cause a linker failure on the Apple Silicon target this PR is trying to fix.

The OPUS_ARM_PRESUME_NEON_INTR=1 define is set for all ARM builds including macOS ARM, but the NEON implementation files are intentionally excluded on macOS. With OPUS_HAVE_RTCD=1 also unconditionally set, the RTCD dispatcher will reference NEON intrinsic symbols that were never compiled, producing undefined-symbol link errors on Apple Silicon — the exact platform this PR targets.

Jamulus.pro lines 688–698: the ARM NEON define/source split around the macx guard needs a second look before this build can succeed on Apple Silicon.

Important Files Changed

Filename Overview
Jamulus.pro Fixes Apple Silicon Xcode build by removing CONFIG += x86 and updating ARM arch detection to arm64; introduces a new inconsistency where OPUS_ARM_PRESUME_NEON_INTR=1 is set for macOS ARM without the corresponding NEON source files being compiled.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[macx block] --> B{Remove CONFIG += x86}
    B --> C[QT_ARCH reports correctly]
    C --> D{QT_ARCH value}
    D -->|arm64 - Apple Silicon| E[ARM NEON block]
    D -->|x86_64 - Intel macOS| F[x86 SSE block]
    D -->|armeabi-v7a - Android ARMv7| E

    E --> G[HEADERS_OPUS_ARM added]
    E --> H[OPUS_ARM_PRESUME_NEON_INTR=1 set ⚠️]
    E --> I{macx?}
    I -->|Yes - macOS ARM| J[empty - no NEON sources compiled]
    I -->|No - Android/Linux ARM| K[SOURCES_OPUS_ARM added\nOPUS_ARM_PRESUME_NEON=1 set]
    E --> L{arm64?}
    L -->|Yes| M[OPUS_ARM_PRESUME_AARCH64_NEON_INTR set]

    F --> N[SOURCES += SOURCES_OPUS_ARCH]
    F --> O{msvc?}
    O -->|Yes| P[Keep SSE sources as-is]
    O -->|No| Q[SOURCES -= SOURCES_OPUS_ARCH\nQMAKE_EXTRA_COMPILERS with -msse flags]

    H -.->|Bug: define present without sources| J
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
    A[macx block] --> B{Remove CONFIG += x86}
    B --> C[QT_ARCH reports correctly]
    C --> D{QT_ARCH value}
    D -->|arm64 - Apple Silicon| E[ARM NEON block]
    D -->|x86_64 - Intel macOS| F[x86 SSE block]
    D -->|armeabi-v7a - Android ARMv7| E

    E --> G[HEADERS_OPUS_ARM added]
    E --> H[OPUS_ARM_PRESUME_NEON_INTR=1 set ⚠️]
    E --> I{macx?}
    I -->|Yes - macOS ARM| J[empty - no NEON sources compiled]
    I -->|No - Android/Linux ARM| K[SOURCES_OPUS_ARM added\nOPUS_ARM_PRESUME_NEON=1 set]
    E --> L{arm64?}
    L -->|Yes| M[OPUS_ARM_PRESUME_AARCH64_NEON_INTR set]

    F --> N[SOURCES += SOURCES_OPUS_ARCH]
    F --> O{msvc?}
    O -->|Yes| P[Keep SSE sources as-is]
    O -->|No| Q[SOURCES -= SOURCES_OPUS_ARCH\nQMAKE_EXTRA_COMPILERS with -msse flags]

    H -.->|Bug: define present without sources| J
Loading

Reviews (2): Last reviewed commit: "Update Jamulus.pro" | Re-trigger Greptile

Comment thread Jamulus.pro
Comment thread Jamulus.pro Outdated
Comment on lines 688 to 692
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

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 OPUS_ARM_PRESUME_AARCH64_NEON_INTR not set for arm64

The newly-added arm64 match sets OPUS_ARM_PRESUME_NEON=1 and OPUS_ARM_PRESUME_NEON_INTR=1, but OPUS_ARM_PRESUME_AARCH64_NEON_INTR on line 692 is conditional only on arm64-v8a. When Qt begins reporting arm64 correctly for Apple Silicon, the top-tier NEON optimization will be missed.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct. Needs to be fixed.

ann0see and others added 4 commits June 23, 2026 12:58
Co-authored-by: softins <softins@users.noreply.github.com>

Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>

Also change places where values are used

Fix formatting
…ngs-autofix/skillevel

Fix RGBCOL_R_SL_SL_* typo
Comment thread Jamulus.pro
@@ -1,4 +1,4 @@
VERSION = 3.12.1dev
VERSION = 3.12.2dev

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is safe.

Comment thread Jamulus.pro Outdated
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
DEFINES_OPUS += OPUS_ARM_PRESUME_NEON_INTR=1

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 OPUS_ARM_PRESUME_NEON_INTR=1 defined without its implementation files on Apple Silicon

DEFINES_OPUS += OPUS_ARM_PRESUME_NEON_INTR=1 is placed unconditionally at line 690 for all ARM architectures, including macOS (arm64). But the actual NEON intrinsic implementation files — pitch_neon_intr.c, celt_neon_intr.c, arm_celt_map.c, arm_silk_map.c, etc. — are only added to SOURCES_OPUS_ARCH inside the non-macx else block (line 695). With OPUS_HAVE_RTCD=1 also set (line 707), Opus RTCD dispatch will unconditionally point function pointers at these NEON intrinsic symbols (e.g. celt_pitch_xcorr_neon_intr). Since those translation units aren't compiled on macOS, the linker will fail with undefined references. The OPUS_ARM_PRESUME_NEON_INTR=1 define needs to be moved inside the else { } branch alongside OPUS_ARM_PRESUME_NEON=1 on line 696.

@ann0see
ann0see force-pushed the macOS/fixASBuild branch 2 times, most recently from a6db720 to 1d3c1be Compare June 25, 2026 20:56
Update Jamulus.pro

Update Jamulus.pro

Update Jamulus.pro
@ann0see
ann0see force-pushed the macOS/fixASBuild branch from 1d3c1be to bda1c1f Compare June 25, 2026 21:06
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.

2 participants