Open jdm opened 1 month ago
Just removing the __builtin_available check results in:
In file included from Unified_cpp_js_src_jit9.cpp:29:
/Users/jdm/src/mozjs/mozjs-sys/mozjs/js/src/jit/ProcessExecutableMemory.cpp:1010:3: error: 'pthread_jit_write_protect_np' is only available on macOS 11.0 or newer [-Werror,-Wunguarded-availability-new]
pthread_jit_write_protect_np(executable);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/usr/include/pthread.h:588:6: note: 'pthread_jit_write_protect_np' has been marked as being introduced in macOS 11.0 here, but the deployment target is macOS 10.10.0
void pthread_jit_write_protect_np(int enabled);
^
/Users/jdm/src/mozjs/mozjs-sys/mozjs/js/src/jit/ProcessExecutableMemory.cpp:1010:3: note: enclose 'pthread_jit_write_protect_np' in a __builtin_available check to silence this warning
pthread_jit_write_protect_np(executable);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
Strangely, https://github.com/servo/mozjs/blob/10fb074ab11756444e8b0f69e4cbed8d6462e3ae/mozjs-sys/mozjs/build/moz.configure/toolchain.configure#L54-L66 looks like it should be setting a 11.0 deployment target in this case, and I have no idea where the 10.10 value comes from.
I am able to build after removing the __builtin_available check with ./mach clean
and MACOSX_DEPLOYMENT_TARGET=11.0
.
Servo is setting the MACOSX_DEPLOYMENT_TARGET to 10.10
in .cargo/config.toml
. I believe this was previously set in the environment by mach
.
Then we should probably set MACOSX_DEPLOYMENT_TARGET
in mozjs-sys and remove __builtin_available
check.
Shouldn't we just bump MACOSX_DEPLOYMENT_TARGET
in servo? The oldest available version in github CI is macOS-12, so I don't think we can even test at all if servo can actually run on 10.10.
When building mozjs on macOS arm64, I intermittently receive linker errors like this:
There is one use of this function in mozjs: https://github.com/servo/mozjs/blob/10fb074ab11756444e8b0f69e4cbed8d6462e3ae/mozjs-sys/mozjs/js/src/jit/ProcessExecutableMemory.cpp#L1010
The most recent spidermonkey upgrade removed a patch that removed a previous use of __builtinAvailable: https://github.com/servo/mozjs/commit/bf41ed080ec3c2fb84a53928c7db7691b0a0b161#diff-5c427df1c88acdb6a3478df156bdd162ecf6bc6abd7231cfdec3b4ccb5a35138L1
https://github.com/curl/curl/issues/4314 suggests that the issue here is that __builtinAvailable is only available in dynamic libraries, but we're building a static library. I have no idea why I would only hit this intermittently, or why CI never appears to run into this problem.