tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

moz.build (10084B)


      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 FINAL_LIBRARY = "js"
      8 
      9 # Includes should be relative to parent path
     10 LOCAL_INCLUDES += ["!..", ".."]
     11 
     12 include("../js-compileflags.mozbuild")
     13 include("../js-config.mozbuild")
     14 include("../js-cxxflags.mozbuild")
     15 
     16 UNIFIED_SOURCES += [
     17     "AliasAnalysis.cpp",
     18     "AlignmentMaskAnalysis.cpp",
     19     "BacktrackingAllocator.cpp",
     20     "Bailouts.cpp",
     21     "BaselineBailouts.cpp",
     22     "BaselineCacheIRCompiler.cpp",
     23     "BaselineCodeGen.cpp",
     24     "BaselineCompileTask.cpp",
     25     "BaselineDebugModeOSR.cpp",
     26     "BaselineFrame.cpp",
     27     "BaselineFrameInfo.cpp",
     28     "BaselineIC.cpp",
     29     "BaselineJIT.cpp",
     30     "BitSet.cpp",
     31     "BranchHinting.cpp",
     32     "BytecodeAnalysis.cpp",
     33     "CacheIR.cpp",
     34     "CacheIRAOT.cpp",
     35     "CacheIRCompiler.cpp",
     36     "CacheIRHealth.cpp",
     37     "CacheIRSpewer.cpp",
     38     "CodeGenerator.cpp",
     39     "CompileWrappers.cpp",
     40     "Disassemble.cpp",
     41     "DominatorTree.cpp",
     42     "EdgeCaseAnalysis.cpp",
     43     "EffectiveAddressAnalysis.cpp",
     44     "ExecutableAllocator.cpp",
     45     "FlushICache.cpp",
     46     "FoldLinearArithConstants.cpp",
     47     "GraphSpewer.cpp",
     48     "InlinableNatives.cpp",
     49     "InstructionReordering.cpp",
     50     "InterpreterEntryTrampoline.cpp",
     51     "Ion.cpp",
     52     "IonAnalysis.cpp",
     53     "IonCacheIRCompiler.cpp",
     54     "IonCompileTask.cpp",
     55     "IonIC.cpp",
     56     "IonOptimizationLevels.cpp",
     57     "Jit.cpp",
     58     "JitcodeMap.cpp",
     59     "JitContext.cpp",
     60     "JitFrames.cpp",
     61     "JitHints.cpp",
     62     "JitOptions.cpp",
     63     "JitScript.cpp",
     64     "JitSpewer.cpp",
     65     "JSJitFrameIter.cpp",
     66     "KnownClass.cpp",
     67     "Label.cpp",
     68     "LICM.cpp",
     69     "Linker.cpp",
     70     "LIR.cpp",
     71     "Lowering.cpp",
     72     "MacroAssembler.cpp",
     73     "MIR-wasm.cpp",
     74     "MIR.cpp",
     75     "MIRGraph.cpp",
     76     "MoveResolver.cpp",
     77     "PerfSpewer.cpp",
     78     "ProcessExecutableMemory.cpp",
     79     "RangeAnalysis.cpp",
     80     "ReciprocalMulConstants.cpp",
     81     "Recover.cpp",
     82     "RegisterAllocator.cpp",
     83     "RematerializedFrame.cpp",
     84     "SafepointIndex.cpp",
     85     "Safepoints.cpp",
     86     "ScalarReplacement.cpp",
     87     "ShapeList.cpp",
     88     "shared/Assembler-shared.cpp",
     89     "shared/AtomicOperations-shared-jit.cpp",
     90     "shared/CodeGenerator-shared.cpp",
     91     "shared/Disassembler-shared.cpp",
     92     "shared/Lowering-shared.cpp",
     93     "ShuffleAnalysis.cpp",
     94     "SimpleAllocator.cpp",
     95     "Sink.cpp",
     96     "Snapshots.cpp",
     97     "StubFolding.cpp",
     98     "Trampoline.cpp",
     99     "TrampolineNatives.cpp",
    100     "TrialInlining.cpp",
    101     "TypePolicy.cpp",
    102     "UnrollLoops.cpp",
    103     "ValueNumbering.cpp",
    104     "VMFunctions.cpp",
    105     "WarpBuilder.cpp",
    106     "WarpBuilderShared.cpp",
    107     "WarpCacheIRTranspiler.cpp",
    108     "WarpOracle.cpp",
    109     "WarpSnapshot.cpp",
    110     "WasmBCE.cpp",
    111     "XrayJitInfo.cpp",
    112 ]
    113 
    114 if CONFIG["JS_CODEGEN_NONE"]:
    115     UNIFIED_SOURCES += ["none/Trampoline-none.cpp"]
    116 elif CONFIG["JS_CODEGEN_X86"] or CONFIG["JS_CODEGEN_X64"]:
    117     UNIFIED_SOURCES += [
    118         "x86-shared/Architecture-x86-shared.cpp",
    119         "x86-shared/Assembler-x86-shared.cpp",
    120         "x86-shared/AssemblerBuffer-x86-shared.cpp",
    121         "x86-shared/CodeGenerator-x86-shared.cpp",
    122         "x86-shared/Lowering-x86-shared.cpp",
    123         "x86-shared/MacroAssembler-x86-shared-SIMD.cpp",
    124         "x86-shared/MacroAssembler-x86-shared.cpp",
    125         "x86-shared/MoveEmitter-x86-shared.cpp",
    126     ]
    127     if CONFIG["JS_CODEGEN_X64"]:
    128         UNIFIED_SOURCES += [
    129             "x64/Assembler-x64.cpp",
    130             "x64/CodeGenerator-x64.cpp",
    131             "x64/Lowering-x64.cpp",
    132             "x64/MacroAssembler-x64.cpp",
    133             "x64/Trampoline-x64.cpp",
    134         ]
    135     else:
    136         UNIFIED_SOURCES += [
    137             "x86/Assembler-x86.cpp",
    138             "x86/CodeGenerator-x86.cpp",
    139             "x86/Lowering-x86.cpp",
    140             "x86/MacroAssembler-x86.cpp",
    141             "x86/Trampoline-x86.cpp",
    142         ]
    143 elif CONFIG["JS_CODEGEN_ARM"]:
    144     UNIFIED_SOURCES += [
    145         "arm/Architecture-arm.cpp",
    146         "arm/Assembler-arm.cpp",
    147         "arm/CodeGenerator-arm.cpp",
    148         "arm/disasm/Constants-arm.cpp",
    149         "arm/disasm/Disasm-arm.cpp",
    150         "arm/Lowering-arm.cpp",
    151         "arm/MacroAssembler-arm.cpp",
    152         "arm/MoveEmitter-arm.cpp",
    153         "arm/Trampoline-arm.cpp",
    154     ]
    155     if CONFIG["JS_SIMULATOR_ARM"]:
    156         UNIFIED_SOURCES += ["arm/Simulator-arm.cpp"]
    157     elif CONFIG["OS_ARCH"] == "Darwin":
    158         SOURCES += [
    159             "arm/llvm-compiler-rt/arm/aeabi_idivmod.S",
    160             "arm/llvm-compiler-rt/arm/aeabi_uidivmod.S",
    161         ]
    162 elif CONFIG["JS_CODEGEN_ARM64"]:
    163     UNIFIED_SOURCES += [
    164         "arm64/Architecture-arm64.cpp",
    165         "arm64/Assembler-arm64.cpp",
    166         "arm64/CodeGenerator-arm64.cpp",
    167         "arm64/Lowering-arm64.cpp",
    168         "arm64/MacroAssembler-arm64.cpp",
    169         "arm64/MoveEmitter-arm64.cpp",
    170         "arm64/Trampoline-arm64.cpp",
    171         "arm64/vixl/Assembler-vixl.cpp",
    172         "arm64/vixl/Cpu-Features-vixl.cpp",
    173         "arm64/vixl/Cpu-vixl.cpp",
    174         "arm64/vixl/Decoder-vixl.cpp",
    175         "arm64/vixl/Instructions-vixl.cpp",
    176         "arm64/vixl/MacroAssembler-vixl.cpp",
    177         "arm64/vixl/MozAssembler-vixl.cpp",
    178         "arm64/vixl/MozCpu-vixl.cpp",
    179         "arm64/vixl/MozInstructions-vixl.cpp",
    180         "arm64/vixl/Operands-vixl.cpp",
    181         "arm64/vixl/Registers-vixl.cpp",
    182         "arm64/vixl/Utils-vixl.cpp",
    183     ]
    184     vixl_werror_sources = [
    185         "arm64/vixl/Disasm-vixl.cpp",
    186         "arm64/vixl/Instrument-vixl.cpp",
    187     ]
    188     SOURCES += vixl_werror_sources
    189     if CONFIG["CC_TYPE"] == "clang-cl":
    190         for f in vixl_werror_sources:
    191             SOURCES[f].flags += ["-Wno-c++11-narrowing"]
    192     if CONFIG["JS_SIMULATOR_ARM64"]:
    193         UNIFIED_SOURCES += [
    194             "arm64/vixl/Debugger-vixl.cpp",
    195             "arm64/vixl/Logic-vixl.cpp",
    196             "arm64/vixl/MozSimulator-vixl.cpp",
    197             "arm64/vixl/Simulator-vixl.cpp",
    198         ]
    199 elif CONFIG["JS_CODEGEN_MIPS64"]:
    200     UNIFIED_SOURCES += [
    201         "mips-shared/Architecture-mips-shared.cpp",
    202         "mips-shared/Assembler-mips-shared.cpp",
    203         "mips-shared/CodeGenerator-mips-shared.cpp",
    204         "mips-shared/Lowering-mips-shared.cpp",
    205         "mips-shared/MacroAssembler-mips-shared.cpp",
    206         "mips-shared/MoveEmitter-mips-shared.cpp",
    207         "mips64/Architecture-mips64.cpp",
    208         "mips64/Assembler-mips64.cpp",
    209         "mips64/CodeGenerator-mips64.cpp",
    210         "mips64/Lowering-mips64.cpp",
    211         "mips64/MacroAssembler-mips64.cpp",
    212         "mips64/MoveEmitter-mips64.cpp",
    213         "mips64/Trampoline-mips64.cpp",
    214     ]
    215     if CONFIG["JS_SIMULATOR_MIPS64"]:
    216         UNIFIED_SOURCES += ["mips64/Simulator-mips64.cpp"]
    217 elif CONFIG["JS_CODEGEN_LOONG64"]:
    218     UNIFIED_SOURCES += [
    219         "loong64/Architecture-loong64.cpp",
    220         "loong64/Assembler-loong64.cpp",
    221         "loong64/CodeGenerator-loong64.cpp",
    222         "loong64/Lowering-loong64.cpp",
    223         "loong64/MacroAssembler-loong64.cpp",
    224         "loong64/MoveEmitter-loong64.cpp",
    225         "loong64/Trampoline-loong64.cpp",
    226     ]
    227     if CONFIG["JS_SIMULATOR_LOONG64"]:
    228         UNIFIED_SOURCES += ["loong64/Simulator-loong64.cpp"]
    229 elif CONFIG["JS_CODEGEN_RISCV64"]:
    230     UNIFIED_SOURCES += [
    231         "riscv64/Architecture-riscv64.cpp",
    232         "riscv64/Assembler-riscv64.cpp",
    233         "riscv64/AssemblerMatInt.cpp",
    234         "riscv64/CodeGenerator-riscv64.cpp",
    235         "riscv64/constant/Base-constant-riscv.cpp",
    236         "riscv64/disasm/Disasm-riscv64.cpp",
    237         "riscv64/extension/base-assembler-riscv.cc",
    238         "riscv64/extension/base-riscv-i.cc",
    239         "riscv64/extension/extension-riscv-a.cc",
    240         "riscv64/extension/extension-riscv-b.cc",
    241         "riscv64/extension/extension-riscv-c.cc",
    242         "riscv64/extension/extension-riscv-d.cc",
    243         "riscv64/extension/extension-riscv-f.cc",
    244         "riscv64/extension/extension-riscv-m.cc",
    245         "riscv64/extension/extension-riscv-v.cc",
    246         "riscv64/extension/extension-riscv-zicsr.cc",
    247         "riscv64/extension/extension-riscv-zifencei.cc",
    248         "riscv64/Lowering-riscv64.cpp",
    249         "riscv64/MacroAssembler-riscv64.cpp",
    250         "riscv64/MoveEmitter-riscv64.cpp",
    251         "riscv64/Trampoline-riscv64.cpp",
    252     ]
    253     if CONFIG["JS_SIMULATOR_RISCV64"]:
    254         UNIFIED_SOURCES += ["riscv64/Simulator-riscv64.cpp"]
    255 elif CONFIG["JS_CODEGEN_WASM32"]:
    256     UNIFIED_SOURCES += [
    257         "wasm32/CodeGenerator-wasm32.cpp",
    258         "wasm32/MacroAssembler-wasm32.cpp",
    259         "wasm32/Trampoline-wasm32.cpp",
    260     ]
    261 
    262 # Generate jit/ABIFunctionTypeGenerated.h from jit/ABIFunctionType.yaml
    263 GeneratedFile(
    264     "ABIFunctionTypeGenerated.h",
    265     script="GenerateABIFunctionType.py",
    266     inputs=["ABIFunctionType.yaml"],
    267 )
    268 
    269 # Generate jit/MIROpsGenerated.h from jit/MIROps.yaml
    270 GeneratedFile(
    271     "MIROpsGenerated.h",
    272     script="GenerateMIRFiles.py",
    273     entry_point="generate_mir_header",
    274     inputs=["MIROps.yaml"],
    275 )
    276 
    277 # Generate jit/LIROpsGenerated.h from jit/LIR.h, jit/shared/LIR-shared.h, and
    278 # platform-specific LIR files.
    279 GeneratedFile(
    280     "LIROpsGenerated.h",
    281     script="GenerateLIRFiles.py",
    282     entry_point="generate_lir_header",
    283     inputs=["LIROps.yaml", "MIROps.yaml"],
    284 )
    285 
    286 # Generate jit/CacheIROpsGenerated.h from jit/CacheIROps.yaml
    287 GeneratedFile(
    288     "CacheIROpsGenerated.h",
    289     script="GenerateCacheIRFiles.py",
    290     entry_point="generate_cacheirops_header",
    291     inputs=["CacheIROps.yaml"],
    292 )
    293 
    294 GeneratedFile(
    295     "AtomicOperationsGenerated.h",
    296     script="GenerateAtomicOperations.py",
    297     entry_point="generate_atomics_header",
    298     inputs=[],
    299 )
    300 
    301 if CONFIG["ENABLE_JS_AOT_ICS"]:
    302     GeneratedFile(
    303         "CacheIRAOTGenerated.h",
    304         script="GenerateCacheIRFiles.py",
    305         entry_point="generate_aot_ics_header",
    306         inputs=["../ics/"],
    307         force=True,  # depends on list of files in js/src/ics/; always rebuild
    308     )
    309 
    310 if CONFIG["FUZZING_INTERFACES"] or CONFIG["FUZZING_JS_FUZZILLI"]:
    311     include("/tools/fuzzing/libfuzzer-config.mozbuild")