fix: js2c compilation failure

https://chromium-review.googlesource.com/c/chromium/src/+/6950738

See patch description explaining MacOS 26 SDK headers incompatibility.
This commit is contained in:
Samuel Maddock
2025-10-08 10:51:44 -04:00
parent 2a0b77797d
commit 39e2470875
2 changed files with 29 additions and 0 deletions

View File

@@ -52,3 +52,4 @@ chore_exclude_electron_node_folder_from_exit-time-destructors.patch
api_remove_deprecated_getisolate.patch
src_switch_from_get_setprototype_to_get_setprototypev2.patch
fix_replace_deprecated_setprototype.patch
fix_js2c_including_mac_sdk_headers_twice.patch

View File

@@ -0,0 +1,28 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Samuel Maddock <smaddock@slack-corp.com>
Date: Wed, 8 Oct 2025 10:50:03 -0400
Subject: fix: js2c including mac sdk headers twice
https://chromium-review.googlesource.com/c/chromium/src/+/6950738
Chromium has set the minimum MacOS SDK version to 26. With this
change, it seems to introduce an incompatibility when compiling
using clang modules. Disabling them seems to resolve the issue.
diff --git a/unofficial.gni b/unofficial.gni
index a64d2e4ac475abc049fff7ea62ec76de565a747d..61aeac679a90832a1d9f559a4eb880362bce038d 100644
--- a/unofficial.gni
+++ b/unofficial.gni
@@ -350,6 +350,12 @@ template("node_gn_build") {
include_dirs = [ "src", "tools" ]
configs += [ "//build/config/compiler:no_exit_time_destructors" ]
+ # Fix for MacOSX26 SDK headers included twice due to usage of clang modules.
+ # Included once as a C header and again as C++.
+ if (is_mac) {
+ use_libcxx_modules = false
+ }
+
if (!is_win) {
defines += [ "NODE_JS2C_USE_STRING_LITERALS" ]
}