moz.build (2071B)
1 # -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*- 2 # vim: set filetype=python: 3 # This Source Code Form is subject to the terms of the Mozilla Public 4 # License, v. 2.0. If a copy of the MPL was not distributed with this 5 # file, You can obtain one at http://mozilla.org/MPL/2.0/. 6 7 GeckoProgram("js", linkage=None) 8 if CONFIG["JS_BUNDLED_EDITLINE"]: 9 DIRS += ["../editline"] 10 USE_LIBS += ["editline"] 11 USE_LIBS += ["static:js"] 12 13 include("../js-compileflags.mozbuild") 14 include("../js-config.mozbuild") 15 include("../js-cxxflags.mozbuild") 16 include("../js-standalone.mozbuild") 17 18 UNIFIED_SOURCES += [ 19 "js.cpp", 20 "jsoptparse.cpp", 21 "jsshell.cpp", 22 "ModuleLoader.cpp", 23 "OSObject.cpp", 24 "ShellModuleObjectWrapper.cpp", 25 "WasmTesting.cpp", 26 ] 27 28 if CONFIG["FUZZING_INTERFACES"]: 29 UNIFIED_SOURCES += ["jsrtfuzzing/jsrtfuzzing.cpp"] 30 if CONFIG["LIBFUZZER"]: 31 USE_LIBS += ["static:fuzzer"] 32 else: 33 USE_LIBS += ["static:fuzzer-interface"] 34 35 if CONFIG["FUZZING_JS_FUZZILLI"] and CONFIG["OS_ARCH"] == "Linux": 36 OS_LIBS += ["rt"] 37 38 DEFINES["EXPORT_JS_API"] = True 39 40 LOCAL_INCLUDES += [ 41 "!..", 42 "..", 43 ] 44 45 OS_LIBS += CONFIG["EDITLINE_LIBS"] 46 47 # Place a GDB Python auto-load file next to the shell executable, both in 48 # the build directory and in the dist/bin directory. 49 FINAL_TARGET_FILES += ["js-gdb.py"] 50 OBJDIR_FILES.js.src.shell += ["!/dist/bin/js-gdb.py"] 51 52 # People expect the js shell to wind up in the top-level JS dir. 53 OBJDIR_FILES.js.src += ["!/dist/bin/js%s" % CONFIG["BIN_SUFFIX"]] 54 55 # Stack size on Wasm/WASI 56 # ================================== 57 # Increase the default stack size (64KB) to 1MB. 58 # Also make the stack grow towards 0 so that if SpiderMonkey's stack limiter is buggy, overflow will likely trap. 59 if CONFIG["OS_ARCH"] == "WASI": 60 LDFLAGS += ["-Wl,-z,stack-size=1048576", "-Wl,--stack-first"] 61 OS_LIBS += ["wasi-emulated-process-clocks", "wasi-emulated-getpid"] 62 63 # Make JS Shell builds run without LD_LIBRARY_PATH 64 if CONFIG["OS_TARGET"] == "Android": 65 LDFLAGS += [ 66 "-Wl,-rpath=$ORIGIN", 67 ]