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