diff options
author | pho <pho> | 2015-01-30 07:32:24 +0000 |
---|---|---|
committer | pho <pho> | 2015-01-30 07:32:24 +0000 |
commit | 9bd5cec207ef603411895a4c8fa23a8812365b8d (patch) | |
tree | a358b41942010790d2cdf3f2aeda0a14661c557d /www | |
parent | af7ebe0a92eecafe46132f772aeacd3a8994de31 (diff) | |
download | pkgsrc-9bd5cec207ef603411895a4c8fa23a8812365b8d.tar.gz |
Fix many issues on Darwin
PLIST:
* lib/firefox/libmozglue.so is built and installed as a shared
library on some platforms including Darwin.
mozilla-common.mk:
* Sandboxing support is only available when the toolkit is
cairo-cocoa.
* It tries to use MacOS X 10.6 SDK by default, which is not always
possible.
patches/patch-build_gyp.mozbuild:
* Don't assume iOS just because the toolkit is not cocoa. Ideally
there should be an AC_SUBST just like 'ARM_ARCH' but nothing
exists currently.
* MacOS X SDK version should be able to configure with ./configure
--enable-macos-target=VER
patches/patch-extensions_spellcheck_hunspell_src_mozHunspell.cpp:
* NS_NewNativeLocalFile() can fail and leave hunDir null, so we must
check if it succeeded. This is not Darwin specific though.
* "%%LOCALBASE%%" in the hunspell path is currently not substituted,
which looks very erroneous to me. But since I don't know why
ryoon@ changed it from "@PREFIX@" to "%%LOCALBASE%%" I leave it as
it is.
patches/patch-ipc_glue_moz.build:
* Don't assume cocoa toolkit just because OS_ARCH is Darwin.
patches/patch-js_src_asmjs_AsmJSSignalHandlers.cpp:
* Increase portability for non-x86 Darwin by not hardwiring
x86_THREAD_STATE.
patches/patch-js_xpconnect_src_xpcprivate.h:
* The declaration has to be C++11 'extern template', otherwise
non-weak symbol collision will occur between libmozjs and
libxul. We can't easily test if the feature is supported by
compiler due to GCC bug #1773:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=1773
patches/patch-memory_mozalloc_VolatileBufferOSX.cpp:
* Try to fallback to valloc(3) if posix_memalign(3) is not
avialble. It has been added since MacOS 10.6.
patches/patch-toolkit_library_moz.build:
* GSTREAMER_LIBS are linked to libxul on Darwin, while they are
dlopen(3)'ed at runtime on other platforms. The problem is that
the toolkit being cocoa isn't relevant at all. It's Darwin that
needs the special handling, not Cocoa.
patches/patch-toolkit_xre_nsAppRunner.cpp:
* MacOS X < 10.6 had an undocumented behavior concerning execve(2)
inside a threaded process. If a process tried to call execve(2)
and had more than one active thread, the kernel returned
ENOTSUP. So we have to either fork(2) or vfork(2) before calling
execve(2) to make sure the caller is single-threaded as otherwise
the application fails to restart itself.
patches/patch-xpcom_base_nsStackWalk.cpp,
patches/patch-xpcom_build_PoisonIOInterposer.h:
* Replace XP_MACOSX with XP_DARWIN as the former is not defined when
the toolkit is not cocoa.
patches/patch-xpcom_glue_standalone_nsXPCOMGlue.cpp:
* Fix inconsistent use of XP_DARWIN and XP_MACOSX:
LEADING_UNDERSCORE should be empty when we are going to load XPCOM
using dlopen(3), not NSAddImage().
Diffstat (limited to 'www')
-rw-r--r-- | www/firefox/PLIST | 3 | ||||
-rw-r--r-- | www/firefox/distinfo | 18 | ||||
-rw-r--r-- | www/firefox/mozilla-common.mk | 16 | ||||
-rw-r--r-- | www/firefox/patches/patch-build_gyp.mozbuild | 36 | ||||
-rw-r--r-- | www/firefox/patches/patch-extensions_spellcheck_hunspell_src_mozHunspell.cpp | 16 | ||||
-rw-r--r-- | www/firefox/patches/patch-ipc_glue_moz.build | 15 | ||||
-rw-r--r-- | www/firefox/patches/patch-js_src_asmjs_AsmJSSignalHandlers.cpp | 102 | ||||
-rw-r--r-- | www/firefox/patches/patch-js_xpconnect_src_xpcprivate.h | 15 | ||||
-rw-r--r-- | www/firefox/patches/patch-memory_mozalloc_VolatileBufferOSX.cpp | 22 | ||||
-rw-r--r-- | www/firefox/patches/patch-toolkit_library_moz.build | 25 | ||||
-rw-r--r-- | www/firefox/patches/patch-toolkit_xre_nsAppRunner.cpp | 46 | ||||
-rw-r--r-- | www/firefox/patches/patch-xpcom_base_nsStackWalk.cpp | 38 | ||||
-rw-r--r-- | www/firefox/patches/patch-xpcom_build_PoisonIOInterposer.h | 58 | ||||
-rw-r--r-- | www/firefox/patches/patch-xpcom_glue_standalone_nsXPCOMGlue.cpp | 17 |
14 files changed, 396 insertions, 31 deletions
diff --git a/www/firefox/PLIST b/www/firefox/PLIST index b4a0ed0ae1a..044956f4af1 100644 --- a/www/firefox/PLIST +++ b/www/firefox/PLIST @@ -1,4 +1,4 @@ -@comment $NetBSD: PLIST,v 1.91 2015/01/16 22:42:09 ryoon Exp $ +@comment $NetBSD: PLIST,v 1.92 2015/01/30 07:32:24 pho Exp $ bin/firefox lib/firefox/application.ini lib/firefox/browser/blocklist.xml @@ -2462,6 +2462,7 @@ lib/firefox/hyphenation/hyph_sv.dic lib/firefox/hyphenation/hyph_tr.dic lib/firefox/hyphenation/hyph_uk.dic lib/firefox/libmozalloc.so +${PLIST.mozglue}lib/firefox/libmozglue.so lib/firefox/libmozjs.so lib/firefox/libxul.so lib/firefox/modules/ActivitiesService.jsm diff --git a/www/firefox/distinfo b/www/firefox/distinfo index a9741dc33aa..e96e488acec 100644 --- a/www/firefox/distinfo +++ b/www/firefox/distinfo @@ -1,4 +1,4 @@ -$NetBSD: distinfo,v 1.180 2015/01/29 22:22:26 wiz Exp $ +$NetBSD: distinfo,v 1.181 2015/01/30 07:32:24 pho Exp $ SHA1 (firefox-35.0.1.source.tar.bz2) = cf256ee1491ee502eb4432ade5a879104ebceede RMD160 (firefox-35.0.1.source.tar.bz2) = ca4dc6f6c5de1e6e69133de3b8b502991d519fa7 @@ -14,7 +14,7 @@ SHA1 (patch-browser_app_nsBrowserApp.cpp) = 18f29d7a41ba088e332915e7f81b8fcccd95 SHA1 (patch-browser_installer_package-manifest.in) = 83a0073525c607e05414688aa07035cc3f08e50a SHA1 (patch-build_autoconf_compiler-opts.m4) = ccdc06a2b07b7664f9cb91bcc4fb29052dda8b07 SHA1 (patch-build_autoconf_nss.m4) = bf65db126705a3a1ba294418b9380683ea401fc7 -SHA1 (patch-build_gyp.mozbuild) = 2842da0783d344dd12e86adde447f7cda6191518 +SHA1 (patch-build_gyp.mozbuild) = 201715e30e20090e9a9ef54cb981d283c9aabf8f SHA1 (patch-build_pgo_profileserver.py) = 8666187258e47c037f2065a19a5b38946fdc0f6c SHA1 (patch-config_Makefile.in) = 296bd3bc33346cfcfa658fe641c2ee2ac67549f1 SHA1 (patch-config_baseconfig.mk) = 07c295fbfbaeb969b336def32d8924729e332075 @@ -34,7 +34,7 @@ SHA1 (patch-dom_plugins_ipc_PluginModuleChild.cpp) = 69b0a51d733cd52e7d200052362 SHA1 (patch-dom_plugins_ipc_PluginModuleChild.h) = 0a7f3167e939822013ae6195406657453578453e SHA1 (patch-dom_plugins_ipc_PluginProcessChild.cpp) = 5ab28cc0398b72cb5e1b0586406845495b9f87e4 SHA1 (patch-dom_system_OSFileConstants.cpp) = fec01c3c2c1b7e1c57abe9ec269067ee98eede3d -SHA1 (patch-extensions_spellcheck_hunspell_src_mozHunspell.cpp) = 9ccb4210902f3c9b60b2ced1aab83d6f8bfd3de3 +SHA1 (patch-extensions_spellcheck_hunspell_src_mozHunspell.cpp) = 40534b11b594f29b1cc9f17409a85e7382e6f3dd SHA1 (patch-gfx_graphite2_moz-gr-update.sh) = b987dad1bd4513b8a04fb280bd1c5280a03af746 SHA1 (patch-gfx_graphite2_src_Bidi.cpp) = 5e80b4a32a47ae44d237fec69ea87bdd612a76ce SHA1 (patch-gfx_moz.build) = a98bda4727538f4a0f09a20b84f9dd883edaf7d9 @@ -65,18 +65,20 @@ SHA1 (patch-ipc_chromium_src_chrome_common_transport__dib.h) = 7af18973c005d7b14 SHA1 (patch-ipc_glue_GeckoChildProcessHost.cpp) = 45f2f22b4f567ffddd4458f635179b5201e87e64 SHA1 (patch-ipc_glue_ScopedXREEmbed.cpp) = 97c39f25527dac4c22b38ce446ca2cd4cef08fd0 SHA1 (patch-ipc_glue_StringUtil.cpp) = f238adebb5bdf57f7109a781c6f3fb195763f3c0 +SHA1 (patch-ipc_glue_moz.build) = 2682ca9de9606e50602a124e287dded2b9f2859b SHA1 (patch-ipc_ipdl_ipdl_cxx_ast.py) = 047b7012dffdcfc2b07d2d249fb3523e7d4643f8 SHA1 (patch-ipc_ipdl_ipdl_cxx_cgen.py) = d7f7dc85b1ff26c6d7e902f94c0ac09f04497105 SHA1 (patch-ipc_ipdl_ipdl_lower.py) = 2ef9504e462d0e3db16f9b0a6303ea5971b9c2a2 SHA1 (patch-js__src__vm__SPSProfiler.cpp) = 989ba25e4c5308d21d07baa802decce13609a475 SHA1 (patch-js_src_Makefile.in) = 4f90e74c19b379bf756210a0cebda265876a2fa1 +SHA1 (patch-js_src_asmjs_AsmJSSignalHandlers.cpp) = 4d994e1f6b9a2bfc01204eb96f002cdf2a8d1bd9 SHA1 (patch-js_src_ctypes_CTypes.h) = 768a084239f92a424c1c7dc9eaaf9be9456ca9f0 SHA1 (patch-js_src_frontend_ParseMaps.cpp) = c00117d79b78904bc50a1d664a8fc0e4e339bfbc SHA1 (patch-js_src_gc_Memory.cpp) = f2ee54f0a05d870651a3235b95bbb346586f3c3c SHA1 (patch-js_src_jit_ExecutableAllocator.h) = 24bb91e5be41cc4a7658d633c9f4f7c0dc64fd8a SHA1 (patch-js_src_jit_arm_Architecture-arm.cpp) = c1ff7591bd9b8b4a7aea254f674d25b89345f099 SHA1 (patch-js_src_jsmath.cpp) = 7d4993ae91e9b5e6820358165603819aefb586f9 -SHA1 (patch-js_xpconnect_src_xpcprivate.h) = 3406e02342d8a890b83a241ee2cc8cd9b3fefdaa +SHA1 (patch-js_xpconnect_src_xpcprivate.h) = 8a15ff542c9d3fce448d9ec63706f7dfb411d926 SHA1 (patch-media_libcubeb_AUTHORS) = 3db32086f98c2bbe16e9394bb5121d7a95cdb4af SHA1 (patch-media_libcubeb_src_cubeb.c) = effe8771e42adddb478ecb302352ef003bdd01db SHA1 (patch-media_libcubeb_src_cubeb__alsa.c) = 8c275bf024bf23dc42f82e6a0765ddc8b18bc1a9 @@ -109,6 +111,7 @@ SHA1 (patch-media_webrtc_trunk_webrtc_system__wrappers_source_spreadsortlib_spre SHA1 (patch-memory_build_mozjemalloc__compat.c) = ce6cd2865fd7ee6dd6a5926c9f85a2d6aa086517 SHA1 (patch-memory_jemalloc_Makefile.in) = 772e996c8da254f952d0f3a0c9325a177c838543 SHA1 (patch-memory_jemalloc_src_configure) = 563834e1a0dc0eba17b4f263de26787672ff9200 +SHA1 (patch-memory_mozalloc_VolatileBufferOSX.cpp) = 3ee53fd4213b6dab8bdce02b4c2f14cef7caaca8 SHA1 (patch-memory_mozalloc_mozalloc__abort.cpp) = 44cb29dac1e8032c3f58149227bfe5ad94e8edb9 SHA1 (patch-mfbt_Alignment.h) = 9ebc9892fd11eba7105974979b54f4f8759b7749 SHA1 (patch-mfbt_Attributes.h) = 0cf62084c0220a3fa46226714cea5c30b1b155e9 @@ -126,7 +129,7 @@ SHA1 (patch-security_manager_ssl_src_nsNSSComponent.cpp) = 28d216fb8dcb5968c1ff6 SHA1 (patch-toolkit_components_alerts_nsAlertsService.cpp) = e84436c5d5bde7ef23bf60b5f33c63924730e1da SHA1 (patch-toolkit_components_osfile_modules_osfile__unix__back.jsm) = 6b926ccd793391ad7bd7101635f4b3eefe3db130 SHA1 (patch-toolkit_components_osfile_modules_osfile__unix__front.jsm) = f5adba2137f2d7fd4d4a6a1e8ef8625866513890 -SHA1 (patch-toolkit_library_moz.build) = 4e768a5388e1b22af9a7b2746fadf392ba0a8e8c +SHA1 (patch-toolkit_library_moz.build) = f703ede3c619bdb38f6b90bcc468991803e55e44 SHA1 (patch-toolkit_modules_GMPInstallManager.jsm) = 7e410806f44e7f20109260bef96cd13101c27664 SHA1 (patch-toolkit_mozapps_extensions_internal_OpenH264Provider.jsm) = 75647c1b705bcac8b64064e1eea26cb15b435613 SHA1 (patch-toolkit_system_gnome_moz.build) = 75a35ca36fb760adf5b49134cb843608e6aa9eb5 @@ -135,6 +138,7 @@ SHA1 (patch-toolkit_system_gnome_nsAlertsIconListener.h) = c7f6394134a8876ae5637 SHA1 (patch-toolkit_system_gnome_nsGnomeModule.cpp) = 8e28490cfffaf868f27643044aeb0178c1929215 SHA1 (patch-toolkit_system_gnome_nsSystemAlertsService.cpp) = 1024f24a8d65a27f87056deb587fc967f016d020 SHA1 (patch-toolkit_system_gnome_nsSystemAlertsService.h) = ba4b9507f0e3e598788cd44c503a5735e682da87 +SHA1 (patch-toolkit_xre_nsAppRunner.cpp) = f335d64cb0e1d248fd2c41a167ee1874218e7db6 SHA1 (patch-toolkit_xre_nsEmbedFunctions.cpp) = 6ee6fba04a3ecc6596f8aed67f752a1075901fa8 SHA1 (patch-webapprt_moz.build) = 177468d5e12c49db1ad5376f0f3df34fa9df070c SHA1 (patch-widget_gtk_gtk3drawing.c) = 35f849793b8051b88921987bc07062a2b1619092 @@ -142,9 +146,11 @@ SHA1 (patch-widget_gtk_mozgtk_mozgtk.c) = c6ffe6d2662ca6ec82958ab3f3c31bccf4aaf1 SHA1 (patch-widget_gtk_nsLookAndFeel.cpp) = 34e87c51284cec254344993bfddbd6699bbc6117 SHA1 (patch-widget_gtk_nsLookAndFeel.h) = a639562ca57e1353160b306c8b5805349b130a8a SHA1 (patch-widget_gtk_nsWindow.cpp) = b9f4cb3c46c34438b136246396de571ccf23d9b6 -SHA1 (patch-xpcom_base_nsStackWalk.cpp) = 933c44297371af2eaa5b7588cdcb6e3bc68f74fc +SHA1 (patch-xpcom_base_nsStackWalk.cpp) = b1a4587c193ac84a3159add1de1e6aa9c13f2f53 SHA1 (patch-xpcom_base_nscore.h) = f4fe66cc9e714a2101a4d1287359d1c300574438 +SHA1 (patch-xpcom_build_PoisonIOInterposer.h) = b0a53ec580bf5c2277d19618c1240a447575ae68 SHA1 (patch-xpcom_build_XPCOMInit.cpp) = 9c0d4c7f937ccc127974a80c826316bfae9920f9 +SHA1 (patch-xpcom_glue_standalone_nsXPCOMGlue.cpp) = a6ef7f490d52037d2a72d3d52d834a182a29eccb SHA1 (patch-xpcom_reflect_xptcall_md_unix_Makefile.in) = 1e4d71a06b34556fa9339f97b75a065539baa511 SHA1 (patch-xpcom_reflect_xptcall_md_unix_moz.build) = a0445488bbcabe7a67a83df3d75f2d956e172a1f SHA1 (patch-xpcom_reflect_xptcall_md_unix_xptcinvoke__arm__netbsd.cpp) = 493d1433ae72bbd0c65ab3f51de43fb864a6f58d diff --git a/www/firefox/mozilla-common.mk b/www/firefox/mozilla-common.mk index 9ec16f9ddd2..5930ed587fa 100644 --- a/www/firefox/mozilla-common.mk +++ b/www/firefox/mozilla-common.mk @@ -1,4 +1,4 @@ -# $NetBSD: mozilla-common.mk,v 1.47 2014/11/06 13:56:32 ryoon Exp $ +# $NetBSD: mozilla-common.mk,v 1.48 2015/01/30 07:32:24 pho Exp $ # # common Makefile fragment for mozilla packages based on gecko 2.0. # @@ -151,6 +151,20 @@ PLIST.vorbis= yes PLIST.mozglue= yes .endif +# See ${WRKSRC}/security/sandbox/mac/Sandbox.mm: On Darwin, sandboxing +# support is only available when the toolkit is cairo-cocoa. +.if ${OPSYS} == "Darwin" +CONFIGURE_ARGS+= --disable-sandbox +.endif + +# See ${WRKSRC}/configure.in: It tries to use MacOS X 10.6 SDK by +# default, which is not always possible. +.if !empty(MACHINE_PLATFORM:MDarwin-8.*-*) +CONFIGURE_ARGS+= --enable-macos-target=10.4 +.elif !empty(MACHINE_PLATFORM:MDarwin-9.*-*) +CONFIGURE_ARGS+= --enable-macos-target=10.5 +.endif + # # pysqlite2 is used by xulrunner's Python virtualenv. If pysqlite2 isn't # installed at build time it will attempt to download it instead, so the diff --git a/www/firefox/patches/patch-build_gyp.mozbuild b/www/firefox/patches/patch-build_gyp.mozbuild index a3b49a79ce1..70be9fbf94c 100644 --- a/www/firefox/patches/patch-build_gyp.mozbuild +++ b/www/firefox/patches/patch-build_gyp.mozbuild @@ -1,8 +1,17 @@ -$NetBSD: patch-build_gyp.mozbuild,v 1.1 2014/04/30 15:07:18 ryoon Exp $ +$NetBSD: patch-build_gyp.mozbuild,v 1.2 2015/01/30 07:32:24 pho Exp $ ---- build/gyp.mozbuild.orig 2014-04-18 02:02:38.000000000 +0000 +Hunk #2: + On Darwin, don't assume iOS just because the toolkit is not + cocoa. Ideally there should be an AC_SUBST just like 'ARM_ARCH' but + nothing exists currently. + +Hunk #3: + MacOS X SDK version should be able to configure with + ./configure --enable-macos-target=VER + +--- build/gyp.mozbuild.orig 2015-01-23 05:59:58.000000000 +0000 +++ build/gyp.mozbuild -@@ -11,6 +11,7 @@ gyp_vars = { +@@ -12,6 +12,7 @@ gyp_vars = { 'have_ethtool_cmd_speed_hi': 1 if CONFIG['MOZ_WEBRTC_HAVE_ETHTOOL_SPEED_HI'] else 0, 'include_alsa_audio': 1 if CONFIG['MOZ_ALSA'] else 0, 'include_pulse_audio': 1 if CONFIG['MOZ_PULSEAUDIO'] else 0, @@ -10,3 +19,24 @@ $NetBSD: patch-build_gyp.mozbuild,v 1.1 2014/04/30 15:07:18 ryoon Exp $ # basic stuff for everything 'include_internal_video_render': 0, 'clang_use_chrome_plugins': 0, +@@ -85,7 +86,7 @@ flavors = { + 'WINNT': 'win', + 'Android': 'linux' if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk' else 'android', + 'Linux': 'linux', +- 'Darwin': 'mac' if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa' else 'ios', ++ 'Darwin': 'ios' if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cairo-uikit' else 'mac', + 'SunOS': 'solaris', + 'GNU/kFreeBSD': 'freebsd', + 'DragonFly': 'dragonfly', +@@ -120,5 +121,11 @@ if CONFIG['INTEL_ARCHITECTURE']: + if not CONFIG['HAVE_TOOLCHAIN_SUPPORT_MSSSE3'] or not CONFIG['HAVE_TOOLCHAIN_SUPPORT_MSSE4_1']: + gyp_vars['yuv_disable_asm'] = 1 + ++# MacOS X SDK version should be able to configure with ./configure ++# --enable-macos-target=VER ++if CONFIG['MACOSX_DEPLOYMENT_TARGET']: ++ gyp_vars['mac_sdk_min'] = CONFIG['MACOSX_DEPLOYMENT_TARGET'] ++ gyp_vars['mac_deployment_target'] = CONFIG['MACOSX_DEPLOYMENT_TARGET'] ++ + if CONFIG['MACOS_SDK_DIR']: + gyp_vars['mac_sdk_path'] = CONFIG['MACOS_SDK_DIR'] diff --git a/www/firefox/patches/patch-extensions_spellcheck_hunspell_src_mozHunspell.cpp b/www/firefox/patches/patch-extensions_spellcheck_hunspell_src_mozHunspell.cpp index 6a0827adcb4..c81a90abb80 100644 --- a/www/firefox/patches/patch-extensions_spellcheck_hunspell_src_mozHunspell.cpp +++ b/www/firefox/patches/patch-extensions_spellcheck_hunspell_src_mozHunspell.cpp @@ -1,16 +1,20 @@ -$NetBSD: patch-extensions_spellcheck_hunspell_src_mozHunspell.cpp,v 1.5 2015/01/16 22:42:09 ryoon Exp $ +$NetBSD: patch-extensions_spellcheck_hunspell_src_mozHunspell.cpp,v 1.6 2015/01/30 07:32:24 pho Exp $ ---- extensions/spellcheck/hunspell/src/mozHunspell.cpp.orig 2015-01-09 04:38:27.000000000 +0000 +Load system hunspell dictionaries. + +--- extensions/spellcheck/hunspell/src/mozHunspell.cpp.orig 2015-01-23 06:00:09.000000000 +0000 +++ extensions/spellcheck/hunspell/src/mozHunspell.cpp -@@ -400,6 +400,12 @@ mozHunspell::LoadDictionaryList(bool aNo +@@ -400,6 +400,14 @@ mozHunspell::LoadDictionaryList(bool aNo } } + // load system hunspell dictionaries -+ nsIFile* hunDir; ++ nsCOMPtr<nsIFile> hunDir; + NS_NewNativeLocalFile(NS_LITERAL_CSTRING("%%LOCALBASE%%/share/hunspell"), -+ true, &hunDir); -+ LoadDictionariesFromDir(hunDir); ++ true, getter_AddRefs(hunDir)); ++ if (hunDir) { ++ LoadDictionariesFromDir(hunDir); ++ } + // find dictionaries from extensions requiring restart nsCOMPtr<nsISimpleEnumerator> dictDirs; diff --git a/www/firefox/patches/patch-ipc_glue_moz.build b/www/firefox/patches/patch-ipc_glue_moz.build new file mode 100644 index 00000000000..cc44540c24c --- /dev/null +++ b/www/firefox/patches/patch-ipc_glue_moz.build @@ -0,0 +1,15 @@ +$NetBSD: patch-ipc_glue_moz.build,v 1.1 2015/01/30 07:32:24 pho Exp $ + +Don't assume cocoa toolkit just because OS_ARCH is Darwin. + +--- ipc/glue/moz.build.orig 2015-01-29 12:45:33.000000000 +0000 ++++ ipc/glue/moz.build +@@ -87,7 +87,7 @@ elif CONFIG['OS_ARCH'] in ('DragonFly', + UNIFIED_SOURCES += [ + 'ProcessUtils_bsd.cpp' + ] +-elif CONFIG['OS_ARCH'] in ('Darwin'): ++elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa': + UNIFIED_SOURCES += [ + 'ProcessUtils_mac.mm' + ] diff --git a/www/firefox/patches/patch-js_src_asmjs_AsmJSSignalHandlers.cpp b/www/firefox/patches/patch-js_src_asmjs_AsmJSSignalHandlers.cpp new file mode 100644 index 00000000000..8c95065ee39 --- /dev/null +++ b/www/firefox/patches/patch-js_src_asmjs_AsmJSSignalHandlers.cpp @@ -0,0 +1,102 @@ +$NetBSD: patch-js_src_asmjs_AsmJSSignalHandlers.cpp,v 1.1 2015/01/30 07:32:24 pho Exp $ + +Increase portability for non-x86 Darwin by not hardwiring +x86_THREAD_STATE. + +--- js/src/asmjs/AsmJSSignalHandlers.cpp.orig 2015-01-29 00:54:07.000000000 +0000 ++++ js/src/asmjs/AsmJSSignalHandlers.cpp +@@ -524,17 +524,62 @@ AsmJSExceptionHandler(LPEXCEPTION_POINTE + #elif defined(XP_MACOSX) + # include <mach/exc.h> + ++# if defined(ARM_THREAD_STATE) ++typedef arm_thread_state_t moz_platform_thread_state_t; ++static const thread_state_flavor_t MOZ_PLATFORM_THREAD_STATE_FLAVOR = ARM_THREAD_STATE; ++static const mach_msg_type_number_t MOZ_PLATFORM_THREAD_STATE_COUNT = ARM_THREAD_STATE_COUNT; ++ ++# elif defined(PPC_THREAD_STATE) ++typedef ppc_thread_state_t moz_platform_thread_state_t; ++static const thread_state_flavor_t MOZ_PLATFORM_THREAD_STATE_FLAVOR = PPC_THREAD_STATE; ++static const mach_msg_type_number_t MOZ_PLATFORM_THREAD_STATE_COUNT = PPC_THREAD_STATE_COUNT; ++ ++# elif defined(PPC_THREAD_STATE64) ++typedef ppc_thread_state64_t moz_platform_thread_state_t; ++static const thread_state_flavor_t MOZ_PLATFORM_THREAD_STATE_FLAVOR = PPC_THREAD_STATE64; ++static const mach_msg_type_number_t MOZ_PLATFORM_THREAD_STATE_COUNT = PPC_THREAD_STATE64_COUNT; ++ ++# elif defined(x86_THREAD_STATE) ++typedef x86_thread_state_t moz_platform_thread_state_t; ++static const thread_state_flavor_t MOZ_PLATFORM_THREAD_STATE_FLAVOR = x86_THREAD_STATE; ++static const mach_msg_type_number_t MOZ_PLATFORM_THREAD_STATE_COUNT = x86_THREAD_STATE_COUNT; ++ ++# else ++# error Type unknown for platform-specific thread_state_t ++# endif ++ ++# if defined(__DARWIN_UNIX03) ++# define REG_FIELD(NAME) __ ## NAME ++# else ++# define REG_FIELD(NAME) NAME ++# endif ++ + static uint8_t ** +-ContextToPC(x86_thread_state_t &state) ++ContextToPC(moz_platform_thread_state_t &state) + { +-# if defined(JS_CODEGEN_X64) +- JS_STATIC_ASSERT(sizeof(state.uts.ts64.__rip) == sizeof(void*)); +- return reinterpret_cast<uint8_t**>(&state.uts.ts64.__rip); +-# elif defined(JS_CODEGEN_NONE) +- MOZ_CRASH(); ++#if defined(ARM_THREAD_STATE) ++ JS_STATIC_ASSERT(sizeof(state.REG_FIELD(pc)) == sizeof(void*)); ++ return reinterpret_cast<uint8_t**>(&state.REG_FIELD(pc)); ++ ++#elif defined(PPC_THREAD_STATE) || defined(PPC_THREAD_STATE64) ++ JS_STATIC_ASSERT(sizeof(state.REG_FIELD(srr0)) == sizeof(void*)); ++ return reinterpret_cast<uint8_t**>(&state.REG_FIELD(srr0)); ++ ++#elif defined(x86_THREAD_STATE) ++ switch (state.tsh.flavor) { ++ case x86_THREAD_STATE32: ++ JS_STATIC_ASSERT(sizeof(state.uts.ts32.REG_FIELD(eip)) == sizeof(void*)); ++ return reinterpret_cast<uint8_t**>(&state.uts.ts32.REG_FIELD(eip)); ++ ++ case x86_THREAD_STATE64: ++ JS_STATIC_ASSERT(sizeof(state.uts.ts64.REG_FIELD(rip)) == sizeof(void*)); ++ return reinterpret_cast<uint8_t**>(&state.uts.ts64.REG_FIELD(rip)); ++ ++ default: ++ MOZ_CRASH("Unknown thread state flavor"); ++ } + # else +- JS_STATIC_ASSERT(sizeof(state.uts.ts32.__eip) == sizeof(void*)); +- return reinterpret_cast<uint8_t**>(&state.uts.ts32.__eip); ++# error Instruction address register unknown for this platform + # endif + } + +@@ -637,10 +682,11 @@ HandleMachException(JSRuntime *rt, const + mach_port_t rtThread = request.body.thread.name; + + // Read out the JSRuntime thread's register state. +- x86_thread_state_t state; +- unsigned int count = x86_THREAD_STATE_COUNT; ++ moz_platform_thread_state_t state; ++ thread_state_flavor_t flavor = MOZ_PLATFORM_THREAD_STATE_FLAVOR; ++ mach_msg_type_number_t count = MOZ_PLATFORM_THREAD_STATE_COUNT; + kern_return_t kret; +- kret = thread_get_state(rtThread, x86_THREAD_STATE, (thread_state_t)&state, &count); ++ kret = thread_get_state(rtThread, flavor, (thread_state_t)&state, &count); + if (kret != KERN_SUCCESS) + return false; + +@@ -682,7 +728,7 @@ HandleMachException(JSRuntime *rt, const + module.unprotectCode(rt); + + // Update the thread state with the new pc. +- kret = thread_set_state(rtThread, x86_THREAD_STATE, (thread_state_t)&state, x86_THREAD_STATE_COUNT); ++ kret = thread_set_state(rtThread, flavor, (thread_state_t)&state, count); + return kret == KERN_SUCCESS; + } + diff --git a/www/firefox/patches/patch-js_xpconnect_src_xpcprivate.h b/www/firefox/patches/patch-js_xpconnect_src_xpcprivate.h index 6a91f3e480c..f2fd33d225c 100644 --- a/www/firefox/patches/patch-js_xpconnect_src_xpcprivate.h +++ b/www/firefox/patches/patch-js_xpconnect_src_xpcprivate.h @@ -1,15 +1,16 @@ -$NetBSD: patch-js_xpconnect_src_xpcprivate.h,v 1.1 2014/11/17 19:08:06 joerg Exp $ +$NetBSD: patch-js_xpconnect_src_xpcprivate.h,v 1.2 2015/01/30 07:32:24 pho Exp $ ---- js/xpconnect/src/xpcprivate.h.orig 2014-11-17 14:07:16.000000000 +0000 +From commit log 1.1: + Instantiate WeakMapPtr explicitly to get the right visibility with + clang. + +--- js/xpconnect/src/xpcprivate.h.orig 2015-01-23 06:00:06.000000000 +0000 +++ js/xpconnect/src/xpcprivate.h -@@ -1006,6 +1006,11 @@ static inline bool IS_PROTO_CLASS(const +@@ -1016,6 +1016,8 @@ static inline bool IS_PROTO_CLASS(const /***************************************************************************/ // XPCWrappedNativeScope is one-to-one with a JS global object. -+#if __cplusplus >= 201103 -+extern -+#endif -+template class JS_PUBLIC_API(JS::WeakMapPtr)<JSObject*, JSObject*>; ++extern template class JS_PUBLIC_API(JS::WeakMapPtr)<JSObject*, JSObject*>; + class nsIAddonInterposition; class nsXPCComponentsBase; diff --git a/www/firefox/patches/patch-memory_mozalloc_VolatileBufferOSX.cpp b/www/firefox/patches/patch-memory_mozalloc_VolatileBufferOSX.cpp new file mode 100644 index 00000000000..9f8c940a74f --- /dev/null +++ b/www/firefox/patches/patch-memory_mozalloc_VolatileBufferOSX.cpp @@ -0,0 +1,22 @@ +$NetBSD: patch-memory_mozalloc_VolatileBufferOSX.cpp,v 1.1 2015/01/30 07:32:24 pho Exp $ + +Try to fallback to valloc(3) if posix_memalign(3) is not avialble. It +has been added since MacOS 10.6. + +--- memory/mozalloc/VolatileBufferOSX.cpp.orig 2015-01-28 23:40:15.000000000 +0000 ++++ memory/mozalloc/VolatileBufferOSX.cpp +@@ -46,7 +46,14 @@ VolatileBuffer::Init(size_t aSize, size_ + } + + heap_alloc: ++#if defined(HAVE_POSIX_MEMALIGN) + (void)moz_posix_memalign(&mBuf, aAlignment, aSize); ++#else ++ MOZ_RELEASE_ASSERT( ++ !(aAlignment > (size_t)getpagesize()), ++ "Cannot fallback to valloc(3): alignment is larger than the page size"); ++ mBuf = valloc(aSize); ++#endif + mHeap = true; + return !!mBuf; + } diff --git a/www/firefox/patches/patch-toolkit_library_moz.build b/www/firefox/patches/patch-toolkit_library_moz.build index d45fb818a77..e11ac6f4fb8 100644 --- a/www/firefox/patches/patch-toolkit_library_moz.build +++ b/www/firefox/patches/patch-toolkit_library_moz.build @@ -1,8 +1,14 @@ -$NetBSD: patch-toolkit_library_moz.build,v 1.1 2014/12/01 18:11:14 ryoon Exp $ +$NetBSD: patch-toolkit_library_moz.build,v 1.2 2015/01/30 07:32:24 pho Exp $ ---- toolkit/library/moz.build.orig 2014-11-21 03:37:51.000000000 +0000 +MOZ_GSTREAMER: + GSTREAMER_LIBS are linked to libxul on Darwin, while they are + dlopen(3)'ed at runtime on other platforms. The problem is that the + toolkit being cocoa isn't relevant at all. It's Darwin that needs + the special handling, not Cocoa. + +--- toolkit/library/moz.build.orig 2015-01-23 06:00:07.000000000 +0000 +++ toolkit/library/moz.build -@@ -167,6 +167,7 @@ if CONFIG['OS_ARCH'] == 'Linux' and CONF +@@ -219,6 +219,7 @@ if CONFIG['OS_ARCH'] == 'Linux' and CONF ] OS_LIBS += CONFIG['MOZ_CAIRO_OSLIBS'] @@ -10,7 +16,7 @@ $NetBSD: patch-toolkit_library_moz.build,v 1.1 2014/12/01 18:11:14 ryoon Exp $ OS_LIBS += CONFIG['MOZ_WEBRTC_X11_LIBS'] if CONFIG['MOZ_NATIVE_JPEG']: -@@ -178,6 +179,27 @@ if CONFIG['MOZ_NATIVE_PNG']: +@@ -230,6 +231,27 @@ if CONFIG['MOZ_NATIVE_PNG']: if CONFIG['MOZ_NATIVE_HUNSPELL']: OS_LIBS += CONFIG['MOZ_HUNSPELL_LIBS'] @@ -38,7 +44,7 @@ $NetBSD: patch-toolkit_library_moz.build,v 1.1 2014/12/01 18:11:14 ryoon Exp $ if CONFIG['MOZ_NATIVE_LIBEVENT']: OS_LIBS += CONFIG['MOZ_LIBEVENT_LIBS'] -@@ -187,6 +209,15 @@ if CONFIG['MOZ_NATIVE_LIBVPX']: +@@ -239,6 +261,15 @@ if CONFIG['MOZ_NATIVE_LIBVPX']: if not CONFIG['MOZ_TREE_PIXMAN']: OS_LIBS += CONFIG['MOZ_PIXMAN_LIBS'] @@ -54,3 +60,12 @@ $NetBSD: patch-toolkit_library_moz.build,v 1.1 2014/12/01 18:11:14 ryoon Exp $ if CONFIG['MOZ_ALSA']: OS_LIBS += CONFIG['MOZ_ALSA_LIBS'] +@@ -369,7 +400,7 @@ if CONFIG['OS_ARCH'] == 'WINNT': + if CONFIG['MOZ_ENABLE_QT']: + OS_LIBS += CONFIG['XEXT_LIBS'] + +-if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa' and CONFIG['MOZ_GSTREAMER']: ++if CONFIG['OS_ARCH'] == 'Darwin' and CONFIG['MOZ_GSTREAMER']: + OS_LIBS += CONFIG['GSTREAMER_LIBS'] + + if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows': diff --git a/www/firefox/patches/patch-toolkit_xre_nsAppRunner.cpp b/www/firefox/patches/patch-toolkit_xre_nsAppRunner.cpp new file mode 100644 index 00000000000..ef61513edd4 --- /dev/null +++ b/www/firefox/patches/patch-toolkit_xre_nsAppRunner.cpp @@ -0,0 +1,46 @@ +$NetBSD: patch-toolkit_xre_nsAppRunner.cpp,v 1.5 2015/01/30 07:32:24 pho Exp $ + +MacOS X < 10.6 had an undocumented behavior concerning execve(2) +inside a threaded process. If a process tried to call execve(2) and +had more than one active thread, the kernel returned ENOTSUP. So we +have to either fork(2) or vfork(2) before calling execve(2) to make +sure the caller is single-threaded as otherwise the application fails +to restart itself. + +__mac_execve() in XNU 1228 (Darwin 9, MacOS X 10.5) had the +restriction: +http://www.opensource.apple.com/source/xnu/xnu-1228.15.4/bsd/kern/kern_exec.c + +In XNU 1456 (Darwin 10, MacOS X 10.6) the multi-threaded check +disappeared: +http://www.opensource.apple.com/source/xnu/xnu-1456.1.26/bsd/kern/kern_exec.c + +--- toolkit/xre/nsAppRunner.cpp.orig 2015-01-30 04:06:22.000000000 +0000 ++++ toolkit/xre/nsAppRunner.cpp +@@ -1768,6 +1768,18 @@ static nsresult LaunchChild(nsINativeApp + if (NS_FAILED(rv)) + return rv; + ++#if defined(XP_DARWIN) ++ pid_t pid = vfork(); ++ if (pid == 0) { // child ++ if (execv(exePath.get(), gRestartArgv) == -1) { ++ _exit(1); ++ } ++ } ++ else if (pid == -1) { ++ return NS_ERROR_FAILURE; ++ } ++#else ++ + #if defined(XP_UNIX) + if (execv(exePath.get(), gRestartArgv) == -1) + return NS_ERROR_FAILURE; +@@ -1781,6 +1793,7 @@ static nsresult LaunchChild(nsINativeApp + if (failed || exitCode) + return NS_ERROR_FAILURE; + #endif // XP_UNIX ++#endif // XP_DARWIN + #endif // WP_WIN + #endif // WP_MACOSX + #endif // MOZ_WIDGET_ANDROID diff --git a/www/firefox/patches/patch-xpcom_base_nsStackWalk.cpp b/www/firefox/patches/patch-xpcom_base_nsStackWalk.cpp index 92835e158b7..01c6213510a 100644 --- a/www/firefox/patches/patch-xpcom_base_nsStackWalk.cpp +++ b/www/firefox/patches/patch-xpcom_base_nsStackWalk.cpp @@ -1,10 +1,44 @@ -$NetBSD: patch-xpcom_base_nsStackWalk.cpp,v 1.9 2015/01/16 22:42:09 ryoon Exp $ +$NetBSD: patch-xpcom_base_nsStackWalk.cpp,v 1.10 2015/01/30 07:32:24 pho Exp $ * Replace XP_MACOSX with XP_DARWIN as the former is not defined when the toolkit is not cocoa. ---- xpcom/base/nsStackWalk.cpp.orig 2015-01-09 04:38:29.000000000 +0000 +--- xpcom/base/nsStackWalk.cpp.orig 2015-01-23 06:00:09.000000000 +0000 +++ xpcom/base/nsStackWalk.cpp +@@ -34,12 +34,12 @@ static CriticalAddress gCriticalAddress; + #define _GNU_SOURCE + #endif + +-#if defined(HAVE_DLOPEN) || defined(XP_MACOSX) ++#if defined(HAVE_DLOPEN) || defined(XP_DARWIN) + #include <dlfcn.h> + #endif + +-#define NSSTACKWALK_SUPPORTS_MACOSX \ +- (defined(XP_MACOSX) && \ ++#define NSSTACKWALK_SUPPORTS_DARWIN \ ++ (defined(XP_DARWIN) && \ + (defined(__i386) || defined(__ppc__) || defined(HAVE__UNWIND_BACKTRACE))) + + #define NSSTACKWALK_SUPPORTS_LINUX \ +@@ -47,7 +47,7 @@ static CriticalAddress gCriticalAddress; + ((defined(__GNUC__) && (defined(__i386) || defined(PPC))) || \ + defined(HAVE__UNWIND_BACKTRACE))) + +-#if NSSTACKWALK_SUPPORTS_MACOSX ++#if NSSTACKWALK_SUPPORTS_DARWIN + #include <pthread.h> + #include <CoreServices/CoreServices.h> + +@@ -832,7 +832,7 @@ NS_DescribeCodeAddress(void* aPC, nsCode + } + + // i386 or PPC Linux stackwalking code +-#elif HAVE_DLADDR && (HAVE__UNWIND_BACKTRACE || NSSTACKWALK_SUPPORTS_LINUX || NSSTACKWALK_SUPPORTS_MACOSX) ++#elif HAVE_DLADDR && (HAVE__UNWIND_BACKTRACE || NSSTACKWALK_SUPPORTS_LINUX || NSSTACKWALK_SUPPORTS_DARWIN) + + #include <stdlib.h> + #include <string.h> @@ -903,7 +903,7 @@ FramePointerStackWalk(NS_WalkStackCallba (long(next) & 3)) { break; diff --git a/www/firefox/patches/patch-xpcom_build_PoisonIOInterposer.h b/www/firefox/patches/patch-xpcom_build_PoisonIOInterposer.h new file mode 100644 index 00000000000..6ff5f89806a --- /dev/null +++ b/www/firefox/patches/patch-xpcom_build_PoisonIOInterposer.h @@ -0,0 +1,58 @@ +$NetBSD: patch-xpcom_build_PoisonIOInterposer.h,v 1.4 2015/01/30 07:32:24 pho Exp $ + +Replace XP_MACOSX with XP_DARWIN as the former is not defined when the +toolkit is not cocoa. + +--- xpcom/build/PoisonIOInterposer.h.orig 2015-01-28 23:04:52.000000000 +0000 ++++ xpcom/build/PoisonIOInterposer.h +@@ -26,7 +26,7 @@ void MozillaUnRegisterDebugFILE(FILE* aF + + MOZ_END_EXTERN_C + +-#if defined(XP_WIN) || defined(XP_MACOSX) ++#if defined(XP_WIN) || defined(XP_DARWIN) + + #ifdef __cplusplus + namespace mozilla { +@@ -44,7 +44,7 @@ bool IsDebugFile(intptr_t aFileID); + */ + void InitPoisonIOInterposer(); + +-#ifdef XP_MACOSX ++#ifdef XP_DARWIN + /** + * Check that writes are dirty before reporting I/O (Mac OS X only) + * This is necessary for late-write checks on Mac OS X, but reading the buffer +@@ -52,7 +52,7 @@ void InitPoisonIOInterposer(); + * to do this for everything else that uses + */ + void OnlyReportDirtyWrites(); +-#endif /* XP_MACOSX */ ++#endif /* XP_DARWIN */ + + /** + * Clear IO poisoning, this is only safe to do on the main-thread when no other +@@ -63,19 +63,19 @@ void ClearPoisonIOInterposer(); + } // namespace mozilla + #endif /* __cplusplus */ + +-#else /* XP_WIN || XP_MACOSX */ ++#else /* XP_WIN || XP_DARWIN */ + + #ifdef __cplusplus + namespace mozilla { + inline bool IsDebugFile(intptr_t aFileID) { return true; } + inline void InitPoisonIOInterposer() {} + inline void ClearPoisonIOInterposer() {} +-#ifdef XP_MACOSX ++#ifdef XP_DARWIN + inline void OnlyReportDirtyWrites() {} +-#endif /* XP_MACOSX */ ++#endif /* XP_DARWIN */ + } // namespace mozilla + #endif /* __cplusplus */ + +-#endif /* XP_WIN || XP_MACOSX */ ++#endif /* XP_WIN || XP_DARWIN */ + + #endif // mozilla_PoisonIOInterposer_h diff --git a/www/firefox/patches/patch-xpcom_glue_standalone_nsXPCOMGlue.cpp b/www/firefox/patches/patch-xpcom_glue_standalone_nsXPCOMGlue.cpp new file mode 100644 index 00000000000..17ffc7ebe30 --- /dev/null +++ b/www/firefox/patches/patch-xpcom_glue_standalone_nsXPCOMGlue.cpp @@ -0,0 +1,17 @@ +$NetBSD: patch-xpcom_glue_standalone_nsXPCOMGlue.cpp,v 1.3 2015/01/30 07:32:24 pho Exp $ + +Fix inconsistent use of XP_DARWIN and XP_MACOSX: LEADING_UNDERSCORE +should be empty when we are going to load XPCOM using dlopen(3), not +NSAddImage(). + +--- xpcom/glue/standalone/nsXPCOMGlue.cpp.orig 2015-01-30 05:17:58.000000000 +0000 ++++ xpcom/glue/standalone/nsXPCOMGlue.cpp +@@ -30,7 +30,7 @@ static bool do_preload = false; + #endif + + #if defined(SUNOS4) || defined(NEXTSTEP) || \ +- defined(XP_DARWIN) || \ ++ defined(XP_MACOSX) || \ + (defined(OPENBSD) || defined(NETBSD)) && !defined(__ELF__) + #define LEADING_UNDERSCORE "_" + #else |