-
Notifications
You must be signed in to change notification settings - Fork 71
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
New V8 cannot be compiled on macOS <15 (or Xcode <16) #295
Comments
Added a comment to the V8 CL: https://chromium-review.googlesource.com/c/v8/v8/+/6105430/comments/a5355091_20710ce9 |
As long as the deployment target is correctly set it should take the right path. I guess you're setting a deployment target >= 15 while building on a system with an older OS / SDK? |
The deployment target is fixed at 11.0: https://github.com/nodejs/node/blob/fd8de670da4d2a80e21e0f8a12ec7a6b0a13014d/common.gypi#L630 |
/cc @codebytere, @deepak1556 In case you run into issues for Electron. |
I just tried building the V8 main branch on macOS 13 and it seems it doesn't build with MacOSX13.3.sdk either. Is there any document about macOS SDK requirements for building V8? |
It seems in the V8 upstream, this args.gn:
Generates this command on macOS 13 that fails to compile
The important bits are
So the upstream is also targetting 11.0, it seems |
From what I can tell, neither
and diff --git a/src/base/platform/mutex.cc b/src/base/platform/mutex.cc
index 6abe218185f..59014d7eb03 100644
--- a/src/base/platform/mutex.cc
+++ b/src/base/platform/mutex.cc
@@ -103,8 +103,8 @@ static V8_INLINE void InitializeNativeHandle(os_unfair_lock* lock) {
// TODO(verwaest): We should use the constants from the header, but they aren't
// exposed until macOS 15.
-#define OS_UNFAIR_LOCK_DATA_SYNCHRONIZATION 0x00010000
-#define OS_UNFAIR_LOCK_ADAPTIVE_SPIN 0x00040000
+#define OS_UNFAIR_LOCK_DATA_SYNCHRONIZATION_V8 0x00010000
+#define OS_UNFAIR_LOCK_ADAPTIVE_SPIN_V8 0x00040000
typedef uint32_t os_unfair_lock_options_t;
@@ -115,18 +115,20 @@ os_unfair_lock_lock_with_options(os_unfair_lock* lock,
}
static V8_INLINE void LockNativeHandle(os_unfair_lock* lock) {
- if (__builtin_available(macOS 15, *)) {
+#ifdef OS_UNFAIR_LOCK_DATA_SYNCHRONIZATION
const os_unfair_lock_flags_t options = static_cast<os_unfair_lock_flags_t>(
- OS_UNFAIR_LOCK_DATA_SYNCHRONIZATION | OS_UNFAIR_LOCK_ADAPTIVE_SPIN);
+ OS_UNFAIR_LOCK_DATA_SYNCHRONIZATION_V8 | OS_UNFAIR_LOCK_ADAPTIVE_SPIN_V8);
os_unfair_lock_lock_with_flags(lock, options);
- } else if (os_unfair_lock_lock_with_options) {
+#else
+ if (os_unfair_lock_lock_with_options) {
const os_unfair_lock_options_t options =
static_cast<os_unfair_lock_options_t>(
- OS_UNFAIR_LOCK_DATA_SYNCHRONIZATION | OS_UNFAIR_LOCK_ADAPTIVE_SPIN);
+ OS_UNFAIR_LOCK_DATA_SYNCHRONIZATION_V8 | OS_UNFAIR_LOCK_ADAPTIVE_SPIN_V8);
os_unfair_lock_lock_with_options(lock, options);
} else {
os_unfair_lock_lock(lock);
}
+#endif
}
static V8_INLINE void UnlockNativeHandle(os_unfair_lock* lock) { |
Thanks @targos For electron we match the sdk version to mac_sdk_official_version from the branch we are building.
When building with system xcode the minimum supported sdk version is picked from https://source.chromium.org/chromium/chromium/src/+/main:build/config/mac/mac_sdk_overrides.gni which I don't see being overriden by //v8, but based on the above seems like the requirements should be bumped ? |
See https://github.com/nodejs/node-v8/actions/runs/12412846251/job/34653486549
I can cannot reproduce this error locally with macOS 15.2 (Xcode 16.2).
The code was introduced in https://chromium-review.googlesource.com/c/v8/v8/+/6105430.
Relevant lines: https://github.com/v8/v8/blob/da4e529cfddb93e7166666c447a94d173e1e682f/src/base/platform/mutex.cc#L118-L122
The text was updated successfully, but these errors were encountered: