Skip to content

macOS: add CpuTopology + SoLib to engine threading sources#3044

Open
tomjn wants to merge 1 commit into
beyond-all-reason:masterfrom
tomjn:macos/engine-threading-sources
Open

macOS: add CpuTopology + SoLib to engine threading sources#3044
tomjn wants to merge 1 commit into
beyond-all-reason:masterfrom
tomjn:macos/engine-threading-sources

Conversation

@tomjn

@tomjn tomjn commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

What

Adds Platform/Mac/CpuTopology.cpp and Platform/Linux/SoLib.cpp to sources_engine_System_Threading_Mac.

The macOS threading source list provided only Signal.cpp, whereas the Linux equivalent (sources_engine_System_Threading_Linux) also supplies CpuTopology and SoLib. Building spring-dedicated on macOS therefore failed at link:

Undefined symbols for architecture arm64:
  cpu_topology::GetProcessorCache() / GetProcessorMasks() / GetThreadPinPolicy()
  SoLib::SoLib(char const*) / SoLib::LoadFailed()
  • Platform/Mac/CpuTopology.cpp — the macOS cpu_topology implementation (added in the unitsync-build PR; this wires it into the engine threading sources too).
  • Platform/Linux/SoLib.cppdlopen-based shared-library loader; portable and used as-is on macOS (the Linux list groups it under threading).

Notes

  • Mac-only list — no effect on Linux/Windows.
  • Part of the macOS bring-up stack. With this (plus the companion macOS PRs), spring-dedicated builds and runs as a native arm64 binary under Homebrew GCC — verified locally.
  • Touches the same sources_engine_System_Threading_Mac block as the ThreadSupport PR (macOS: add ThreadSupport (no-op suspend/resume) #3036); whichever merges second needs a trivial context rebase.

The engine threading source list for macOS (sources_engine_System_Threading_Mac)
provided only Signal.cpp, while the Linux list also supplies CpuTopology
and SoLib. Building spring-dedicated on macOS therefore failed to link:

  Undefined symbols for architecture arm64:
    cpu_topology::GetProcessorCache() / GetProcessorMasks() / GetThreadPinPolicy()
    SoLib::SoLib(char const*) / SoLib::LoadFailed()

Add Platform/Mac/CpuTopology.cpp (the macOS cpu_topology implementation)
and Platform/Linux/SoLib.cpp (dlopen-based, portable to macOS) to the Mac
threading sources, mirroring the Linux list.

Mac-only list; no effect on Linux/Windows.

@sprunk sprunk left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Actually there is no CpuTopology.cpp yet so this depends on some other PR.

@sprunk sprunk added the big mac Part of the big push to support Mac. label Jun 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

big mac Part of the big push to support Mac.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants