We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 5357 - SDL2 won't compile for Apple Silicon on macOS Big Sur
Summary: SDL2 won't compile for Apple Silicon on macOS Big Sur
Status: RESOLVED INVALID
Alias: None
Product: SDL
Classification: Unclassified
Component: atomic (show other bugs)
Version: 2.0.12
Hardware: x86 Other
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-11-19 04:22 UTC by Tom Kidd
Modified: 2020-11-26 01:58 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tom Kidd 2020-11-19 04:22:40 UTC
This is not a completely immediate concern since for the time being Apple Silicon running Big Sur can still run x86_64 code, but when I try and build a version of SDL 2.0.12 for "Any Mac (Apple Silicon, Intel)" the build fails. 

The line failing is in SDL_Spinlock.c, line 107, because it can't find the function named OSAtomicCompareAndSwap32Barrier.

My guess is that since this function was deprecated a few versions back, when they made the Apple Silicon version of Big Sur they just didn't bother implementing deprecated methods. The header file says something about using std::atomic_compare_exchange_strong but I'm not versed enough to know how to just drop that in. 

Anyway, thought you guys might like to know.
Comment 1 Sam Lantinga 2020-11-24 05:23:07 UTC
Is this fixed in the latest snapshot?
http://www.libsdl.org/SDL-2.0.zip
Comment 2 Tom Kidd 2020-11-25 22:41:18 UTC
My mistake - despite my best efforts to keep everything situated, somehow I was using a 2.0.10 source code snapshot instead of 2.0.12. 

It compiles correctly in 2.0.12 as well as the latest snapshot.
Comment 3 Sam Lantinga 2020-11-26 01:58:02 UTC
Glad to hear it. :)