-
Notifications
You must be signed in to change notification settings - Fork 188
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
Unbreak build for macOS < 10.12 #1732
base: develop
Are you sure you want to change the base?
Conversation
I have finally figured out how to fix running tests, and now everything works:
|
@@ -1058,7 +1058,7 @@ int csoundSpinLockInit(spin_lock_t *spinlock) { | |||
|
|||
#elif defined(MACOSX) // MacOS native locks | |||
|
|||
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12 |
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.
more compatible is this:
#if MAC_OS_X_VERSION_MIN_REQUIRED >= 101200
as it works even if MAC_OS_X_VERSION_10_12 is not defined.
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.
Yes, I prefer numerical macros too, but for some reason not everyone is okay with them (we could not convince Ruby
upstream, for example, and still carry our patch).
Wait a bit, there is a proper fix for Altivec advised by @pkubaj which seems to work fine: #1733 (comment) |
Where are with this? Some conflicts have emerged since the PR was open. Let me know the status. |
The C++11 stuff is outdated. There are more modern ways of setting it which we do now so that can be removed. The other stuff is maybe still relevant. |
@vlazzarini @stekyne Let me review this today and rebase. |
The PR fixes three issues:
Existing macros used for fallbacks on macOS do exactly the opposite of what they are thought to, because
MAC_OS_X_VERSION_10_12
is not defined on, well, macOS < 10.12, so the condition compares a positive number to zero:MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12
In result, everything that should not be used on older macOS is applied, and build is broken.
Less ugly alternative would be
MAC_OS_X_VERSION_MIN_REQUIRED >= 101200
, which gonna work correctly, but I know some people wanna avoid magic numbers :)Existing Altivec implementation breaks down spectacularly on Darwin PowerPC. This is not an area I know in any detail, so I cannot say why it fails. Maybe it is something feasibly if not trivially fixable. But unless it is fixed, rather disable it on Apple.
CMakeLists hardcode
libc++
flags, which breaks builds with GCC. I do not know if Clang even needs an explicit flag, but GCC is smart enough to add its primary runtime. Restrict the flag to Clang.Also, since the current CMake policy uses
AppleClang
for Xcode Clangs,MATCHES
should be used instead ofSTREQUAL
. (Unless, of course, the idea was to exclude Apple Clangs from Clangs for w/e reason.)