From 5f8de423f190bbb79a62f804151bc24824fa32d8 Mon Sep 17 00:00:00 2001 From: "Matt A. Tobin" Date: Fri, 2 Feb 2018 04:16:08 -0500 Subject: Add m-esr52 at 52.6.0 --- ipc/app/Makefile.in | 41 ++++++++ ipc/app/MozillaRuntimeMain.cpp | 19 ++++ ipc/app/MozillaRuntimeMainAndroid.cpp | 35 +++++++ ipc/app/macbuild/Contents/Info.plist.in | 33 ++++++ ipc/app/macbuild/Contents/PkgInfo | 1 + .../Resources/English.lproj/InfoPlist.strings.in | 7 ++ ipc/app/module.ver | 6 ++ ipc/app/moz.build | 114 +++++++++++++++++++++ ipc/app/pie/moz.build | 30 ++++++ ipc/app/plugin-container.exe.manifest | 43 ++++++++ 10 files changed, 329 insertions(+) create mode 100644 ipc/app/Makefile.in create mode 100644 ipc/app/MozillaRuntimeMain.cpp create mode 100644 ipc/app/MozillaRuntimeMainAndroid.cpp create mode 100644 ipc/app/macbuild/Contents/Info.plist.in create mode 100644 ipc/app/macbuild/Contents/PkgInfo create mode 100644 ipc/app/macbuild/Contents/Resources/English.lproj/InfoPlist.strings.in create mode 100644 ipc/app/module.ver create mode 100644 ipc/app/moz.build create mode 100644 ipc/app/pie/moz.build create mode 100644 ipc/app/plugin-container.exe.manifest (limited to 'ipc/app') diff --git a/ipc/app/Makefile.in b/ipc/app/Makefile.in new file mode 100644 index 0000000000..d5593724c0 --- /dev/null +++ b/ipc/app/Makefile.in @@ -0,0 +1,41 @@ +# 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/. + +ifndef MOZ_WINCONSOLE +ifdef MOZ_DEBUG +MOZ_WINCONSOLE = 1 +else +MOZ_WINCONSOLE = 0 +endif +endif + +# This switches $(INSTALL) to copy mode, like $(SYSINSTALL), so things that +# shouldn't get 755 perms need $(IFLAGS1) for either way of calling nsinstall. +NSDISTMODE = copy + +include $(topsrcdir)/config/config.mk + +include $(topsrcdir)/config/rules.mk + +ifneq ($(MOZ_WIDGET_TOOLKIT),android) +#LIBS += ../contentproc/$(LIB_PREFIX)plugin-container.$(LIB_SUFFIX) +endif + +ifeq ($(OS_ARCH),WINNT) #{ +# Note the manifest file exists in the tree, so we use the explicit filename +# here. +EXTRA_DEPS += plugin-container.exe.manifest +endif #} + +ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT)) #{ + +libs:: + $(NSINSTALL) -D $(DIST)/bin/$(PROGRAM).app + rsync -a -C --exclude '*.in' $(srcdir)/macbuild/Contents $(DIST)/bin/$(MOZ_CHILD_PROCESS_NAME).app + sed -e 's/%PROGRAM%/$(MOZ_CHILD_PROCESS_NAME)/' $(srcdir)/macbuild/Contents/Info.plist.in > $(DIST)/bin/$(MOZ_CHILD_PROCESS_NAME).app/Contents/Info.plist + sed -e 's/%APP_NAME%/$(MOZ_APP_DISPLAYNAME)/' $(srcdir)/macbuild/Contents/Resources/English.lproj/InfoPlist.strings.in | \ + iconv -f UTF-8 -t UTF-16 > $(DIST)/bin/$(MOZ_CHILD_PROCESS_NAME).app/Contents/Resources/English.lproj/InfoPlist.strings + $(NSINSTALL) -D $(DIST)/bin/$(MOZ_CHILD_PROCESS_NAME).app/Contents/MacOS + $(NSINSTALL) $(DIST)/bin/$(MOZ_CHILD_PROCESS_NAME) $(DIST)/bin/$(MOZ_CHILD_PROCESS_NAME).app/Contents/MacOS +endif #} diff --git a/ipc/app/MozillaRuntimeMain.cpp b/ipc/app/MozillaRuntimeMain.cpp new file mode 100644 index 0000000000..3f977e4623 --- /dev/null +++ b/ipc/app/MozillaRuntimeMain.cpp @@ -0,0 +1,19 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim: set ts=8 sts=2 et sw=2 tw=80: */ +/* 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/. */ + +#include "../contentproc/plugin-container.cpp" + +#include "mozilla/WindowsDllBlocklist.h" + +int +main(int argc, char *argv[]) +{ +#ifdef HAS_DLL_BLOCKLIST + DllBlocklist_Initialize(); +#endif + + return content_process_main(argc, argv); +} diff --git a/ipc/app/MozillaRuntimeMainAndroid.cpp b/ipc/app/MozillaRuntimeMainAndroid.cpp new file mode 100644 index 0000000000..81b89eef5a --- /dev/null +++ b/ipc/app/MozillaRuntimeMainAndroid.cpp @@ -0,0 +1,35 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: sw=4 ts=4 et : + * 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/. */ + +#include +#include + +int +main(int argc, char* argv[]) +{ + // Check for the absolute minimum number of args we need to move + // forward here. We expect the last arg to be the child process type. + if (argc < 2) + return 1; + + void *mozloader_handle = dlopen("libmozglue.so", RTLD_LAZY); + if (!mozloader_handle) { + __android_log_print(ANDROID_LOG_ERROR, "GeckoChildLoad", + "Couldn't load mozloader because %s", dlerror()); + return 1; + } + + typedef int (*ChildProcessInit_t)(int, char**); + ChildProcessInit_t fChildProcessInit = + (ChildProcessInit_t)dlsym(mozloader_handle, "ChildProcessInit"); + if (!fChildProcessInit) { + __android_log_print(ANDROID_LOG_ERROR, "GeckoChildLoad", + "Couldn't load cpi_t because %s", dlerror()); + return 1; + } + + return fChildProcessInit(argc, argv); +} diff --git a/ipc/app/macbuild/Contents/Info.plist.in b/ipc/app/macbuild/Contents/Info.plist.in new file mode 100644 index 0000000000..c5291160ef --- /dev/null +++ b/ipc/app/macbuild/Contents/Info.plist.in @@ -0,0 +1,33 @@ + + + + + CFBundleDevelopmentRegion + English + CFBundleExecutable + %PROGRAM% + CFBundleIdentifier + org.mozilla.plugincontainer + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + APPL + CFBundleSignature + ???? + CFBundleVersion + 1.0 + LSMinimumSystemVersion + 10.5 + LSMinimumSystemVersionByArchitecture + + i386 + 10.5.0 + x86_64 + 10.6.0 + + LSUIElement + 1 + NSSupportsAutomaticGraphicsSwitching + + + diff --git a/ipc/app/macbuild/Contents/PkgInfo b/ipc/app/macbuild/Contents/PkgInfo new file mode 100644 index 0000000000..bd04210fb4 --- /dev/null +++ b/ipc/app/macbuild/Contents/PkgInfo @@ -0,0 +1 @@ +APPL???? \ No newline at end of file diff --git a/ipc/app/macbuild/Contents/Resources/English.lproj/InfoPlist.strings.in b/ipc/app/macbuild/Contents/Resources/English.lproj/InfoPlist.strings.in new file mode 100644 index 0000000000..c07ad220d1 --- /dev/null +++ b/ipc/app/macbuild/Contents/Resources/English.lproj/InfoPlist.strings.in @@ -0,0 +1,7 @@ +/* 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/. */ + +/* Localized versions of Info.plist keys */ + +CFBundleName = "%APP_NAME%"; diff --git a/ipc/app/module.ver b/ipc/app/module.ver new file mode 100644 index 0000000000..8abbd23f0e --- /dev/null +++ b/ipc/app/module.ver @@ -0,0 +1,6 @@ +WIN32_MODULE_COMPANYNAME=Mozilla Corporation +WIN32_MODULE_PRODUCTVERSION=@MOZ_APP_WINVERSION@ +WIN32_MODULE_PRODUCTVERSION_STRING=@MOZ_APP_VERSION@ +WIN32_MODULE_DESCRIPTION=Plugin Container for @MOZ_APP_DISPLAYNAME@ +WIN32_MODULE_PRODUCTNAME=@MOZ_APP_DISPLAYNAME@ +WIN32_MODULE_NAME=@MOZ_APP_DISPLAYNAME@ diff --git a/ipc/app/moz.build b/ipc/app/moz.build new file mode 100644 index 0000000000..55c338cb89 --- /dev/null +++ b/ipc/app/moz.build @@ -0,0 +1,114 @@ +# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*- +# 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/. + +# Any changes that affect Android need to be made in pie/moz.build as well. + +if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'android': + Program(CONFIG['MOZ_CHILD_PROCESS_NAME']) + SOURCES += [ + 'MozillaRuntimeMainAndroid.cpp', + ] + + DIRS += ['pie'] +else: + GeckoProgram(CONFIG['MOZ_CHILD_PROCESS_NAME'], linkage='dependent') + + SOURCES += [ + 'MozillaRuntimeMain.cpp', + ] + +include('/ipc/chromium/chromium-config.mozbuild') + +LOCAL_INCLUDES += [ + '/toolkit/xre', + '/xpcom/base', +] + +# We link GMPLoader into plugin-container on desktop so that its code is +# covered by the desktop DRM vendor's voucher. +if CONFIG['OS_TARGET'] != 'Android': + SOURCES += [ + '../../dom/media/gmp/GMPLoader.cpp', + ] + USE_LIBS += [ + 'rlz', + ] + +# DELAYLOAD_DLLS in this block ensures that the DLL blocklist is functional +if CONFIG['OS_ARCH'] == 'WINNT': + DELAYLOAD_DLLS += [ + 'nss3.dll', + ] + + if CONFIG['MOZ_SANDBOX']: + # For sandbox includes and the include dependencies those have + LOCAL_INCLUDES += [ + '/security/sandbox/chromium', + '/security/sandbox/chromium-shim', + ] + + USE_LIBS += [ + 'sandbox_s', + ] + + DELAYLOAD_DLLS += [ + 'winmm.dll', + 'user32.dll', + ] + + DELAYLOAD_DLLS += [ + 'xul.dll', + ] + +if CONFIG['MOZ_SANDBOX'] and CONFIG['OS_TARGET'] in ('Linux', 'Android'): + USE_LIBS += [ + 'mozsandbox', + ] + + # gcc lto likes to put the top level asm in syscall.cc in a different partition + # from the function using it which breaks the build. Work around that by + # forcing there to be only one partition. + if '-flto' in CONFIG['OS_CXXFLAGS'] and not CONFIG['CLANG_CXX']: + LDFLAGS += ['--param lto-partitions=1'] + +if CONFIG['MOZ_SANDBOX'] and CONFIG['OS_TARGET'] == 'Darwin': + # For sandbox includes and the include dependencies those have + LOCAL_INCLUDES += [ + '/security/sandbox/chromium', + '/security/sandbox/chromium-shim', + ] + USE_LIBS += [ + 'mozsandbox', + ] + +if CONFIG['_MSC_VER']: + # Always enter a Windows program through wmain, whether or not we're + # a console application. + WIN32_EXE_LDFLAGS += ['-ENTRY:wmainCRTStartup'] + +LDFLAGS += CONFIG['MOZ_ALLOW_HEAP_EXECUTE_FLAGS'] + +# Control the default heap size. +# This is the heap returned by GetProcessHeap(). +# As we use the CRT heap, the default size is too large and wastes VM. +# +# The default heap size is 1MB on Win32. +# The heap will grow if need be. +# +# Set it to 256k. See bug 127069. +if CONFIG['OS_ARCH'] == 'WINNT' and not CONFIG['GNU_CC']: + LDFLAGS += ['/HEAP:0x40000'] + +if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk': + OS_LIBS += [ + 'binder', + 'utils', + ] + +if CONFIG['GNU_CXX']: + CXXFLAGS += ['-Wshadow'] + +DEFINES['MOZ_PLUGIN_CONTAINER'] = 1; diff --git a/ipc/app/pie/moz.build b/ipc/app/pie/moz.build new file mode 100644 index 0000000000..0247b25b4b --- /dev/null +++ b/ipc/app/pie/moz.build @@ -0,0 +1,30 @@ +# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*- +# 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/. + +Program(CONFIG['MOZ_CHILD_PROCESS_NAME_PIE']) +SOURCES += [ + '../MozillaRuntimeMainAndroid.cpp', +] + +include('/ipc/chromium/chromium-config.mozbuild') + +LOCAL_INCLUDES += [ + '/toolkit/xre', + '/xpcom/base', +] + +if CONFIG['MOZ_SANDBOX']: + USE_LIBS += [ + 'mozsandbox', + ] + + # gcc lto likes to put the top level asm in syscall.cc in a different partition + # from the function using it which breaks the build. Work around that by + # forcing there to be only one partition. + if '-flto' in CONFIG['OS_CXXFLAGS'] and not CONFIG['CLANG_CXX']: + LDFLAGS += ['--param lto-partitions=1'] + +LDFLAGS += ['-pie'] diff --git a/ipc/app/plugin-container.exe.manifest b/ipc/app/plugin-container.exe.manifest new file mode 100644 index 0000000000..d61ddec1a8 --- /dev/null +++ b/ipc/app/plugin-container.exe.manifest @@ -0,0 +1,43 @@ + + + +Firefox Runtime + + + + + + + + + + + + + + + True/PM + + + + + + + + + + + + -- cgit v1.2.3