Commit 658f68d39c6 for nodejs

commit 658f68d39c69cba64467a77c70fb3287a533aeaf
Author: Joyee Cheung <joyeec9h3@gmail.com>
Date:   Mon Nov 16 22:37:36 2026 +0100

    build: fix GCC warnings when building V8 with gnu++20

    This silences the following warning from GCC:

    - deps/v8/src/base/flags.h: call to non-constexpr function
      `std::__atomic_base<unsigned char>::operator unsigned char() const`
      in the defaulted `constexpr Flags::operator==` when instantiated
      with `std::atomic<uint8_t>` storage [-Winvalid-constexpr]
    - deps/v8/include/v8-wasm.h: call to non-constexpr function
      `std::unique_ptr<const unsigned char[]>::get() const` in
      `constexpr OwnedBuffer::as_span()` [-Winvalid-constexpr]
    - deps/v8/src/execution/simulator.h: ‘nodebug’ attribute directive
      ignored [-Wattributes]

    Also move -fvisibility-inlines-hidden from cflags to cflags_cc in
    tools/v8_gypfiles/v8.gyp to fix the following warning.

      cc1: warning: command-line option '-fvisibility-inlines-hidden' is
      valid for C++/ObjC++ but not for C

    Signed-off-by: Joyee Cheung <joyeec9h3@gmail.com>
    PR-URL: https://github.com/nodejs/node/pull/67279
    Reviewed-By: James M Snell <jasnell@gmail.com>
    Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
    Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
    Reviewed-By: Stewart X Addison <sxa@redhat.com>
    Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day>

diff --git a/node.gyp b/node.gyp
index a462a9e9f2e..00e43b52052 100644
--- a/node.gyp
+++ b/node.gyp
@@ -561,6 +561,9 @@
     'conditions': [
       ['clang==0 and OS!="win"', {
         'cflags': [ '-Wno-restrict', ],
+        'cflags_cc': [
+          '-Wno-invalid-constexpr',
+        ],
       }],
       # TODO(joyeecheung): investigate if it breaks addons.
       # ['OS=="mac"', {
diff --git a/tools/v8_gypfiles/toolchain.gypi b/tools/v8_gypfiles/toolchain.gypi
index 058580f2ab4..645f19ca5c9 100644
--- a/tools/v8_gypfiles/toolchain.gypi
+++ b/tools/v8_gypfiles/toolchain.gypi
@@ -122,6 +122,13 @@
           # On by default in Clang and V8 requires it at least for arm64.
           '-flax-vector-conversions',
         ],
+        'cflags_cc': [
+          # TODO(joyeecheung): this may be removed after we switch to C++23
+          '-Wno-invalid-constexpr',
+          # V8 uses the clang-only nodebug attribute in
+          # src/execution/simulator.h, which GCC ignores with a warning.
+          '-Wno-attributes',
+        ],
       }],
       ['clang==1 or OS!="win"', {
         'cflags_cc': [
diff --git a/tools/v8_gypfiles/v8.gyp b/tools/v8_gypfiles/v8.gyp
index a3166cae562..b2cd6824779 100644
--- a/tools/v8_gypfiles/v8.gyp
+++ b/tools/v8_gypfiles/v8.gyp
@@ -75,6 +75,8 @@
       }, '(OS!="aix" and OS!="os400") and (OS!="win" or clang==1)', {
         'cflags': [
           '-fvisibility=hidden',
+        ],
+        'cflags_cc': [
           '-fvisibility-inlines-hidden'
         ],
       }],  # MSVC hides the non-public symbols by default so no need to configure it.