diff options
Diffstat (limited to 'js/src/moz.build')
-rw-r--r-- | js/src/moz.build | 65 |
1 files changed, 44 insertions, 21 deletions
diff --git a/js/src/moz.build b/js/src/moz.build index 115747daaf..3553dc9bf1 100644 --- a/js/src/moz.build +++ b/js/src/moz.build @@ -7,8 +7,6 @@ include('js-config.mozbuild') include('js-cxxflags.mozbuild') include('js-testing.mozbuild') -FILES_PER_UNIFIED_FILE = 6 - if CONFIG['JS_BUNDLED_EDITLINE']: DIRS += ['editline'] @@ -111,7 +109,7 @@ EXPORTS.js += [ '../public/WeakMapPtr.h', ] -UNIFIED_SOURCES += [ +main_deunified_sources = [ 'builtin/AtomicsObject.cpp', 'builtin/Eval.cpp', 'builtin/intl/Collator.cpp', @@ -388,7 +386,7 @@ SOURCES += [ ] if CONFIG['JS_POSIX_NSPR']: - UNIFIED_SOURCES += [ + posix_nspr_deunified_sources = [ 'vm/PosixNSPR.cpp', ] @@ -405,26 +403,24 @@ if CONFIG['ENABLE_TRACE_LOGGING']: ] if not CONFIG['ENABLE_ION']: - UNIFIED_SOURCES += [ + jit_ioncheck1_deunified_sources = [ 'jit/none/Trampoline-none.cpp' ] elif CONFIG['JS_CODEGEN_X86'] or CONFIG['JS_CODEGEN_X64']: - UNIFIED_SOURCES += [ + jit_ioncheck1_deunified_sources = [ 'jit/x86-shared/Architecture-x86-shared.cpp', 'jit/x86-shared/Assembler-x86-shared.cpp', 'jit/x86-shared/AssemblerBuffer-x86-shared.cpp', 'jit/x86-shared/BaselineCompiler-x86-shared.cpp', 'jit/x86-shared/BaselineIC-x86-shared.cpp', 'jit/x86-shared/CodeGenerator-x86-shared.cpp', + 'jit/x86-shared/Disassembler-x86-shared.cpp', # using namespace js::jit::X86Encoding; 'jit/x86-shared/Lowering-x86-shared.cpp', 'jit/x86-shared/MacroAssembler-x86-shared.cpp', 'jit/x86-shared/MoveEmitter-x86-shared.cpp', ] - UNIFIED_SOURCES += [ - 'jit/x86-shared/Disassembler-x86-shared.cpp', # using namespace js::jit::X86Encoding; - ] if CONFIG['JS_CODEGEN_X64']: - UNIFIED_SOURCES += [ + jit_ioncheck2_deunified_sources = [ 'jit/x64/Assembler-x64.cpp', 'jit/x64/Bailouts-x64.cpp', 'jit/x64/BaselineCompiler-x64.cpp', @@ -436,7 +432,7 @@ elif CONFIG['JS_CODEGEN_X86'] or CONFIG['JS_CODEGEN_X64']: 'jit/x64/Trampoline-x64.cpp', ] else: - UNIFIED_SOURCES += [ + jit_ioncheck2_deunified_sources = [ 'jit/x86/Assembler-x86.cpp', 'jit/x86/Bailouts-x86.cpp', 'jit/x86/BaselineCompiler-x86.cpp', @@ -448,7 +444,7 @@ elif CONFIG['JS_CODEGEN_X86'] or CONFIG['JS_CODEGEN_X64']: 'jit/x86/Trampoline-x86.cpp', ] elif CONFIG['JS_CODEGEN_ARM']: - UNIFIED_SOURCES += [ + jit_ioncheck1_deunified_sources = [ 'jit/arm/Architecture-arm.cpp', 'jit/arm/Assembler-arm.cpp', 'jit/arm/Bailouts-arm.cpp', @@ -464,16 +460,16 @@ elif CONFIG['JS_CODEGEN_ARM']: 'jit/arm/Trampoline-arm.cpp', ] if CONFIG['JS_SIMULATOR_ARM']: - UNIFIED_SOURCES += [ + jit_ioncheck2_deunified_sources = [ 'jit/arm/Simulator-arm.cpp' ] elif CONFIG['OS_ARCH'] == 'Darwin': - UNIFIED_SOURCES += [ + jit_ioncheck2_deunified_sources = [ 'jit/arm/llvm-compiler-rt/arm/aeabi_idivmod.S', 'jit/arm/llvm-compiler-rt/arm/aeabi_uidivmod.S', ] elif CONFIG['JS_CODEGEN_ARM64']: - UNIFIED_SOURCES += [ + jit_ioncheck1_deunified_sources = [ 'jit/arm64/Architecture-arm64.cpp', 'jit/arm64/Assembler-arm64.cpp', 'jit/arm64/Bailouts-arm64.cpp', @@ -496,14 +492,14 @@ elif CONFIG['JS_CODEGEN_ARM64']: 'jit/arm64/vixl/Utils-vixl.cpp' ] if CONFIG['JS_SIMULATOR_ARM64']: - UNIFIED_SOURCES += [ + jit_ioncheck2_deunified_sources = [ 'jit/arm64/vixl/Debugger-vixl.cpp', 'jit/arm64/vixl/Logic-vixl.cpp', 'jit/arm64/vixl/MozSimulator-vixl.cpp', 'jit/arm64/vixl/Simulator-vixl.cpp' ] elif CONFIG['JS_CODEGEN_MIPS32'] or CONFIG['JS_CODEGEN_MIPS64']: - UNIFIED_SOURCES += [ + jit_ioncheck1_deunified_sources = [ 'jit/mips-shared/Architecture-mips-shared.cpp', 'jit/mips-shared/Assembler-mips-shared.cpp', 'jit/mips-shared/Bailouts-mips-shared.cpp', @@ -515,7 +511,7 @@ elif CONFIG['JS_CODEGEN_MIPS32'] or CONFIG['JS_CODEGEN_MIPS64']: 'jit/mips-shared/MoveEmitter-mips-shared.cpp', ] if CONFIG['JS_CODEGEN_MIPS32']: - UNIFIED_SOURCES += [ + jit_ioncheck2_deunified_sources = [ 'jit/mips32/Architecture-mips32.cpp', 'jit/mips32/Assembler-mips32.cpp', 'jit/mips32/Bailouts-mips32.cpp', @@ -529,11 +525,11 @@ elif CONFIG['JS_CODEGEN_MIPS32'] or CONFIG['JS_CODEGEN_MIPS64']: 'jit/mips32/Trampoline-mips32.cpp', ] if CONFIG['JS_SIMULATOR_MIPS32']: - UNIFIED_SOURCES += [ + jit_ioncheck3_deunified_sources = [ 'jit/mips32/Simulator-mips32.cpp' ] elif CONFIG['JS_CODEGEN_MIPS64']: - UNIFIED_SOURCES += [ + jit_ioncheck2_deunified_sources = [ 'jit/mips64/Architecture-mips64.cpp', 'jit/mips64/Assembler-mips64.cpp', 'jit/mips64/Bailouts-mips64.cpp', @@ -547,7 +543,7 @@ elif CONFIG['JS_CODEGEN_MIPS32'] or CONFIG['JS_CODEGEN_MIPS64']: 'jit/mips64/Trampoline-mips64.cpp', ] if CONFIG['JS_SIMULATOR_MIPS64']: - UNIFIED_SOURCES += [ + jit_ioncheck3_deunified_sources = [ 'jit/mips64/Simulator-mips64.cpp' ] @@ -627,6 +623,33 @@ else: 'icuuc', ] +# Explicitly enable WPO and LTCG in MSVC, and deunify sources if +# we're doing LTO +if CONFIG['JS_LTO']: + if CONFIG['_MSC_VER'] and not CONFIG['CLANG_CL']: + CFLAGS += [ '-GL' ] + CXXFLAGS += [ '-GL' ] + if CONFIG['JS_SHARED_LIBRARY']: + LDFLAGS += [ '/LTCG' ] + SOURCES += main_deunified_sources + if CONFIG['JS_POSIX_NSPR']: + SOURCES += posix_nspr_deunified_sources + SOURCES += jit_ioncheck1_deunified_sources + if CONFIG['ENABLE_ION']: + SOURCES += jit_ioncheck2_deunified_sources + if CONFIG['JS_CODEGEN_MIPS32'] or CONFIG['JS_CODEGEN_MIPS64']: + SOURCES += jit_ioncheck3_deunified_sources +else: + FILES_PER_UNIFIED_FILE = 6 + UNIFIED_SOURCES += main_deunified_sources + if CONFIG['JS_POSIX_NSPR']: + UNIFIED_SOURCES += posix_nspr_deunified_sources + UNIFIED_SOURCES += jit_ioncheck1_deunified_sources + if CONFIG['ENABLE_ION']: + UNIFIED_SOURCES += jit_ioncheck2_deunified_sources + if CONFIG['JS_CODEGEN_MIPS32'] or CONFIG['JS_CODEGEN_MIPS64']: + UNIFIED_SOURCES += jit_ioncheck3_deunified_sources + USE_LIBS += [ 'nspr', 'zlib', |