4 'werror': '', # Turn off -Werror in V8 build.
5 'visibility%': 'hidden', # V8's visibility setting
6 'target_arch%': 'ia32', # set v8's target architecture
7 'host_arch%': 'ia32', # set v8's host architecture
8 'want_separate_host_toolset%': 0, # V8 should not build target and host
9 'library%': 'static_library', # allow override to 'shared_library' for DLL/.so builds
10 'component%': 'static_library', # NB. these names match with what V8 expects
11 'msvs_multi_core_compile': '0', # we do enable multicore compiles, but not using the V8 way
15 'uv_library%': 'static_library',
19 # Default to -O0 for debug builds.
20 'v8_optimized_debug%': 0,
22 # Enable disassembler for `--print-code` v8 options
23 'v8_enable_disassembler': 1,
25 # Don't bake anything extra into the snapshot.
26 'v8_use_external_startup_data%': 0,
31 'v8_postmortem_support%': 'false',
34 'v8_postmortem_support%': 'true',
36 ['GENERATOR == "ninja" or OS== "mac"', {
37 'OBJ_DIR': '<(PRODUCT_DIR)/obj',
38 'V8_BASE': '<(PRODUCT_DIR)/libv8_base.a',
40 'OBJ_DIR': '<(PRODUCT_DIR)/obj.target',
41 'V8_BASE': '<(PRODUCT_DIR)/obj.target/deps/v8/tools/gyp/libv8_base.a',
43 ['openssl_fips != ""', {
44 'OPENSSL_PRODUCT': 'libcrypto.a',
46 'OPENSSL_PRODUCT': 'libopenssl.a',
57 'default_configuration': 'Release',
61 'v8_enable_handle_zapping': 1,
63 'defines': [ 'DEBUG', '_DEBUG' ],
64 'cflags': [ '-g', '-O0', '-fPIE' ],
65 'ldflags': [ '-pie' ],
67 ['target_arch=="x64"', {
68 'msvs_configuration_platform': 'x64',
71 'cflags': [ '-gxcoff' ],
72 'ldflags': [ '-Wl,-bbigtoc' ],
77 'RuntimeLibrary': 1, # static debug
78 'Optimization': 0, # /Od, no optimization
79 'MinimalRebuild': 'false',
80 'OmitFramePointers': 'false',
81 'BasicRuntimeChecks': 3, # /RTC1
84 'LinkIncremental': 2, # enable incremental linking
88 'GCC_OPTIMIZATION_LEVEL': '0', # stop gyp from defaulting to -Os
93 'v8_enable_handle_zapping': 0,
95 'cflags': [ '-O3', '-ffunction-sections', '-fdata-sections', '-fPIE' ],
96 'ldflags': [ '-pie' ],
98 ['target_arch=="x64"', {
99 'msvs_configuration_platform': 'x64',
102 # pull in V8's postmortem metadata
103 'ldflags': [ '-Wl,-z,allextract' ]
105 ['OS!="mac" and OS!="win"', {
106 'cflags': [ '-fno-omit-frame-pointer' ],
110 'VCCLCompilerTool': {
111 'RuntimeLibrary': 0, # static release
112 'Optimization': 3, # /Ox, full optimization
113 'FavorSizeOrSpeed': 1, # /Ot, favour speed over size
114 'InlineFunctionExpansion': 2, # /Ob2, inline anything eligible
115 'WholeProgramOptimization': 'true', # /GL, whole program optimization, needed for LTCG
116 'OmitFramePointers': 'true',
117 'EnableFunctionLevelLinking': 'true',
118 'EnableIntrinsicFunctions': 'true',
119 'RuntimeTypeInfo': 'false',
120 'AdditionalOptions': [
121 '/MP', # compile across multiple CPUs
125 'AdditionalOptions': [
126 '/LTCG', # link time code generation
130 'LinkTimeCodeGeneration': 1, # link-time code generation
131 'OptimizeReferences': 2, # /OPT:REF
132 'EnableCOMDATFolding': 2, # /OPT:ICF
133 'LinkIncremental': 1, # disable incremental linking
138 # Forcibly disable -Werror. We support a wide range of compilers, it's
139 # simply not feasible to squelch all warnings, never mind that the
140 # libraries in deps/ are not under our control.
141 'cflags!': ['-Werror'],
143 'VCCLCompilerTool': {
144 'StringPooling': 'true', # pool string literals
145 'DebugInformationFormat': 3, # Generate a PDB
147 'BufferSecurityCheck': 'true',
148 'ExceptionHandling': 0, # /EHsc
149 'SuppressStartupBanner': 'true',
150 'WarnAsError': 'false',
156 ['target_arch=="ia32"', {
157 'TargetMachine' : 1, # /MACHINE:X86
158 'target_conditions': [
159 ['_type=="executable"', {
160 'AdditionalOptions': [ '/SubSystem:Console,"5.01"' ],
164 ['target_arch=="x64"', {
165 'TargetMachine' : 17, # /MACHINE:AMD64
166 'target_conditions': [
167 ['_type=="executable"', {
168 'AdditionalOptions': [ '/SubSystem:Console,"5.02"' ],
173 'GenerateDebugInformation': 'true',
174 'GenerateMapFile': 'true', # /MAP
175 'MapExports': 'true', # /MAPINFO:EXPORTS
176 'RandomizedBaseAddress': 2, # enable ASLR
177 'DataExecutionPrevention': 2, # enable DEP
178 'AllowIsolation': 'true',
179 'SuppressStartupBanner': 'true',
182 'msvs_disabled_warnings': [4351, 4355, 4800],
184 ['asan == 1 and OS != "mac"', {
186 '-fno-omit-frame-pointer',
187 '-fsanitize=address',
190 'cflags!': [ '-fomit-frame-pointer' ],
191 'ldflags': [ '-fsanitize=address' ],
193 ['asan == 1 and OS == "mac"', {
196 '-fno-omit-frame-pointer',
197 '-gline-tables-only',
198 '-fsanitize=address',
202 '-fomit-frame-pointer',
205 'target_conditions': [
206 ['_type!="static_library"', {
207 'xcode_settings': {'OTHER_LDFLAGS': ['-fsanitize=address']},
212 'msvs_cygwin_shell': 0, # prevent actions from trying to use cygwin
215 # we don't really want VC++ warning us about
216 # how dangerous C functions are...
217 '_CRT_SECURE_NO_DEPRECATE',
218 # ... or that C implementations shouldn't use
220 '_CRT_NONSTDC_NO_DEPRECATE',
221 # Make sure the STL doesn't try to use exceptions
223 'BUILDING_V8_SHARED=1',
224 'BUILDING_UV_SHARED=1',
227 [ 'OS in "linux freebsd openbsd solaris aix"', {
228 'cflags': [ '-pthread', ],
229 'ldflags': [ '-pthread' ],
231 [ 'OS in "linux freebsd openbsd solaris android aix"', {
232 'cflags': [ '-Wall', '-Wextra', '-Wno-unused-parameter', ],
233 'cflags_cc': [ '-fno-rtti', '-fno-exceptions', '-std=gnu++0x' ],
234 'ldflags': [ '-rdynamic' ],
235 'target_conditions': [
236 ['_type=="static_library"', {
237 'standalone_static_library': 1, # disable thin archive which needs binutils >= 2.19
241 [ 'target_arch=="ia32"', {
242 'cflags': [ '-m32' ],
243 'ldflags': [ '-m32' ],
245 [ 'target_arch=="x32"', {
246 'cflags': [ '-mx32' ],
247 'ldflags': [ '-mx32' ],
249 [ 'target_arch=="x64"', {
250 'cflags': [ '-m64' ],
251 'ldflags': [ '-m64' ],
253 [ 'target_arch=="ppc" and OS!="aix"', {
254 'cflags': [ '-m32' ],
255 'ldflags': [ '-m32' ],
257 [ 'target_arch=="ppc64" and OS!="aix"', {
258 'cflags': [ '-m64', '-mminimal-toc' ],
259 'ldflags': [ '-m64' ],
262 'cflags': [ '-pthreads' ],
263 'ldflags': [ '-pthreads' ],
264 'cflags!': [ '-pthread' ],
265 'ldflags!': [ '-pthread' ],
269 [ 'target_arch=="ppc"', {
270 'ldflags': [ '-Wl,-bmaxdata:0x60000000/dsa' ],
272 [ 'target_arch=="ppc64"', {
273 'cflags': [ '-maix64' ],
274 'ldflags': [ '-maix64' ],
277 'ldflags!': [ '-rdynamic' ],
282 'defines': ['_GLIBCXX_USE_C99_MATH'],
283 'libraries': [ '-llog' ],
286 'defines': ['_DARWIN_USE_64_BIT_INODE=1'],
288 'ALWAYS_SEARCH_USER_PATHS': 'NO',
289 'GCC_CW_ASM_SYNTAX': 'NO', # No -fasm-blocks
290 'GCC_DYNAMIC_NO_PIC': 'NO', # No -mdynamic-no-pic
291 # (Equivalent to -fPIC)
292 'GCC_ENABLE_CPP_EXCEPTIONS': 'NO', # -fno-exceptions
293 'GCC_ENABLE_CPP_RTTI': 'NO', # -fno-rtti
294 'GCC_ENABLE_PASCAL_STRINGS': 'NO', # No -mpascal-strings
295 'GCC_THREADSAFE_STATICS': 'NO', # -fno-threadsafe-statics
296 'PREBINDING': 'NO', # No -Wl,-prebind
297 'MACOSX_DEPLOYMENT_TARGET': '10.5', # -mmacosx-version-min=10.5
298 'USE_HEADERMAP': 'NO',
300 '-fno-strict-aliasing',
306 '-Wno-unused-parameter',
309 'target_conditions': [
310 ['_type!="static_library"', {
311 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-search_paths_first']},
315 ['target_arch=="ia32"', {
316 'xcode_settings': {'ARCHS': ['i386']},
318 ['target_arch=="x64"', {
319 'xcode_settings': {'ARCHS': ['x86_64']},
323 'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0',
324 'CLANG_CXX_LANGUAGE_STANDARD': 'gnu++0x', # -std=gnu++0x
329 ['OS=="freebsd" and node_use_dtrace=="true"', {
330 'libraries': [ '-lelf' ],
334 '-Wl,--export-dynamic',