2016-07-14 19:16:42 +03:00
|
|
|
# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
|
2016-03-08 07:49:35 +03:00
|
|
|
# vim: set filetype=python:
|
|
|
|
# This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
2016-03-09 09:27:42 +03:00
|
|
|
|
2016-03-09 09:59:39 +03:00
|
|
|
# /!\ Use js_option() instead of option() in this file. /!\
|
|
|
|
# =========================================================
|
|
|
|
|
|
|
|
@depends(build_project, '--help')
|
2016-03-18 13:03:09 +03:00
|
|
|
def building_js(build_project, help):
|
2016-03-09 09:59:39 +03:00
|
|
|
return build_project == 'js'
|
|
|
|
|
2016-03-18 13:03:09 +03:00
|
|
|
# Exception to the rule above: JS_STANDALONE is a special option that doesn't
|
|
|
|
# want the js_option treatment. When we're done merging js/src/configure and
|
|
|
|
# top-level configure, it can go away, although the JS_STANDALONE config
|
|
|
|
# will still need to be set depending on building_js above.
|
|
|
|
option(env='JS_STANDALONE', default=building_js,
|
|
|
|
help='Reserved for internal use')
|
|
|
|
|
2018-08-02 19:00:21 +03:00
|
|
|
include('../build/moz.configure/rust.configure',
|
|
|
|
when='--enable-compile-environment')
|
|
|
|
|
2016-03-18 13:03:09 +03:00
|
|
|
@depends('JS_STANDALONE')
|
|
|
|
def js_standalone(value):
|
|
|
|
if value:
|
2016-03-22 08:21:32 +03:00
|
|
|
return True
|
|
|
|
set_config('JS_STANDALONE', js_standalone)
|
2017-09-01 01:59:13 +03:00
|
|
|
set_define('JS_STANDALONE', js_standalone)
|
2016-03-23 10:34:59 +03:00
|
|
|
add_old_configure_assignment('JS_STANDALONE', js_standalone)
|
2016-03-18 13:03:09 +03:00
|
|
|
js_option('--disable-js-shell', default=building_js,
|
2017-09-01 01:59:13 +03:00
|
|
|
help='Do not build the JS shell')
|
2016-03-09 09:27:42 +03:00
|
|
|
|
|
|
|
@depends('--disable-js-shell')
|
2016-03-22 08:21:32 +03:00
|
|
|
def js_disable_shell(value):
|
2016-03-09 09:27:42 +03:00
|
|
|
if not value:
|
2016-03-22 08:21:32 +03:00
|
|
|
return True
|
|
|
|
|
|
|
|
set_config('JS_DISABLE_SHELL', js_disable_shell)
|
2016-03-09 11:41:40 +03:00
|
|
|
|
2018-02-22 11:40:00 +03:00
|
|
|
set_define('JS_64BIT', depends(target)(lambda t: t.bitness == 64 or None))
|
2016-03-09 11:41:40 +03:00
|
|
|
|
2017-12-02 05:29:28 +03:00
|
|
|
set_define('JS_PUNBOX64', depends(target)(lambda t: t.bitness == 64 or None))
|
|
|
|
set_define('JS_NUNBOX32', depends(target)(lambda t: t.bitness == 32 or None))
|
|
|
|
|
|
|
|
|
2016-03-09 11:41:40 +03:00
|
|
|
# SpiderMonkey as a shared library, and how its symbols are exported
|
|
|
|
# ==================================================================
|
2016-03-18 13:03:09 +03:00
|
|
|
js_option('--disable-shared-js', default=building_js,
|
2016-03-09 11:41:40 +03:00
|
|
|
help='Do not create a shared library')
|
|
|
|
|
2016-03-18 13:03:09 +03:00
|
|
|
js_option('--disable-export-js', default=building_js,
|
2016-03-09 11:41:40 +03:00
|
|
|
help='Do not mark JS symbols as DLL exported/visible')
|
|
|
|
|
|
|
|
@depends('--disable-shared-js', '--disable-export-js')
|
2016-03-23 04:22:08 +03:00
|
|
|
def shared_js(shared_js, export_js):
|
2016-03-09 11:41:40 +03:00
|
|
|
if shared_js:
|
|
|
|
if not export_js:
|
2016-03-25 09:48:21 +03:00
|
|
|
die('Must export JS symbols when building a shared library.')
|
2016-03-23 04:22:08 +03:00
|
|
|
return True
|
|
|
|
|
|
|
|
set_config('JS_SHARED_LIBRARY', shared_js)
|
2016-03-23 10:34:59 +03:00
|
|
|
add_old_configure_assignment('JS_SHARED_LIBRARY', shared_js)
|
2016-03-23 04:22:08 +03:00
|
|
|
|
|
|
|
@depends('--disable-shared-js', '--disable-export-js')
|
|
|
|
def exportable_js_api(shared_js, export_js):
|
|
|
|
if not shared_js and export_js:
|
|
|
|
return True
|
|
|
|
|
|
|
|
set_define('STATIC_EXPORTABLE_JS_API', exportable_js_api)
|
|
|
|
|
|
|
|
@depends('--disable-shared-js', '--disable-export-js')
|
|
|
|
def static_js_api(shared_js, export_js):
|
|
|
|
if not shared_js and not export_js:
|
|
|
|
return True
|
|
|
|
|
|
|
|
set_define('STATIC_JS_API', static_js_api)
|
2016-03-09 11:41:40 +03:00
|
|
|
|
2016-03-22 08:21:32 +03:00
|
|
|
@depends('--disable-shared-js')
|
2016-03-23 04:22:08 +03:00
|
|
|
def static_js(value):
|
|
|
|
if not value:
|
2016-03-22 08:21:32 +03:00
|
|
|
return True
|
|
|
|
|
2016-03-23 04:22:08 +03:00
|
|
|
set_define('MOZ_STATIC_JS', static_js)
|
2016-03-09 11:41:40 +03:00
|
|
|
|
|
|
|
@deprecated_option(env='DISABLE_SHARED_JS', nargs='?')
|
|
|
|
def disable_shared_js(value):
|
|
|
|
# DISABLE_SHARED_JS=1 gets us an empty PositiveOptionValue
|
|
|
|
if value and not len(value):
|
|
|
|
suggestion = '--disable-shared-js'
|
|
|
|
else:
|
|
|
|
suggestion = '--enable-shared-js'
|
|
|
|
|
2016-03-25 09:48:21 +03:00
|
|
|
die('Setting %s is deprecated, use %s instead.',
|
|
|
|
value.format('DISABLE_SHARED_JS'), suggestion)
|
2016-03-09 11:41:40 +03:00
|
|
|
|
|
|
|
@deprecated_option(env='DISABLE_EXPORT_JS', nargs='?')
|
|
|
|
def disable_export_js(value):
|
|
|
|
# DISABLE_EXPORT_JS=1 gets us an empty PositiveOptionValue
|
|
|
|
if value and not len(value):
|
|
|
|
suggestion = '--disable-export-js'
|
|
|
|
else:
|
|
|
|
suggestion = '--enable-export-js'
|
|
|
|
|
2016-03-25 09:48:21 +03:00
|
|
|
die('Setting %s is deprecated, use %s instead.',
|
|
|
|
value.format('DISABLE_EXPORT_JS'), suggestion)
|
2016-03-17 10:12:44 +03:00
|
|
|
|
Bug 1366287 - Part 1.0: Define a new BigInt primitive type, with a GDB prettyprinter, Rust binding support, and a new out-of-line TraceKind. (Disabled by default, implemented only incompletely, currently passing --enable-bigint will disable JITs, will be flipped on Eventually once every sub-aspect is in place, Don't Have A Cow, Man.) r=jwalden, r=Ms2ger, r=sfink
--HG--
extra : rebase_source : aa13bd94bc6157ff8134894e3ba2e7a2b53e28d9
2018-05-24 21:26:09 +03:00
|
|
|
# Experimental BigInt support
|
|
|
|
# =======================================================
|
|
|
|
js_option('--enable-bigint',
|
|
|
|
default=False,
|
|
|
|
help='Enable BigInt')
|
|
|
|
|
|
|
|
@depends('--enable-bigint')
|
|
|
|
def enable_bigint(value):
|
|
|
|
if value:
|
|
|
|
return True
|
|
|
|
|
|
|
|
set_config('ENABLE_BIGINT', enable_bigint)
|
|
|
|
set_define('ENABLE_BIGINT', enable_bigint)
|
2016-03-17 10:12:44 +03:00
|
|
|
|
2017-12-02 05:29:27 +03:00
|
|
|
# JIT support
|
|
|
|
# =======================================================
|
Bug 1366287 - Part 1.0: Define a new BigInt primitive type, with a GDB prettyprinter, Rust binding support, and a new out-of-line TraceKind. (Disabled by default, implemented only incompletely, currently passing --enable-bigint will disable JITs, will be flipped on Eventually once every sub-aspect is in place, Don't Have A Cow, Man.) r=jwalden, r=Ms2ger, r=sfink
--HG--
extra : rebase_source : aa13bd94bc6157ff8134894e3ba2e7a2b53e28d9
2018-05-24 21:26:09 +03:00
|
|
|
@depends(target, '--enable-bigint')
|
|
|
|
def ion_default(target, enable_bigint):
|
|
|
|
if enable_bigint:
|
|
|
|
return False
|
2017-12-02 05:29:27 +03:00
|
|
|
if target.cpu in ('x86', 'x86_64', 'arm', 'aarch64', 'mips32', 'mips64'):
|
|
|
|
return True
|
Bug 1366287 - Part 1.0: Define a new BigInt primitive type, with a GDB prettyprinter, Rust binding support, and a new out-of-line TraceKind. (Disabled by default, implemented only incompletely, currently passing --enable-bigint will disable JITs, will be flipped on Eventually once every sub-aspect is in place, Don't Have A Cow, Man.) r=jwalden, r=Ms2ger, r=sfink
--HG--
extra : rebase_source : aa13bd94bc6157ff8134894e3ba2e7a2b53e28d9
2018-05-24 21:26:09 +03:00
|
|
|
return False
|
2017-12-02 05:29:27 +03:00
|
|
|
|
|
|
|
js_option('--enable-ion',
|
|
|
|
default=ion_default,
|
|
|
|
help='Enable use of the IonMonkey JIT')
|
|
|
|
|
|
|
|
set_config('ENABLE_ION', depends_if('--enable-ion')(lambda x: True))
|
|
|
|
|
|
|
|
# JIT code simulator for cross compiles
|
|
|
|
# =======================================================
|
|
|
|
js_option('--enable-simulator', choices=('arm', 'arm64', 'mips32', 'mips64'),
|
|
|
|
nargs=1,
|
|
|
|
help='Enable a JIT code simulator for the specified architecture')
|
|
|
|
|
|
|
|
@depends('--enable-ion', '--enable-simulator', target)
|
|
|
|
def simulator(ion_enabled, simulator_enabled, target):
|
|
|
|
if not ion_enabled or not simulator_enabled:
|
|
|
|
return
|
|
|
|
|
|
|
|
sim_cpu = simulator_enabled[0]
|
|
|
|
|
|
|
|
if sim_cpu in ('arm', 'mips32'):
|
|
|
|
if target.cpu != 'x86':
|
|
|
|
die('The %s simulator only works on x86.' % sim_cpu)
|
|
|
|
|
|
|
|
if sim_cpu in ('arm64', 'mips64'):
|
|
|
|
if target.cpu != 'x86_64':
|
|
|
|
die('The %s simulator only works on x86-64.' % sim_cpu)
|
|
|
|
|
|
|
|
return namespace(**{sim_cpu: True})
|
|
|
|
|
|
|
|
set_config('JS_SIMULATOR', depends_if(simulator)(lambda x: True))
|
|
|
|
set_config('JS_SIMULATOR_ARM', simulator.arm)
|
|
|
|
set_config('JS_SIMULATOR_ARM64', simulator.arm64)
|
|
|
|
set_config('JS_SIMULATOR_MIPS32', simulator.mips32)
|
|
|
|
set_config('JS_SIMULATOR_MIPS64', simulator.mips64)
|
|
|
|
set_define('JS_SIMULATOR', depends_if(simulator)(lambda x: True))
|
|
|
|
set_define('JS_SIMULATOR_ARM', simulator.arm)
|
|
|
|
set_define('JS_SIMULATOR_ARM64', simulator.arm64)
|
|
|
|
set_define('JS_SIMULATOR_MIPS32', simulator.mips32)
|
|
|
|
set_define('JS_SIMULATOR_MIPS64', simulator.mips64)
|
|
|
|
|
|
|
|
@depends('--enable-ion', simulator, target)
|
|
|
|
def jit_codegen(ion_enabled, simulator, target):
|
|
|
|
if not ion_enabled:
|
|
|
|
return namespace(none=True)
|
|
|
|
|
|
|
|
if simulator:
|
|
|
|
return simulator
|
|
|
|
|
|
|
|
if target.cpu == 'aarch64':
|
|
|
|
return namespace(arm64=True)
|
|
|
|
elif target.cpu == 'x86_64':
|
|
|
|
return namespace(x64=True)
|
|
|
|
|
|
|
|
return namespace(**{str(target.cpu): True})
|
|
|
|
|
|
|
|
set_config('JS_CODEGEN_NONE', jit_codegen.none)
|
|
|
|
set_config('JS_CODEGEN_ARM', jit_codegen.arm)
|
|
|
|
set_config('JS_CODEGEN_ARM64', jit_codegen.arm64)
|
|
|
|
set_config('JS_CODEGEN_MIPS32', jit_codegen.mips32)
|
|
|
|
set_config('JS_CODEGEN_MIPS64', jit_codegen.mips64)
|
|
|
|
set_config('JS_CODEGEN_X86', jit_codegen.x86)
|
|
|
|
set_config('JS_CODEGEN_X64', jit_codegen.x64)
|
|
|
|
set_define('JS_CODEGEN_NONE', jit_codegen.none)
|
|
|
|
set_define('JS_CODEGEN_ARM', jit_codegen.arm)
|
|
|
|
set_define('JS_CODEGEN_ARM64', jit_codegen.arm64)
|
|
|
|
set_define('JS_CODEGEN_MIPS32', jit_codegen.mips32)
|
|
|
|
set_define('JS_CODEGEN_MIPS64', jit_codegen.mips64)
|
|
|
|
set_define('JS_CODEGEN_X86', jit_codegen.x86)
|
|
|
|
set_define('JS_CODEGEN_X64', jit_codegen.x64)
|
|
|
|
|
|
|
|
@depends('--enable-ion', simulator, target, moz_debug)
|
|
|
|
def jit_disasm_arm(ion_enabled, simulator, target, debug):
|
|
|
|
if not ion_enabled:
|
|
|
|
return
|
|
|
|
|
2017-12-15 22:10:23 +03:00
|
|
|
if simulator and debug:
|
2017-12-02 05:29:27 +03:00
|
|
|
if getattr(simulator, 'arm', None):
|
|
|
|
return True
|
|
|
|
|
|
|
|
if target.cpu == 'arm' and debug:
|
|
|
|
return True
|
|
|
|
|
|
|
|
set_config('JS_DISASM_ARM', jit_disasm_arm)
|
|
|
|
set_define('JS_DISASM_ARM', jit_disasm_arm)
|
|
|
|
|
2017-12-15 22:10:23 +03:00
|
|
|
@depends('--enable-ion', simulator, target, moz_debug)
|
|
|
|
def jit_disasm_arm64(ion_enabled, simulator, target, debug):
|
|
|
|
if not ion_enabled:
|
|
|
|
return
|
|
|
|
|
|
|
|
if simulator and debug:
|
|
|
|
if getattr(simulator, 'arm64', None):
|
|
|
|
return True
|
|
|
|
|
|
|
|
if target.cpu == 'aarch64' and debug:
|
|
|
|
return True
|
|
|
|
|
|
|
|
set_config('JS_DISASM_ARM64', jit_disasm_arm64)
|
|
|
|
set_define('JS_DISASM_ARM64', jit_disasm_arm64)
|
|
|
|
|
2016-03-17 10:12:44 +03:00
|
|
|
# Profiling
|
|
|
|
# =======================================================
|
|
|
|
js_option('--enable-instruments', env='MOZ_INSTRUMENTS',
|
|
|
|
help='Enable instruments remote profiling')
|
|
|
|
|
|
|
|
@depends('--enable-instruments', target)
|
|
|
|
def instruments(value, target):
|
|
|
|
if value and target.os != 'OSX':
|
2016-03-25 09:48:21 +03:00
|
|
|
die('--enable-instruments cannot be used when targeting %s',
|
|
|
|
target.os)
|
2016-03-17 10:12:44 +03:00
|
|
|
if value:
|
2016-03-22 08:21:32 +03:00
|
|
|
return True
|
2016-03-17 10:17:36 +03:00
|
|
|
|
2016-03-22 08:21:32 +03:00
|
|
|
set_config('MOZ_INSTRUMENTS', instruments)
|
2016-03-23 04:22:08 +03:00
|
|
|
set_define('MOZ_INSTRUMENTS', instruments)
|
2016-03-23 10:34:59 +03:00
|
|
|
add_old_configure_assignment('MOZ_INSTRUMENTS', instruments)
|
2016-03-23 08:18:57 +03:00
|
|
|
imply_option('--enable-profiling', instruments, reason='--enable-instruments')
|
2016-03-17 10:17:36 +03:00
|
|
|
|
|
|
|
js_option('--enable-callgrind', env='MOZ_CALLGRIND',
|
|
|
|
help='Enable callgrind profiling')
|
|
|
|
|
|
|
|
@depends('--enable-callgrind')
|
|
|
|
def callgrind(value):
|
|
|
|
if value:
|
2016-03-23 04:22:08 +03:00
|
|
|
return True
|
2016-03-17 10:24:30 +03:00
|
|
|
|
2016-03-23 04:22:08 +03:00
|
|
|
set_define('MOZ_CALLGRIND', callgrind)
|
2016-03-23 08:18:57 +03:00
|
|
|
imply_option('--enable-profiling', callgrind)
|
2016-03-17 10:24:30 +03:00
|
|
|
|
2016-11-30 00:47:38 +03:00
|
|
|
@depends(milestone, '--help')
|
|
|
|
def enable_profiling(milestone, help):
|
|
|
|
return milestone.is_nightly
|
|
|
|
|
|
|
|
js_option('--enable-profiling', env='MOZ_PROFILING', default=enable_profiling,
|
2016-03-17 10:24:30 +03:00
|
|
|
help='Set compile flags necessary for using sampling profilers '
|
|
|
|
'(e.g. shark, perf)')
|
|
|
|
|
2016-03-23 08:18:57 +03:00
|
|
|
@depends('--enable-profiling')
|
|
|
|
def profiling(value):
|
2016-03-17 10:24:30 +03:00
|
|
|
if value:
|
2016-03-23 08:18:57 +03:00
|
|
|
return True
|
2016-03-17 10:24:30 +03:00
|
|
|
|
2016-03-23 10:34:59 +03:00
|
|
|
add_old_configure_assignment('MOZ_PROFILING', profiling)
|
|
|
|
|
2016-03-23 08:18:57 +03:00
|
|
|
@depends(profiling, target)
|
|
|
|
def imply_vtune(value, target):
|
2017-01-18 01:35:42 +03:00
|
|
|
ok_cpu = target.cpu in ['x86', 'x86_64']
|
|
|
|
ok_kernel = target.kernel == 'WINNT' or \
|
|
|
|
(target.kernel == 'Linux' and target.os == 'GNU')
|
|
|
|
|
|
|
|
if value and ok_cpu and ok_kernel:
|
2016-03-22 08:21:32 +03:00
|
|
|
return True
|
|
|
|
|
|
|
|
set_config('MOZ_PROFILING', profiling)
|
2016-03-23 04:22:08 +03:00
|
|
|
set_define('MOZ_PROFILING', profiling)
|
2016-03-23 08:18:57 +03:00
|
|
|
imply_option('--enable-vtune', imply_vtune, reason='--enable-profiling')
|
2016-03-17 10:24:30 +03:00
|
|
|
|
|
|
|
|
2017-01-18 01:35:42 +03:00
|
|
|
js_option('--enable-vtune', env='MOZ_VTUNE', help='Enable VTune profiling')
|
2016-03-17 10:24:30 +03:00
|
|
|
|
|
|
|
@depends('--enable-vtune')
|
|
|
|
def vtune(value):
|
|
|
|
if value:
|
2016-03-22 08:21:32 +03:00
|
|
|
return True
|
|
|
|
|
|
|
|
set_config('MOZ_VTUNE', vtune)
|
2016-03-23 04:22:08 +03:00
|
|
|
set_define('MOZ_VTUNE', vtune)
|
2016-08-10 14:06:40 +03:00
|
|
|
|
|
|
|
|
|
|
|
js_option('--enable-gc-trace', env='JS_GC_TRACE',
|
|
|
|
help='Enable tracing of allocation and finalization')
|
|
|
|
|
|
|
|
@depends('--enable-gc-trace')
|
|
|
|
def gc_trace(value):
|
|
|
|
if value:
|
|
|
|
return True
|
|
|
|
|
|
|
|
set_define('JS_GC_TRACE', gc_trace)
|
2016-08-10 14:06:49 +03:00
|
|
|
|
|
|
|
|
2017-12-03 21:40:03 +03:00
|
|
|
js_option('--enable-gczeal',
|
|
|
|
default=depends(when=moz_debug)(lambda: True),
|
|
|
|
help='Enable zealous GCing')
|
|
|
|
|
|
|
|
set_define('JS_GC_ZEAL',
|
|
|
|
depends_if('--enable-gczeal')(lambda _: True))
|
|
|
|
|
|
|
|
|
2017-12-03 21:44:55 +03:00
|
|
|
# Use a smaller chunk size for GC chunks
|
|
|
|
# ========================================================
|
|
|
|
# Use large (1MB) chunks by default. This option can be used to give
|
|
|
|
# smaller (currently 256K) chunks.
|
|
|
|
js_option('--enable-small-chunk-size',
|
|
|
|
help='Allocate memory for JS GC things in smaller chunks')
|
|
|
|
|
|
|
|
set_define('JS_GC_SMALL_CHUNK_SIZE',
|
|
|
|
depends(when='--enable-small-chunk-size')(lambda: True))
|
|
|
|
|
|
|
|
|
2017-12-02 21:43:41 +03:00
|
|
|
# Trace logging.
|
|
|
|
# =======================================================
|
|
|
|
js_option('--enable-trace-logging',
|
|
|
|
default=depends(when=moz_debug)(lambda: True),
|
|
|
|
help='Enable trace logging')
|
|
|
|
|
|
|
|
set_config('ENABLE_TRACE_LOGGING',
|
|
|
|
depends_if('--enable-trace-logging')(lambda x: True))
|
|
|
|
set_define('JS_TRACE_LOGGING',
|
|
|
|
depends_if('--enable-trace-logging')(lambda x: True))
|
|
|
|
|
|
|
|
|
2018-01-31 22:35:57 +03:00
|
|
|
# Enable breakpoint for artificial OOMs
|
|
|
|
# =======================================================
|
|
|
|
js_option('--enable-oom-breakpoint',
|
|
|
|
help='Enable a breakpoint function for artificial OOMs')
|
|
|
|
|
|
|
|
set_define('JS_OOM_BREAKPOINT',
|
|
|
|
depends_if('--enable-oom-breakpoint')(lambda _: True))
|
|
|
|
|
|
|
|
|
2016-08-10 14:06:49 +03:00
|
|
|
js_option('--enable-perf', env='JS_ION_PERF',
|
|
|
|
help='Enable Linux perf integration')
|
|
|
|
|
|
|
|
@depends('--enable-perf')
|
|
|
|
def ion_perf(value):
|
|
|
|
if value:
|
|
|
|
return True
|
|
|
|
|
|
|
|
set_define('JS_ION_PERF', ion_perf)
|
2016-08-10 14:06:55 +03:00
|
|
|
|
|
|
|
|
2017-12-02 21:43:40 +03:00
|
|
|
js_option('--enable-jitspew',
|
|
|
|
default=depends(when=moz_debug)(lambda: True),
|
|
|
|
help='Enable the Jit spew and IONFLAGS environment variable.')
|
|
|
|
|
|
|
|
set_define('JS_JITSPEW',
|
|
|
|
depends_if('--enable-jitspew')(lambda _: True))
|
|
|
|
set_config('JS_JITSPEW',
|
|
|
|
depends_if('--enable-jitspew')(lambda _: True))
|
|
|
|
|
|
|
|
|
2016-08-10 14:06:55 +03:00
|
|
|
js_option('--enable-more-deterministic', env='JS_MORE_DETERMINISTIC',
|
|
|
|
help='Enable changes that make the shell more deterministic')
|
|
|
|
|
|
|
|
@depends('--enable-more-deterministic')
|
|
|
|
def more_deterministic(value):
|
|
|
|
if value:
|
|
|
|
return True
|
|
|
|
|
|
|
|
set_define('JS_MORE_DETERMINISTIC', more_deterministic)
|
2016-10-04 08:57:00 +03:00
|
|
|
|
|
|
|
|
|
|
|
# CTypes
|
|
|
|
# =======================================================
|
|
|
|
@depends(building_js, '--help')
|
|
|
|
def ctypes_default(building_js, _):
|
|
|
|
return not building_js
|
|
|
|
|
|
|
|
js_option('--enable-ctypes', help='Enable js-ctypes',
|
|
|
|
default=ctypes_default)
|
|
|
|
|
|
|
|
build_ctypes = depends_if('--enable-ctypes')(lambda _: True)
|
|
|
|
|
|
|
|
set_config('BUILD_CTYPES', build_ctypes)
|
|
|
|
set_define('BUILD_CTYPES', build_ctypes)
|
|
|
|
add_old_configure_assignment('BUILD_CTYPES', build_ctypes)
|
|
|
|
|
|
|
|
@depends(build_ctypes, building_js)
|
|
|
|
def js_has_ctypes(ctypes, js):
|
|
|
|
if ctypes and js:
|
|
|
|
return True
|
|
|
|
|
|
|
|
set_config('JS_HAS_CTYPES', js_has_ctypes)
|
|
|
|
set_define('JS_HAS_CTYPES', js_has_ctypes)
|
|
|
|
add_old_configure_assignment('JS_HAS_CTYPES', js_has_ctypes)
|
|
|
|
|
|
|
|
@depends('--enable-ctypes', '--enable-compile-environment', '--help')
|
|
|
|
def ctypes_and_compile_environment(ctypes, compile_environment, _):
|
|
|
|
return ctypes and compile_environment
|
|
|
|
|
2016-10-13 11:15:24 +03:00
|
|
|
include('ffi.configure', when=ctypes_and_compile_environment)
|
2017-01-24 02:40:38 +03:00
|
|
|
|
|
|
|
|
|
|
|
# Support various fuzzing options
|
|
|
|
# ==============================================================
|
|
|
|
with only_when('--enable-compile-environment'):
|
|
|
|
js_option('--enable-fuzzing', help='Enable fuzzing support')
|
|
|
|
|
|
|
|
@depends('--enable-fuzzing')
|
|
|
|
def enable_fuzzing(value):
|
|
|
|
if value:
|
|
|
|
return True
|
|
|
|
|
2017-11-22 19:21:09 +03:00
|
|
|
@depends(try_compile(body='__AFL_COMPILER;',
|
2017-01-24 02:40:38 +03:00
|
|
|
check_msg='for AFL compiler',
|
|
|
|
when='--enable-fuzzing'))
|
2017-11-22 19:21:09 +03:00
|
|
|
def enable_aflfuzzer(afl):
|
|
|
|
if afl:
|
|
|
|
return True
|
|
|
|
|
|
|
|
@depends(enable_fuzzing,
|
|
|
|
enable_aflfuzzer,
|
|
|
|
c_compiler)
|
|
|
|
def enable_libfuzzer(fuzzing, afl, c_compiler):
|
|
|
|
if fuzzing and not afl and c_compiler.type == 'clang':
|
|
|
|
return True
|
|
|
|
|
|
|
|
@depends(enable_fuzzing,
|
|
|
|
enable_aflfuzzer,
|
|
|
|
enable_libfuzzer)
|
|
|
|
def enable_fuzzing_interfaces(fuzzing, afl, libfuzzer):
|
|
|
|
if fuzzing and (afl or libfuzzer):
|
2017-01-24 02:40:38 +03:00
|
|
|
return True
|
|
|
|
|
|
|
|
set_config('FUZZING', enable_fuzzing)
|
|
|
|
set_define('FUZZING', enable_fuzzing)
|
|
|
|
|
|
|
|
set_config('LIBFUZZER', enable_libfuzzer)
|
|
|
|
set_define('LIBFUZZER', enable_libfuzzer)
|
2017-10-17 07:10:00 +03:00
|
|
|
|
2017-11-22 19:21:09 +03:00
|
|
|
set_config('FUZZING_INTERFACES', enable_fuzzing_interfaces)
|
|
|
|
set_define('FUZZING_INTERFACES', enable_fuzzing_interfaces)
|
|
|
|
|
2017-10-17 07:10:00 +03:00
|
|
|
# Enable pipeline operator
|
|
|
|
# ===================================================
|
|
|
|
js_option('--enable-pipeline-operator', default=False, help='Enable pipeline operator')
|
|
|
|
|
|
|
|
@depends('--enable-pipeline-operator')
|
|
|
|
def enable_pipeline_operator(value):
|
|
|
|
if value:
|
|
|
|
return True
|
|
|
|
|
|
|
|
set_config('ENABLE_PIPELINE_OPERATOR', enable_pipeline_operator)
|
|
|
|
set_define('ENABLE_PIPELINE_OPERATOR', enable_pipeline_operator)
|
2017-12-15 18:54:55 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Experimental support for BinAST
|
|
|
|
# ==============================================================
|
|
|
|
|
|
|
|
@depends(target, milestone)
|
|
|
|
def enable_build_binast(target, milestone):
|
|
|
|
# For reasons unknown at this time, BinAST causes timeouts on win32
|
|
|
|
# and failures on Android.
|
|
|
|
if milestone.is_nightly and not (target.kernel == 'WINNT' and target.cpu == 'x86') and not (target.os == 'Android'):
|
|
|
|
return True
|
|
|
|
|
|
|
|
set_define('JS_BUILD_BINAST', enable_build_binast)
|
|
|
|
set_config('JS_BUILD_BINAST', enable_build_binast)
|
2018-07-24 21:31:45 +03:00
|
|
|
|
|
|
|
|
|
|
|
# Experimental support for wasm code generation with Cranelift
|
|
|
|
# ==============================================================
|
|
|
|
js_option('--enable-cranelift',
|
|
|
|
help='Enable Cranelift code generator for wasm')
|
|
|
|
|
|
|
|
@depends('--enable-cranelift')
|
|
|
|
def enable_cranelift(value):
|
|
|
|
if value:
|
|
|
|
return True
|
|
|
|
|
|
|
|
set_config('MOZ_WASM_CRANELIFT', enable_cranelift)
|
|
|
|
set_define('MOZ_WASM_CRANELIFT', enable_cranelift)
|