moz.build (1602B)
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 Library("winlauncher-freestanding") 8 9 FORCE_STATIC_LIB = True 10 11 # Our patched NtMapViewOfSection can be called before the process's import 12 # table is populated. Don't let the compiler insert any instrumentation 13 # that might call an import. 14 NO_PGO = True 15 16 UNIFIED_SOURCES += [ 17 "DllBlocklist.cpp", 18 "LoaderPrivateAPI.cpp", 19 "ModuleLoadFrame.cpp", 20 "SharedSection.cpp", 21 ] 22 23 # This library must be compiled in a freestanding environment, as its code must 24 # not assume that it has access to any runtime libraries. 25 if CONFIG["CC_TYPE"] == "clang-cl": 26 CXXFLAGS += ["-Xclang"] 27 28 CXXFLAGS += [ 29 "-ffreestanding", 30 ] 31 32 # Forcibly include Freestanding.h into all source files in this library. 33 if CONFIG["CC_TYPE"] == "clang-cl": 34 CXXFLAGS += ["-FI"] 35 else: 36 CXXFLAGS += ["-include"] 37 38 CXXFLAGS += [SRCDIR + "/Freestanding.h"] 39 40 OS_LIBS += [ 41 "ntdll", 42 "ntdll_freestanding", 43 ] 44 45 if CONFIG["COMPILE_ENVIRONMENT"] and CONFIG["LLVM_DLLTOOL"]: 46 GeneratedFile( 47 "%sntdll_freestanding.%s" % (CONFIG["LIB_PREFIX"], CONFIG["LIB_SUFFIX"]), 48 script="gen_ntdll_freestanding_lib.py", 49 inputs=["ntdll_freestanding.def"], 50 flags=[CONFIG["LLVM_DLLTOOL"]] + CONFIG["LLVM_DLLTOOL_FLAGS"], 51 ) 52 53 DisableStlWrapping() 54 55 with Files("**"): 56 BUG_COMPONENT = ("Firefox", "Launcher Process")