Back to home page

EIC code displayed by LXR

 
 

    


Warning, /include/node/common.gypi is written in an unsupported language. File is not indexed.

0001 {
0002   'variables': {
0003     'configuring_node%': 0,
0004     'asan%': 0,
0005     'ubsan%': 0,
0006     'visibility%': 'hidden',          # V8's visibility setting
0007     'target_arch%': 'ia32',           # set v8's target architecture
0008     'host_arch%': 'ia32',             # set v8's host architecture
0009     'want_separate_host_toolset%': 0, # V8 should not build target and host
0010     'library%': 'static_library',     # allow override to 'shared_library' for DLL/.so builds
0011     'component%': 'static_library',   # NB. these names match with what V8 expects
0012     'msvs_multi_core_compile': '0',   # we do enable multicore compiles, but not using the V8 way
0013     'enable_pgo_generate%': '0',
0014     'enable_pgo_use%': '0',
0015     'python%': 'python',
0016 
0017     'node_shared%': 'false',
0018     'force_dynamic_crt%': 0,
0019     'node_use_v8_platform%': 'true',
0020     'node_use_bundled_v8%': 'true',
0021     'node_module_version%': '',
0022     'node_with_ltcg%': '',
0023     'node_shared_openssl%': 'false',
0024 
0025     'node_tag%': '',
0026     'uv_library%': 'static_library',
0027 
0028     'clang%': 0,
0029     'error_on_warn%': 'false',
0030     'suppress_all_error_on_warn%': 'false',
0031     'control_flow_guard%': 'false',
0032 
0033     'openssl_product': '<(STATIC_LIB_PREFIX)openssl<(STATIC_LIB_SUFFIX)',
0034     'openssl_no_asm%': 0,
0035 
0036     # Don't use ICU data file (icudtl.dat) from V8, we use our own.
0037     'icu_use_data_file_flag%': 0,
0038 
0039     # Reset this number to 0 on major V8 upgrades.
0040     # Increment by one for each non-official patch applied to deps/v8.
0041     'v8_embedder_string': '-node.37',
0042 
0043     ##### V8 defaults for Node.js #####
0044 
0045     # Turn on SipHash for hash seed generation, addresses HashWick
0046     'v8_use_siphash': 'true',
0047 
0048     # These are more relevant for V8 internal development.
0049     # Refs: https://github.com/nodejs/node/issues/23122
0050     # Refs: https://github.com/nodejs/node/issues/23167
0051     # Enable compiler warnings when using V8_DEPRECATED apis from V8 code.
0052     'v8_deprecation_warnings': 0,
0053     # Enable compiler warnings when using V8_DEPRECATE_SOON apis from V8 code.
0054     'v8_imminent_deprecation_warnings': 0,
0055 
0056     # Enable disassembler for `--print-code` v8 options
0057     'v8_enable_disassembler': 1,
0058 
0059     # Sets -dOBJECT_PRINT.
0060     'v8_enable_object_print%': 1,
0061 
0062     # https://github.com/nodejs/node/pull/22920/files#r222779926
0063     'v8_enable_handle_zapping': 0,
0064 
0065     # Disable pointer compression. Can be enabled at build time via configure
0066     # options but default values are required here as this file is also used by
0067     # node-gyp to build addons.
0068     'v8_enable_pointer_compression%': 0,
0069     'v8_enable_31bit_smis_on_64bit_arch%': 0,
0070 
0071     # Disable v8 hugepage by default.
0072     'v8_enable_hugepage%': 0,
0073 
0074     # This is more of a V8 dev setting
0075     # https://github.com/nodejs/node/pull/22920/files#r222779926
0076     'v8_enable_fast_mksnapshot': 0,
0077 
0078     'v8_win64_unwinding_info': 1,
0079 
0080     # Variables controlling external defines exposed in public headers.
0081     'v8_enable_conservative_stack_scanning%': 0,
0082     'v8_enable_direct_local%': 0,
0083     'v8_enable_map_packing%': 0,
0084     'v8_enable_pointer_compression_shared_cage%': 0,
0085     'v8_enable_external_code_space%': 0,
0086     'v8_enable_sandbox%': 0,
0087     'v8_enable_v8_checks%': 0,
0088     'v8_enable_zone_compression%': 0,
0089     'v8_use_perfetto': 0,
0090     'tsan%': 0,
0091 
0092     ##### end V8 defaults #####
0093 
0094     'conditions': [
0095       ['OS == "win"', {
0096         'os_posix': 0,
0097         'v8_postmortem_support%': 0,
0098         'obj_dir': '<(PRODUCT_DIR)/obj',
0099         'v8_base': '<(PRODUCT_DIR)/lib/libv8_snapshot.a',
0100       }, {
0101         'os_posix': 1,
0102         'v8_postmortem_support%': 1,
0103       }],
0104       ['GENERATOR == "ninja"', {
0105         'obj_dir': '<(PRODUCT_DIR)/obj',
0106         'v8_base': '<(PRODUCT_DIR)/obj/tools/v8_gypfiles/libv8_snapshot.a',
0107       }, {
0108         'obj_dir%': '<(PRODUCT_DIR)/obj.target',
0109         'v8_base': '<(PRODUCT_DIR)/obj.target/tools/v8_gypfiles/libv8_snapshot.a',
0110       }],
0111       ['OS=="mac"', {
0112         'obj_dir%': '<(PRODUCT_DIR)/obj.target',
0113         'v8_base': '<(PRODUCT_DIR)/libv8_snapshot.a',
0114       }],
0115       # V8 pointer compression only supports 64bit architectures.
0116       ['target_arch in "arm ia32 mips mipsel"', {
0117         'v8_enable_pointer_compression': 0,
0118         'v8_enable_pointer_compression_shared_cage': 0,
0119         'v8_enable_31bit_smis_on_64bit_arch': 0,
0120         'v8_enable_external_code_space': 0,
0121         'v8_enable_sandbox': 0
0122       }],
0123       ['target_arch in "ppc64 s390x"', {
0124         'v8_enable_backtrace': 1,
0125       }],
0126       ['OS=="linux" or OS=="openharmony"', {
0127         'node_section_ordering_info%': ''
0128       }],
0129       ['OS == "zos"', {
0130         # use ICU data file on z/OS
0131         'icu_use_data_file_flag%': 1
0132       }]
0133     ],
0134   },
0135 
0136   'target_defaults': {
0137     'default_configuration': 'Release',
0138     'configurations': {
0139       'Debug': {
0140         'variables': {
0141           'v8_enable_handle_zapping': 1,
0142           'conditions': [
0143             ['node_shared != "true"', {
0144               'MSVC_runtimeType': 1,    # MultiThreadedDebug (/MTd)
0145             }, {
0146               'MSVC_runtimeType': 3,    # MultiThreadedDebugDLL (/MDd)
0147             }],
0148           ],
0149         },
0150         'defines': [ 'DEBUG', '_DEBUG' ],
0151         'cflags': [ '-g', '-O0' ],
0152         'conditions': [
0153           ['OS in "aix os400"', {
0154             'cflags': [ '-gxcoff' ],
0155             'ldflags': [ '-Wl,-bbigtoc' ],
0156           }],
0157           ['OS == "android"', {
0158             'cflags': [ '-fPIC' ],
0159             'ldflags': [ '-fPIC' ]
0160           }],
0161           ['clang==1', {
0162             'msbuild_toolset': 'ClangCL',
0163           }],
0164         ],
0165         'msvs_settings': {
0166           'VCCLCompilerTool': {
0167             'BasicRuntimeChecks': 3,        # /RTC1
0168             'MinimalRebuild': 'false',
0169             'OmitFramePointers': 'false',
0170             'Optimization': 0,              # /Od, no optimization
0171             'RuntimeLibrary': '<(MSVC_runtimeType)',
0172           },
0173           'VCLinkerTool': {
0174             'LinkIncremental': 2, # enable incremental linking
0175           },
0176         },
0177         'xcode_settings': {
0178           'GCC_OPTIMIZATION_LEVEL': '0', # stop gyp from defaulting to -Os
0179         },
0180       },
0181       'Release': {
0182         'variables': {
0183           'v8_enable_handle_zapping': 0,
0184           'pgo_generate': ' -fprofile-generate ',
0185           'pgo_use': ' -fprofile-use -fprofile-correction ',
0186           'conditions': [
0187             ['node_shared != "true"', {
0188               'MSVC_runtimeType': 0    # MultiThreaded (/MT)
0189             }, {
0190               'MSVC_runtimeType': 2   # MultiThreadedDLL (/MD)
0191             }],
0192             ['clang==1', {
0193               'lto': ' -flto ', # Clang
0194             }, {
0195               'lto': ' -flto=4 -fuse-linker-plugin -ffat-lto-objects ', # GCC
0196             }],
0197           ],
0198         },
0199         'cflags': [ '-O3' ],
0200         'conditions': [
0201           ['enable_lto=="true"', {
0202             'cflags': ['<(lto)'],
0203             'ldflags': ['<(lto)'],
0204             'xcode_settings': {
0205               'LLVM_LTO': 'YES',
0206             },
0207           }],
0208           ['OS=="linux" or OS=="openharmony"', {
0209             'conditions': [
0210               ['node_section_ordering_info!=""', {
0211                 'cflags': [
0212                   '-fuse-ld=gold',
0213                   '-ffunction-sections',
0214                 ],
0215                 'ldflags': [
0216                   '-fuse-ld=gold',
0217                   '-Wl,--section-ordering-file=<(node_section_ordering_info)',
0218                 ],
0219               }],
0220             ],
0221           }],
0222           ['OS=="solaris"', {
0223             # pull in V8's postmortem metadata
0224             'ldflags': [ '-Wl,-z,allextract' ]
0225           }],
0226           ['OS=="zos"', {
0227             # increase performance, number from experimentation
0228             'cflags': [ '-qINLINE=::150:100000' ]
0229           }],
0230           ['OS!="mac" and OS!="win" and OS!="zos"', {
0231             # -fno-omit-frame-pointer is necessary for the --perf_basic_prof
0232             # flag to work correctly. perf(1) gets confused about JS stack
0233             # frames otherwise, even with --call-graph dwarf.
0234             'cflags': [ '-fno-omit-frame-pointer' ],
0235           }],
0236           ['OS=="linux" or OS=="openharmony"', {
0237             'conditions': [
0238               ['enable_pgo_generate=="true"', {
0239                 'cflags': ['<(pgo_generate)'],
0240                 'ldflags': ['<(pgo_generate)'],
0241               },],
0242               ['enable_pgo_use=="true"', {
0243                 'cflags': ['<(pgo_use)'],
0244                 'ldflags': ['<(pgo_use)'],
0245               },],
0246             ],
0247           },],
0248           ['OS == "android"', {
0249             'cflags': [ '-fPIC', '-I<(android_ndk_path)/sources/android/cpufeatures' ],
0250             'ldflags': [ '-fPIC' ]
0251           }],
0252           ['clang==1', {
0253             'msbuild_toolset': 'ClangCL',
0254           }],
0255         ],
0256         'msvs_settings': {
0257           'VCCLCompilerTool': {
0258             'conditions': [
0259               ['target_arch=="arm64"', {
0260                 'FloatingPointModel': 1 # /fp:strict
0261               }]
0262             ],
0263             'EnableFunctionLevelLinking': 'true',
0264             'EnableIntrinsicFunctions': 'true',
0265             'FavorSizeOrSpeed': 1,          # /Ot, favor speed over size
0266             'InlineFunctionExpansion': 2,   # /Ob2, inline anything eligible
0267             'OmitFramePointers': 'true',
0268             'Optimization': 3,              # /Ox, full optimization
0269             'RuntimeLibrary': '<(MSVC_runtimeType)',
0270             'RuntimeTypeInfo': 'false',
0271           }
0272         },
0273         'xcode_settings': {
0274           'GCC_OPTIMIZATION_LEVEL': '3', # stop gyp from defaulting to -Os
0275         },
0276       }
0277     },
0278 
0279     # Defines these mostly for node-gyp to pickup.
0280     'defines': [
0281       '_GLIBCXX_USE_CXX11_ABI=1',
0282       # This help forks when building Node.js on a 32-bit arch as
0283       # libuv is always compiled with _FILE_OFFSET_BITS=64
0284       '_FILE_OFFSET_BITS=64'
0285     ],
0286 
0287     # Forcibly disable -Werror.  We support a wide range of compilers, it's
0288     # simply not feasible to squelch all warnings, never mind that the
0289     # libraries in deps/ are not under our control.
0290     'conditions': [
0291       [ 'error_on_warn=="false"', {
0292         'cflags!': ['-Werror'],
0293       }, '(_target_name!="<(node_lib_target_name)" or '
0294           '_target_name!="<(node_core_target_name)")', {
0295         'cflags!': ['-Werror'],
0296       }],
0297     ],
0298     'msvs_settings': {
0299       'VCCLCompilerTool': {
0300         # TODO(targos): Remove condition and always use LanguageStandard options
0301         # once node-gyp supports them.
0302         'conditions': [
0303           ['clang==1', {
0304             'LanguageStandard': 'stdcpp20',
0305             'LanguageStandard_C': 'stdc11',
0306             'AdditionalOptions': [
0307               '/Zc:__cplusplus',
0308               # The following option reduces the "error C1060: compiler is out of heap space"
0309               '/Zm2000',
0310             ],
0311           }, {
0312             'AdditionalOptions': [
0313               '/Zc:__cplusplus',
0314               # The following option enables c++20 on Windows. This is needed for V8 v12.4+
0315               '-std:c++20',
0316               # The following option reduces the "error C1060: compiler is out of heap space"
0317               '/Zm2000',
0318             ],
0319           }],
0320           ['control_flow_guard=="true"', {
0321             'AdditionalOptions': [
0322               '/guard:cf',                        # Control Flow Guard
0323             ],
0324           }],
0325         ],
0326         'BufferSecurityCheck': 'true',
0327         'DebugInformationFormat': 1,          # /Z7 embed info in .obj files
0328         'ExceptionHandling': 0,               # /EHsc
0329         'MultiProcessorCompilation': 'true',
0330         'StringPooling': 'true',              # pool string literals
0331         'SuppressStartupBanner': 'true',
0332         'WarnAsError': 'false',
0333         'WarningLevel': 3,                    # /W3
0334       },
0335       'VCLinkerTool': {
0336         'target_conditions': [
0337           ['_type=="executable"', {
0338             'SubSystem': 1,                   # /SUBSYSTEM:CONSOLE
0339           }],
0340         ],
0341         'conditions': [
0342           ['target_arch=="ia32"', {
0343             'TargetMachine' : 1,              # /MACHINE:X86
0344           }],
0345           ['target_arch=="x64"', {
0346             'TargetMachine' : 17,             # /MACHINE:X64
0347           }],
0348           ['target_arch=="arm64"', {
0349             'TargetMachine' : 0,              # NotSet. MACHINE:ARM64 is inferred from the input files.
0350           }],
0351           ['control_flow_guard=="true"', {
0352             'AdditionalOptions': [
0353               '/guard:cf',                        # Control Flow Guard
0354             ],
0355           }],
0356         ],
0357         'GenerateDebugInformation': 'true',
0358         'SuppressStartupBanner': 'true',
0359       },
0360     },
0361     # Disable warnings:
0362     # - "C4251: class needs to have dll-interface"
0363     # - "C4275: non-DLL-interface used as base for DLL-interface"
0364     #   Over 10k of these warnings are generated when compiling node,
0365     #   originating from v8.h. Most of them are false positives.
0366     #   See also: https://github.com/nodejs/node/pull/15570
0367     #   TODO: re-enable when Visual Studio fixes these upstream.
0368     #
0369     # - "C4267: conversion from 'size_t' to 'int'"
0370     #   Many any originate from our dependencies, and their sheer number
0371     #   drowns out other, more legitimate warnings.
0372     # - "C4244: conversion from 'type1' to 'type2', possible loss of data"
0373     #   Ususaly safe. Disable for `dep`, enable for `src`
0374     'msvs_disabled_warnings': [4351, 4355, 4800, 4251, 4275, 4244, 4267],
0375     'msvs_cygwin_shell': 0, # prevent actions from trying to use cygwin
0376 
0377     'conditions': [
0378       [ 'configuring_node', {
0379         'msvs_configuration_attributes': {
0380           'OutputDirectory': '<(DEPTH)/out/$(Configuration)/',
0381           'IntermediateDirectory': '$(OutDir)obj/$(ProjectName)/'
0382         },
0383       }],
0384       [ 'target_arch=="x64"', {
0385         'msvs_configuration_platform': 'x64',
0386       }],
0387       [ 'target_arch=="arm64"', {
0388         'msvs_configuration_platform': 'arm64',
0389       }],
0390       ['asan == 1 and OS != "mac" and OS != "zos"', {
0391         'cflags+': [
0392           '-fno-omit-frame-pointer',
0393           '-fsanitize=address',
0394           '-fsanitize-address-use-after-scope',
0395         ],
0396         'defines': [ 'LEAK_SANITIZER', 'V8_USE_ADDRESS_SANITIZER' ],
0397         'cflags!': [ '-fomit-frame-pointer' ],
0398         'ldflags': [ '-fsanitize=address' ],
0399       }],
0400       ['asan == 1 and OS == "mac"', {
0401         'xcode_settings': {
0402           'OTHER_CFLAGS+': [
0403             '-fno-omit-frame-pointer',
0404             '-gline-tables-only',
0405             '-fsanitize=address',
0406             '-DLEAK_SANITIZER'
0407           ],
0408           'OTHER_CFLAGS!': [
0409             '-fomit-frame-pointer',
0410           ],
0411         },
0412         'target_conditions': [
0413           ['_type!="static_library"', {
0414             'xcode_settings': {'OTHER_LDFLAGS': ['-fsanitize=address']},
0415           }],
0416         ],
0417       }],
0418       ['ubsan == 1 and OS != "mac" and OS != "zos"', {
0419         'cflags+': [
0420           '-fno-omit-frame-pointer',
0421           '-fsanitize=undefined',
0422         ],
0423         'defines': [ 'UNDEFINED_SANITIZER'],
0424         'cflags!': [ '-fno-omit-frame-pointer' ],
0425         'ldflags': [ '-fsanitize=undefined' ],
0426       }],
0427       ['ubsan == 1 and OS == "mac"', {
0428         'xcode_settings': {
0429           'OTHER_CFLAGS+': [
0430             '-fno-omit-frame-pointer',
0431             '-fsanitize=undefined',
0432             '-DUNDEFINED_SANITIZER'
0433           ],
0434         },
0435         'target_conditions': [
0436           ['_type!="static_library"', {
0437             'xcode_settings': {'OTHER_LDFLAGS': ['-fsanitize=undefined']},
0438           }],
0439         ],
0440       }],
0441       # The defines bellow must include all things from the external_v8_defines
0442       # list in v8/BUILD.gn.
0443       ['v8_enable_v8_checks == 1', {
0444         'defines': ['V8_ENABLE_CHECKS'],
0445       }],
0446       ['v8_enable_pointer_compression == 1', {
0447         'defines': ['V8_COMPRESS_POINTERS'],
0448       }],
0449       ['v8_enable_pointer_compression == 1 and v8_enable_pointer_compression_shared_cage != 1', {
0450         'defines': ['V8_COMPRESS_POINTERS_IN_MULTIPLE_CAGES'],
0451       }],
0452       ['v8_enable_pointer_compression_shared_cage == 1', {
0453         'defines': ['V8_COMPRESS_POINTERS_IN_SHARED_CAGE'],
0454       }],
0455       ['v8_enable_pointer_compression == 1 or v8_enable_31bit_smis_on_64bit_arch == 1', {
0456         'defines': ['V8_31BIT_SMIS_ON_64BIT_ARCH'],
0457       }],
0458       ['v8_enable_zone_compression == 1', {
0459         'defines': ['V8_COMPRESS_ZONES',],
0460       }],
0461       ['v8_enable_sandbox == 1', {
0462         'defines': ['V8_ENABLE_SANDBOX',],
0463       }],
0464       ['v8_enable_external_code_space == 1', {
0465         'defines': ['V8_EXTERNAL_CODE_SPACE',],
0466       }],
0467       ['v8_deprecation_warnings == 1', {
0468         'defines': ['V8_DEPRECATION_WARNINGS',],
0469       }],
0470       ['v8_imminent_deprecation_warnings == 1', {
0471         'defines': ['V8_IMMINENT_DEPRECATION_WARNINGS',],
0472       }],
0473       ['v8_use_perfetto == 1', {
0474         'defines': ['V8_USE_PERFETTO',],
0475       }],
0476       ['v8_enable_map_packing == 1', {
0477         'defines': ['V8_MAP_PACKING',],
0478       }],
0479       ['tsan == 1', {
0480         'defines': ['V8_IS_TSAN',],
0481       }],
0482       ['v8_enable_conservative_stack_scanning == 1', {
0483         'defines': ['V8_ENABLE_CONSERVATIVE_STACK_SCANNING',],
0484       }],
0485       ['v8_enable_direct_local == 1', {
0486         'defines': ['V8_ENABLE_DIRECT_LOCAL',],
0487       }],
0488       ['OS == "win"', {
0489         'defines': [
0490           'WIN32',
0491           # we don't really want VC++ warning us about
0492           # how dangerous C functions are...
0493           '_CRT_SECURE_NO_DEPRECATE',
0494           # ... or that C implementations shouldn't use
0495           # POSIX names
0496           '_CRT_NONSTDC_NO_DEPRECATE',
0497           # Make sure the STL doesn't try to use exceptions
0498           '_HAS_EXCEPTIONS=0',
0499           'BUILDING_V8_SHARED=1',
0500           'BUILDING_UV_SHARED=1',
0501           # Stop <windows.h> from defining macros that conflict with
0502           # std::min() and std::max().  We don't use <windows.h> (much)
0503           # but we still inherit it from uv.h.
0504           'NOMINMAX',
0505         ],
0506       }],
0507       [ 'OS in "linux freebsd openbsd solaris aix os400 openharmony"', {
0508         'cflags': [ '-pthread' ],
0509         'ldflags': [ '-pthread' ],
0510       }],
0511       [ 'OS in "linux freebsd openbsd solaris android aix os400 cloudabi openharmony"', {
0512         'cflags': [ '-Wall', '-Wextra', '-Wno-unused-parameter', ],
0513         'cflags_cc': [
0514           '-fno-rtti',
0515           '-fno-exceptions',
0516           '-fno-strict-aliasing',
0517           '-std=gnu++20',
0518         ],
0519         'defines': [ '__STDC_FORMAT_MACROS' ],
0520         'ldflags': [ '-rdynamic' ],
0521         'target_conditions': [
0522           # The 1990s toolchain on SmartOS can't handle thin archives.
0523           ['_type=="static_library" and OS=="solaris"', {
0524             'standalone_static_library': 1,
0525           }],
0526           ['OS=="openbsd"', {
0527             'cflags': [ '-I/usr/local/include' ],
0528             'ldflags': [ '-Wl,-z,wxneeded' ],
0529           }],
0530           ['_toolset=="host"', {
0531             'conditions': [
0532               [ 'host_arch=="ia32"', {
0533                 'cflags': [ '-m32' ],
0534                 'ldflags': [ '-m32' ],
0535               }],
0536               [ 'host_arch=="x64"', {
0537                 'cflags': [ '-m64' ],
0538                 'ldflags': [ '-m64' ],
0539               }],
0540               [ 'host_arch=="ppc64" and OS not in "aix os400"', {
0541                 'conditions': [
0542                   [ 'clang==0', {
0543                     'cflags': [ '-mminimal-toc' ],
0544                   }],
0545                 ],
0546                 'cflags': [ '-m64' ],
0547                 'ldflags': [ '-m64' ],
0548               }],
0549               [ 'host_arch=="s390x" and OS=="linux"', {
0550                 'cflags': [ '-m64', '-march=z196' ],
0551                 'ldflags': [ '-m64', '-march=z196' ],
0552               }],
0553             ],
0554           }],
0555           ['_toolset=="target"', {
0556             'conditions': [
0557               [ 'target_arch=="ia32"', {
0558                 'cflags': [ '-m32' ],
0559                 'ldflags': [ '-m32' ],
0560               }],
0561               [ 'target_arch=="x64"', {
0562                 'cflags': [ '-m64' ],
0563                 'ldflags': [ '-m64' ],
0564               }],
0565               [ 'target_arch=="ppc64" and OS not in "aix os400"', {
0566                 'conditions': [
0567                   [ 'clang==0', {
0568                     'cflags': [ '-mminimal-toc' ],
0569                   }],
0570                 ],
0571                 'cflags': [ '-m64' ],
0572                 'ldflags': [ '-m64' ],
0573               }],
0574               [ 'target_arch=="s390x" and OS=="linux"', {
0575                 'cflags': [ '-m64', '-march=z196' ],
0576                 'ldflags': [ '-m64', '-march=z196' ],
0577               }],
0578             ],
0579           }],
0580         ],
0581         'conditions': [
0582           [ 'OS=="solaris"', {
0583             'cflags': [ '-pthreads' ],
0584             'ldflags': [ '-pthreads' ],
0585             'cflags!': [ '-pthread' ],
0586             'ldflags!': [ '-pthread' ],
0587           }],
0588           [ 'node_shared=="true"', {
0589             'cflags': [ '-fPIC' ],
0590             'ldflags': [ '-fPIC' ],
0591           }],
0592         ],
0593       }],
0594       [ 'OS in "aix os400"', {
0595         'variables': {
0596           # Used to differentiate `AIX` and `OS400`(IBM i).
0597           'aix_variant_name': '<!(uname -s)',
0598         },
0599         'cflags': [ '-maix64', ],
0600         'ldflags!': [ '-rdynamic', ],
0601         'ldflags': [
0602           '-Wl,-bbigtoc',
0603           '-maix64',
0604         ],
0605         'conditions': [
0606           [ '"<(aix_variant_name)"=="OS400"', {            # a.k.a. `IBM i`
0607             'ldflags': [
0608               '-Wl,-blibpath:/QOpenSys/pkgs/lib:/QOpenSys/usr/lib',
0609               '-Wl,-brtl',
0610             ],
0611           }, {                                             # else it's `AIX`
0612             'variables': {
0613               'gcc_major': '<!(<(python) -c "import os; import subprocess; CXX=os.environ.get(\'CXX\', \'g++\'); subprocess.run([CXX, \'-dumpversion\'])")'
0614             },
0615             # Disable the following compiler warning:
0616             #
0617             #   warning: visibility attribute not supported in this
0618             #   configuration; ignored [-Wattributes]
0619             #
0620             # This is gcc complaining about __attribute((visibility("default"))
0621             # in static library builds. Legitimate but harmless and it drowns
0622             # out more relevant warnings.
0623             'cflags': [ '-Wno-attributes' ],
0624             'ldflags': [
0625               '-Wl,-blibpath:/usr/lib:/lib:/opt/freeware/lib/gcc/powerpc-ibm-aix7.3.0.0/>(gcc_major)/pthread/ppc64:/opt/freeware/lib/gcc/powerpc-ibm-aix7.2.0.0/>(gcc_major)/pthread/ppc64:/opt/freeware/lib/pthread/ppc64',
0626             ],
0627           }],
0628         ],
0629       }],
0630       ['OS=="android"', {
0631         'target_conditions': [
0632           ['_toolset=="target"', {
0633             'defines': [ '_GLIBCXX_USE_C99_MATH' ],
0634             'libraries': [ '-llog' ],
0635           }],
0636           ['_toolset=="host"', {
0637             'cflags': [ '-pthread' ],
0638             'ldflags': [ '-pthread' ],
0639           }],
0640         ],
0641       }],
0642       ['OS=="mac"', {
0643         'defines': ['_DARWIN_USE_64_BIT_INODE=1'],
0644         'xcode_settings': {
0645           'ALWAYS_SEARCH_USER_PATHS': 'NO',
0646           'GCC_CW_ASM_SYNTAX': 'NO',                # No -fasm-blocks
0647           'GCC_DYNAMIC_NO_PIC': 'NO',               # No -mdynamic-no-pic
0648                                                     # (Equivalent to -fPIC)
0649           'GCC_ENABLE_CPP_EXCEPTIONS': 'NO',        # -fno-exceptions
0650           'GCC_ENABLE_CPP_RTTI': 'NO',              # -fno-rtti
0651           'GCC_ENABLE_PASCAL_STRINGS': 'NO',        # No -mpascal-strings
0652           'GCC_STRICT_ALIASING': 'NO',              # -fno-strict-aliasing
0653           'PREBINDING': 'NO',                       # No -Wl,-prebind
0654           'MACOSX_DEPLOYMENT_TARGET': '13.5',       # -mmacosx-version-min=13.5
0655           'USE_HEADERMAP': 'NO',
0656           'WARNING_CFLAGS': [
0657             '-Wall',
0658             '-Wendif-labels',
0659             '-W',
0660             '-Wno-unused-parameter',
0661           ],
0662         },
0663         'target_conditions': [
0664           ['_type!="static_library"', {
0665             'xcode_settings': {
0666               'OTHER_LDFLAGS': [
0667                 '-Wl,-search_paths_first'
0668               ],
0669             },
0670           }],
0671         ],
0672         'conditions': [
0673           ['target_arch=="ia32"', {
0674             'xcode_settings': {'ARCHS': ['i386']},
0675           }],
0676           ['target_arch=="x64"', {
0677             'xcode_settings': {'ARCHS': ['x86_64']},
0678           }],
0679           ['target_arch=="arm64"', {
0680             'xcode_settings': {
0681               'ARCHS': ['arm64'],
0682               'OTHER_LDFLAGS!': [
0683                 '-Wl,-no_pie',
0684               ],
0685             },
0686           }],
0687           ['clang==1', {
0688             'xcode_settings': {
0689               'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0',
0690               'CLANG_CXX_LANGUAGE_STANDARD': 'gnu++20',  # -std=gnu++20
0691               'CLANG_CXX_LIBRARY': 'libc++',
0692             },
0693           }],
0694         ],
0695       }],
0696       ['OS=="freebsd"', {
0697         'ldflags': [
0698           '-Wl,--export-dynamic',
0699         ],
0700       }],
0701       # if node is built as an executable,
0702       #      the openssl mechanism for keeping itself "dload"-ed to ensure proper
0703       #      atexit cleanup does not apply
0704       ['node_shared_openssl!="true" and node_shared!="true"', {
0705         'defines': [
0706           # `OPENSSL_NO_PINSHARED` prevents openssl from dload
0707           #      current node executable,
0708           #      see https://github.com/nodejs/node/pull/21848
0709           #      or https://github.com/nodejs/node/issues/27925
0710           'OPENSSL_NO_PINSHARED'
0711         ],
0712       }],
0713       ['node_shared_openssl!="true"', {
0714         # `OPENSSL_THREADS` is defined via GYP for openSSL for all architectures.
0715         'defines': [
0716           'OPENSSL_THREADS',
0717         ],
0718       }],
0719       ['node_shared_openssl!="true" and openssl_no_asm==1', {
0720         'defines': [
0721           'OPENSSL_NO_ASM',
0722         ],
0723       }],
0724       ['OS == "zos"', {
0725         'defines': [
0726           '_XOPEN_SOURCE_EXTENDED',
0727           '_XOPEN_SOURCE=600',
0728           '_UNIX03_THREADS',
0729           '_UNIX03_WITHDRAWN',
0730           '_UNIX03_SOURCE',
0731           '_OPEN_SYS_SOCK_IPV6',
0732           '_OPEN_SYS_FILE_EXT=1',
0733           '_POSIX_SOURCE',
0734           '_OPEN_SYS',
0735           '_OPEN_SYS_IF_EXT',
0736           '_OPEN_SYS_SOCK_IPV6',
0737           '_OPEN_MSGQ_EXT',
0738           '_LARGE_TIME_API',
0739           '_ALL_SOURCE',
0740           '_AE_BIMODAL=1',
0741           '__IBMCPP_TR1__',
0742           'NODE_PLATFORM="os390"',
0743           'PATH_MAX=1024',
0744           '_ENHANCED_ASCII_EXT=0xFFFFFFFF',
0745           '_Export=extern',
0746           '__static_assert=static_assert',
0747         ],
0748         'cflags': [
0749           '-q64',
0750           '-Wc,DLL',
0751           '-Wa,GOFF',
0752           '-qARCH=10',
0753           '-qASCII',
0754           '-qTUNE=12',
0755           '-qENUM=INT',
0756           '-qEXPORTALL',
0757           '-qASM',
0758         ],
0759         'cflags_cc': [
0760           '-qxclang=-std=c++14',
0761         ],
0762         'ldflags': [
0763           '-q64',
0764         ],
0765         # for addons due to v8config.h include of "zos-base.h":
0766         'include_dirs':  ['<(zoslib_include_dir)'],
0767       }],
0768     ],
0769   }
0770 }