Index: head/www/firefox/Makefile =================================================================== --- head/www/firefox/Makefile (revision 533208) +++ head/www/firefox/Makefile (revision 533209) @@ -1,61 +1,60 @@ # Created by: Alan Eldridge # $FreeBSD$ PORTNAME= firefox -DISTVERSION= 75.0 -PORTREVISION= 4 +DISTVERSION= 76.0 PORTEPOCH= 1 CATEGORIES= www MASTER_SITES= MOZILLA/${PORTNAME}/releases/${DISTVERSION}/source \ - MOZILLA/${PORTNAME}/candidates/${DISTVERSION}-candidates/build3/source + MOZILLA/${PORTNAME}/candidates/${DISTVERSION}-candidates/build1/source DISTFILES= ${DISTNAME}.source${EXTRACT_SUFX} MAINTAINER= gecko@FreeBSD.org COMMENT= Web browser based on the browser portion of Mozilla BUILD_DEPENDS= nspr>=4.25:devel/nspr \ - nss>=3.51:security/nss \ + nss>=3.51.1:security/nss \ icu>=64.1,1:devel/icu \ libevent>=2.1.8:devel/libevent \ harfbuzz>=2.6.4:print/harfbuzz \ - graphite2>=1.3.13:graphics/graphite2 \ + graphite2>=1.3.14:graphics/graphite2 \ png>=1.6.35:graphics/png \ libvpx>=1.8.2:multimedia/libvpx \ py${PYTHON3_DEFAULT:S/.//}-sqlite3>0:databases/py-sqlite3@py${PYTHON3_DEFAULT:S/.//} \ v4l_compat>0:multimedia/v4l_compat \ autoconf-2.13:devel/autoconf213 \ nasm:devel/nasm \ yasm:devel/yasm \ zip:archivers/zip USE_GECKO= gecko CONFLICTS_INSTALL= firefox-esr USE_MOZILLA= -sqlite USES= tar:xz FIREFOX_ICON= ${MOZILLA}.png FIREFOX_ICON_SRC= ${PREFIX}/lib/${MOZILLA}/browser/chrome/icons/default/default48.png FIREFOX_DESKTOP= ${MOZSRC}/taskcluster/docker/${MOZILLA}-snap/${MOZILLA}.desktop MOZ_OPTIONS= --enable-application=browser \ --enable-official-branding .include "${.CURDIR}/../../www/firefox/Makefile.options" post-patch: @${REINPLACE_CMD} -e 's/%u/%U/' -e '/X-MultipleArgs/d' \ -e '/^Icon/s/=.*/=${FIREFOX_ICON:R}/' \ ${FIREFOX_DESKTOP} @${REINPLACE_CMD} -e 's|%%LOCALBASE%%|${LOCALBASE}|g' \ ${WRKSRC}/browser/app/nsBrowserApp.cpp pre-configure: (cd ${WRKSRC} && ${LOCALBASE}/bin/autoconf-2.13) (cd ${WRKSRC}/js/src/ && ${LOCALBASE}/bin/autoconf-2.13) post-install: ${INSTALL_DATA} ${FIREFOX_DESKTOP} ${STAGEDIR}${PREFIX}/share/applications/ ${MKDIR} ${STAGEDIR}${PREFIX}/share/pixmaps ${LN} -sf ${FIREFOX_ICON_SRC} ${STAGEDIR}${PREFIX}/share/pixmaps/${FIREFOX_ICON} .include Index: head/www/firefox/distinfo =================================================================== --- head/www/firefox/distinfo (revision 533208) +++ head/www/firefox/distinfo (revision 533209) @@ -1,3 +1,3 @@ -TIMESTAMP = 1585942574 -SHA256 (firefox-75.0.source.tar.xz) = bbb1054d8f2717c634480556d3753a8483986af7360e023bb6232df80b746b0f -SIZE (firefox-75.0.source.tar.xz) = 324614064 +TIMESTAMP = 1588013849 +SHA256 (firefox-76.0.source.tar.xz) = 59bc368d04cb1c572bf081e5dd7f47f6b12d2b7d7da741146fa9369b29e3a62f +SIZE (firefox-76.0.source.tar.xz) = 325089512 Index: head/www/firefox/files/patch-bug1622551 =================================================================== --- head/www/firefox/files/patch-bug1622551 (revision 533208) +++ head/www/firefox/files/patch-bug1622551 (nonexistent) @@ -1,28 +0,0 @@ -Silence Service.profiler errors on Tier3 after bug 1613390 - -diff --git browser/components/BrowserGlue.jsm browser/components/BrowserGlue.jsm -index 8f86bf0584a99..2ce53c6921d15 100644 ---- browser/components/BrowserGlue.jsm -+++ browser/components/BrowserGlue.jsm -@@ -2300,7 +2300,9 @@ BrowserGlue.prototype = { - ChromeUtils.idleDispatch( - () => { - if (!Services.startup.shuttingDown) { -- Services.profiler.AddMarker("startupIdleTask"); -+ if (Services.profiler) { -+ Services.profiler.AddMarker("startupIdleTask"); -+ } - try { - task.task(); - } catch (ex) { -@@ -2371,7 +2373,9 @@ BrowserGlue.prototype = { - for (let task of idleTasks) { - ChromeUtils.idleDispatch(() => { - if (!Services.startup.shuttingDown) { -- Services.profiler.AddMarker("startupLateIdleTask"); -+ if (Services.profiler) { -+ Services.profiler.AddMarker("startupLateIdleTask"); -+ } - try { - task(); - } catch (ex) { Property changes on: head/www/firefox/files/patch-bug1622551 ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/www/firefox/files/patch-bug1612377 =================================================================== --- head/www/firefox/files/patch-bug1612377 (revision 533208) +++ head/www/firefox/files/patch-bug1612377 (nonexistent) @@ -1,210 +0,0 @@ -commit f30e2a9e31fa -Author: Martin Stransky -Date: Thu Mar 26 12:12:40 2020 +0000 - - Bug 1612377 [Wayland] Remove moz_container_set_accelerated(), r=jhorak - - Differential Revision: https://phabricator.services.mozilla.com/D68351 - - --HG-- - extra : moz-landing-system : lando ---- - widget/gtk/mozcontainer.cpp | 7 +------ - widget/gtk/mozcontainer.h | 2 -- - widget/gtk/nsWindow.cpp | 1 - - 3 files changed, 1 insertion(+), 9 deletions(-) - -diff --git widget/gtk/mozcontainer.cpp widget/gtk/mozcontainer.cpp -index 0c3833bc8ce3e..d438b67f9baea 100644 ---- widget/gtk/mozcontainer.cpp -+++ widget/gtk/mozcontainer.cpp -@@ -230,7 +230,6 @@ void moz_container_init(MozContainer* container) { - container->subsurface_dy = 0; - container->surface_position_needs_update = 0; - container->initial_draw_cbs.clear(); -- container->is_accelerated = false; - #endif - - LOG(("%s [%p]\n", __FUNCTION__, (void*)container)); -@@ -694,14 +693,10 @@ void moz_container_update_opaque_region(MozContainer* container, - // When GL compositor / WebRender is used, - // moz_container_get_wl_egl_window() is called only once when window - // is created or resized so update opaque region now. -- if (container->is_accelerated) { -+ if (moz_container_has_wl_egl_window(container)) { - moz_container_set_opaque_region(container); - } - } -- --void moz_container_set_accelerated(MozContainer* container) { -- container->is_accelerated = true; --} - #endif - - void moz_container_force_default_visual(MozContainer* container) { -diff --git widget/gtk/mozcontainer.h widget/gtk/mozcontainer.h -index 6befb992515dc..885dce5c27a1a 100644 ---- widget/gtk/mozcontainer.h -+++ widget/gtk/mozcontainer.h -@@ -87,7 +87,6 @@ struct _MozContainer { - gboolean surface_needs_clear; - gboolean ready_to_draw; - std::vector> initial_draw_cbs; -- gboolean is_accelerated; - #endif - gboolean force_default_visual; - }; -@@ -121,7 +120,6 @@ wl_surface* moz_gtk_widget_get_wl_surface(GtkWidget* aWidget); - void moz_container_update_opaque_region(MozContainer* container, - bool aSubtractCorners, - bool aFullScreen); --void moz_container_set_accelerated(MozContainer* container); - #endif - - #endif /* __MOZ_CONTAINER_H__ */ -diff --git widget/gtk/nsWindow.cpp widget/gtk/nsWindow.cpp -index 728c1ed7d3226..dbcd8b8ae4941 100644 ---- widget/gtk/nsWindow.cpp -+++ widget/gtk/nsWindow.cpp -@@ -4138,7 +4138,6 @@ nsresult nsWindow::Create(nsIWidget* aParent, nsNativeWidget aNativeParent, - self->mNeedsCompositorResume = true; - self->MaybeResumeCompositor(); - }); -- moz_container_set_accelerated(mContainer); - } - #endif - - -commit 4d1730dd79f9 -Author: Martin Stransky -Date: Thu Mar 26 12:12:48 2020 +0000 - - Bug 1612377 [Wayland] Update opaque region and widget scale factor when screen DPI changes, r=jhorak - - - Integrate scale factor setup to moz_container_get_wl_surface() and don't call it explicitly. - - No need to set it explicitly at nsWindow::GetWaylandSurface(). - - Update client offset when scale changes in CSD mode by UpdateClientOffsetFromCSDWindow(). - - Update scale factor/opaque region on EGL immediately. - - Differential Revision: https://phabricator.services.mozilla.com/D68352 - - --HG-- - extra : moz-landing-system : lando ---- - widget/gtk/mozcontainer.cpp | 19 ++++++++++++++++++- - widget/gtk/mozcontainer.h | 3 +-- - widget/gtk/nsWindow.cpp | 29 ++++++++++++++++++++++------- - 3 files changed, 41 insertions(+), 10 deletions(-) - -diff --git widget/gtk/mozcontainer.cpp widget/gtk/mozcontainer.cpp -index d438b67f9baea..eff25264d5678 100644 ---- widget/gtk/mozcontainer.cpp -+++ widget/gtk/mozcontainer.cpp -@@ -595,6 +595,22 @@ static void moz_container_set_opaque_region(MozContainer* container) { - container->opaque_region_needs_update = false; - } - -+static int moz_gtk_widget_get_scale_factor(MozContainer* container) { -+ static auto sGtkWidgetGetScaleFactor = -+ (gint(*)(GtkWidget*))dlsym(RTLD_DEFAULT, "gtk_widget_get_scale_factor"); -+ return sGtkWidgetGetScaleFactor -+ ? sGtkWidgetGetScaleFactor(GTK_WIDGET(container)) -+ : 1; -+} -+ -+void moz_container_set_scale_factor(MozContainer* container) { -+ if (!container->surface) { -+ return; -+ } -+ wl_surface_set_buffer_scale(container->surface, -+ moz_gtk_widget_get_scale_factor(container)); -+} -+ - struct wl_surface* moz_container_get_wl_surface(MozContainer* container) { - LOGWAYLAND(("%s [%p] surface %p ready_to_draw %d\n", __FUNCTION__, - (void*)container, (void*)container->surface, -@@ -645,6 +661,8 @@ struct wl_surface* moz_container_get_wl_surface(MozContainer* container) { - } - - moz_container_set_opaque_region(container); -+ moz_container_set_scale_factor(container); -+ - return container->surface; - } - -@@ -659,7 +677,6 @@ struct wl_egl_window* moz_container_get_wl_egl_window(MozContainer* container, - if (!surface) { - return nullptr; - } -- wl_surface_set_buffer_scale(surface, scale); - if (!container->eglwindow) { - GdkWindow* window = gtk_widget_get_window(GTK_WIDGET(container)); - container->eglwindow = -diff --git widget/gtk/mozcontainer.h widget/gtk/mozcontainer.h -index 885dce5c27a1a..8d40560cf634b 100644 ---- widget/gtk/mozcontainer.h -+++ widget/gtk/mozcontainer.h -@@ -112,8 +112,7 @@ void moz_container_move_resize(MozContainer* container, int dx, int dy, - int width, int height); - void moz_container_egl_window_set_size(MozContainer* container, int width, - int height); --void moz_container_scale_changed(MozContainer* container, -- GtkAllocation* aAllocation); -+void moz_container_set_scale_factor(MozContainer* container); - void moz_container_add_initial_draw_callback( - MozContainer* container, const std::function& initial_draw_cb); - wl_surface* moz_gtk_widget_get_wl_surface(GtkWidget* aWidget); -diff --git widget/gtk/nsWindow.cpp widget/gtk/nsWindow.cpp -index dbcd8b8ae4941..be9c29a02ba32 100644 ---- widget/gtk/nsWindow.cpp -+++ widget/gtk/nsWindow.cpp -@@ -2713,7 +2713,7 @@ gboolean nsWindow::OnConfigureEvent(GtkWidget* aWidget, - OnSizeAllocate(&allocation); - } - -- // Client offset are upated by _NET_FRAME_EXTENTS on X11 when system titlebar -+ // Client offset are updated by _NET_FRAME_EXTENTS on X11 when system titlebar - // is enabled. In ither cases (Wayland or system titlebar is off on X11) - // we don't get _NET_FRAME_EXTENTS X11 property notification so we derive - // it from mContainer position. -@@ -3689,6 +3689,26 @@ void nsWindow::OnScaleChanged(GtkAllocation* aAllocation) { - // configure_event is already fired before scale-factor signal, - // but size-allocate isn't fired by changing scale - OnSizeAllocate(aAllocation); -+ -+ // Client offset are updated by _NET_FRAME_EXTENTS on X11 when system titlebar -+ // is enabled. In ither cases (Wayland or system titlebar is off on X11) -+ // we don't get _NET_FRAME_EXTENTS X11 property notification so we derive -+ // it from mContainer position. -+ if (mCSDSupportLevel == CSD_SUPPORT_CLIENT) { -+ if (!mIsX11Display || (mIsX11Display && mDrawInTitlebar)) { -+ UpdateClientOffsetFromCSDWindow(); -+ } -+ } -+ -+#ifdef MOZ_WAYLAND -+ // We need to update scale and opaque region when scale of egl window -+ // is changed. -+ if (mContainer && moz_container_has_wl_egl_window(mContainer)) { -+ moz_container_set_scale_factor(mContainer); -+ LayoutDeviceIntRegion tmpRegion; -+ UpdateOpaqueRegion(tmpRegion); -+ } -+#endif - } - - void nsWindow::DispatchDragEvent(EventMessage aMsg, -@@ -7618,12 +7638,7 @@ void nsWindow::GetCompositorWidgetInitData( - #ifdef MOZ_WAYLAND - wl_surface* nsWindow::GetWaylandSurface() { - if (mContainer) { -- struct wl_surface* surface = -- moz_container_get_wl_surface(MOZ_CONTAINER(mContainer)); -- if (surface != NULL) { -- wl_surface_set_buffer_scale(surface, GdkScaleFactor()); -- } -- return surface; -+ return moz_container_get_wl_surface(MOZ_CONTAINER(mContainer)); - } - - NS_WARNING( Property changes on: head/www/firefox/files/patch-bug1612377 ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/www/firefox/files/patch-bug1619258 =================================================================== --- head/www/firefox/files/patch-bug1619258 (revision 533208) +++ head/www/firefox/files/patch-bug1619258 (nonexistent) @@ -1,101 +0,0 @@ -commit 7f9b73f61241 -Author: Martin Stransky -Date: Wed Mar 18 07:01:27 2020 +0000 - - Bug 1619258 [Wayland] Enable VA-API for all formats, r=jya - - Differential Revision: https://phabricator.services.mozilla.com/D65536 - - --HG-- - extra : moz-landing-system : lando ---- - dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp | 30 ++++++++++++++--------- - dom/media/platforms/ffmpeg/FFmpegVideoDecoder.h | 1 + - 2 files changed, 20 insertions(+), 11 deletions(-) - -diff --git dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp -index 9a71a681eaef5..e0f7504574d6c 100644 ---- dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp -+++ dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp -@@ -42,6 +42,9 @@ typedef int VAStatus; - # define VA_STATUS_SUCCESS 0x00000000 - #endif - -+// Use some extra HW frames for potential rendering lags. -+#define EXTRA_HW_FRAMES 6 -+ - typedef mozilla::layers::Image Image; - typedef mozilla::layers::PlanarYCbCrImage PlanarYCbCrImage; - -@@ -135,10 +138,6 @@ VAAPIFrameHolder::~VAAPIFrameHolder() { - } - - AVCodec* FFmpegVideoDecoder::FindVAAPICodec() { -- if (mCodecID != AV_CODEC_ID_H264) { -- return nullptr; -- } -- - AVCodec* decoder = mLib->avcodec_find_decoder(mCodecID); - for (int i = 0;; i++) { - const AVCodecHWConfig* config = mLib->avcodec_get_hw_config(decoder, i); -@@ -172,7 +171,6 @@ bool FFmpegVideoDecoder::CreateVAAPIDeviceContext() { - - MediaResult FFmpegVideoDecoder::InitVAAPIDecoder() { - FFMPEG_LOG("Initialising VA-API FFmpeg decoder"); -- MOZ_ASSERT(mCodecID == AV_CODEC_ID_H264); - - if (!mLib->IsVAAPIAvailable()) { - FFMPEG_LOG("libva library is missing"); -@@ -282,11 +280,9 @@ RefPtr FFmpegVideoDecoder::Init() { - MediaResult rv; - - #ifdef MOZ_WAYLAND_USE_VAAPI -- if (mCodecID == AV_CODEC_ID_H264) { -- rv = InitVAAPIDecoder(); -- if (NS_SUCCEEDED(rv)) { -- return InitPromise::CreateAndResolve(TrackInfo::kVideoTrack, __func__); -- } -+ rv = InitVAAPIDecoder(); -+ if (NS_SUCCEEDED(rv)) { -+ return InitPromise::CreateAndResolve(TrackInfo::kVideoTrack, __func__); - } - #endif - -@@ -338,7 +334,12 @@ void FFmpegVideoDecoder::InitVAAPICodecContext() { - mCodecContext->height = mInfo.mImage.height; - mCodecContext->thread_count = 1; - mCodecContext->get_format = ChooseVAAPIPixelFormat; -- mCodecContext->extra_hw_frames = H264::ComputeMaxRefFrames(mInfo.mExtraData); -+ if (mCodecID == AV_CODEC_ID_H264) { -+ mCodecContext->extra_hw_frames = -+ H264::ComputeMaxRefFrames(mInfo.mExtraData); -+ } else { -+ mCodecContext->extra_hw_frames = EXTRA_HW_FRAMES; -+ } - } - #endif - -@@ -697,4 +698,11 @@ void FFmpegVideoDecoder::ProcessShutdown() { - FFmpegDataDecoder::ProcessShutdown(); - } - -+#ifdef MOZ_WAYLAND_USE_VAAPI -+bool FFmpegVideoDecoder::IsHardwareAccelerated( -+ nsACString& aFailureReason) const { -+ return !!mVAAPIDeviceContext; -+} -+#endif -+ - } // namespace mozilla -diff --git dom/media/platforms/ffmpeg/FFmpegVideoDecoder.h dom/media/platforms/ffmpeg/FFmpegVideoDecoder.h -index 6158f7bc2f6dd..670cb6203dde0 100644 ---- dom/media/platforms/ffmpeg/FFmpegVideoDecoder.h -+++ dom/media/platforms/ffmpeg/FFmpegVideoDecoder.h -@@ -92,6 +92,7 @@ class FFmpegVideoDecoder - bool CreateVAAPIDeviceContext(); - void InitVAAPICodecContext(); - AVCodec* FindVAAPICodec(); -+ bool IsHardwareAccelerated(nsACString& aFailureReason) const override; - - MediaResult CreateImageVAAPI(int64_t aOffset, int64_t aPts, int64_t aDuration, - MediaDataDecoder::DecodedData& aResults); Property changes on: head/www/firefox/files/patch-bug1619258 ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/www/firefox/files/patch-bug1288587 =================================================================== --- head/www/firefox/files/patch-bug1288587 (revision 533208) +++ head/www/firefox/files/patch-bug1288587 (revision 533209) @@ -1,70 +1,70 @@ diff --git a/build/moz.configure/init.configure b/build/moz.configure/init.configure index 855214a..1e91d51 100644 --- build/moz.configure/init.configure +++ build/moz.configure/init.configure @@ -252,6 +252,7 @@ option(env='PYTHON', nargs=1, help='Python 2.7 interpr @imports(_from='mozbuild.pythonutil', _import='find_python2_executable') @imports(_from='mozbuild.pythonutil', _import='python_executable_version') @imports(_from='six', _import='ensure_text') +@imports(_from='__builtin__', _import='KeyError') def virtualenv_python2(env_python, build_env, mozillabuild, mozconfig, help): if help: return @@ -283,6 +284,12 @@ def virtualenv_python2(env_python, build_env, mozillab python = mozconfig['vars']['added']['PYTHON'] elif 'PYTHON' in mozconfig['vars']['modified']: python = mozconfig['vars']['modified']['PYTHON'][1] + for i in ('env', 'vars'): + for j in ('added', 'modified'): + try: + del mozconfig[i][j]['PYTHON'] + except KeyError: + pass log.debug("python2: executable from configuration: %r" % python) -@@ -358,7 +365,10 @@ def virtualenv_python2(env_python, build_env, mozillab +@@ -365,7 +372,10 @@ def virtualenv_python2(env_python, build_env, mozillab sys.executable, manager.python_path)) log.info('Reexecuting in the virtualenv') if env_python: - del os.environ['PYTHON'] + try: + del os.environ['PYTHON'] + except KeyError: + pass # One would prefer to use os.execl, but that's completely borked on # Windows. sys.exit(subprocess.call([python] + sys.argv)) -@@ -460,6 +470,7 @@ option(env='PYTHON3', nargs=1, help='Python 3 interpre +@@ -468,6 +478,7 @@ option(env='PYTHON3', nargs=1, help='Python 3 interpre @imports(_from='mozbuild.pythonutil', _import='find_python3_executable') @imports(_from='mozbuild.pythonutil', _import='python_executable_version') @imports(_from='six', _import='ensure_text') +@imports(_from='__builtin__', _import='KeyError') def virtualenv_python3(env_python, build_env, mozillabuild, mozconfig, help): if help: return -@@ -495,6 +506,12 @@ def virtualenv_python3(env_python, build_env, mozillab +@@ -503,6 +514,12 @@ def virtualenv_python3(env_python, build_env, mozillab python = mozconfig['vars']['added']['PYTHON3'] elif 'PYTHON3' in mozconfig['vars']['modified']: python = mozconfig['vars']['modified']['PYTHON3'][1] + for i in ('env', 'vars'): + for j in ('added', 'modified'): + try: + del mozconfig[i][j]['PYTHON3'] + except KeyError: + pass log.debug("python3: executable from configuration: %r" % python) -@@ -575,7 +592,10 @@ def virtualenv_python3(env_python, build_env, mozillab +@@ -583,7 +600,10 @@ def virtualenv_python3(env_python, build_env, mozillab sys.executable, manager.python_path)) log.info('Re-executing in the virtualenv') if env_python: - del os.environ['PYTHON3'] + try: + del os.environ['PYTHON3'] + except KeyError: + pass - # One would prefer to use os.execl, but that's completely borked on - # Windows. - sys.exit(subprocess.call([python] + sys.argv)) + # Homebrew on macOS will change Python's sys.executable to a custom + # value which messes with mach's virtualenv handling code. Override + # Homebrew's changes with the correct sys.executable value. Index: head/www/firefox/files/patch-bug1550891 =================================================================== --- head/www/firefox/files/patch-bug1550891 (revision 533208) +++ head/www/firefox/files/patch-bug1550891 (revision 533209) @@ -1,88 +1,89 @@ commit 965eb33c5e86 Author: Greg V Date: Wed Jan 8 15:06:00 2020 -0800 Bug 1550891 - re-add SHM_ANON support in IPC shared memory, freezing via capabilities --- config/system-headers.mozbuild | 1 + ipc/chromium/src/base/shared_memory_posix.cc | 20 +++++++++++++++++--- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git config/system-headers.mozbuild config/system-headers.mozbuild index 88afca1070f86..beff3e2542c9f 100644 --- config/system-headers.mozbuild +++ config/system-headers.mozbuild @@ -816,6 +816,7 @@ system_headers = [ 'sys/bitypes.h', 'sys/byteorder.h', 'syscall.h', + 'sys/capsicum.h', 'sys/cdefs.h', 'sys/cfgodm.h', 'sys/elf.h', diff --git ipc/chromium/src/base/shared_memory_posix.cc ipc/chromium/src/base/shared_memory_posix.cc index 0be9cce0b4bed..89e67483e4c16 100644 --- ipc/chromium/src/base/shared_memory_posix.cc +++ ipc/chromium/src/base/shared_memory_posix.cc @@ -16,6 +16,10 @@ # include #endif +#ifdef __FreeBSD__ +# include +#endif + #include "base/eintr_wrapper.h" #include "base/logging.h" #include "base/string_util.h" @@ -148,7 +152,7 @@ static int SafeShmUnlink(bool freezeable, const char* name) { } } -#elif !defined(ANDROID) +#elif !defined(ANDROID) && !defined(__FreeBSD__) static int SafeShmOpen(bool freezeable, const char* name, int oflag, int mode) { return shm_open(name, oflag, mode); } @@ -160,7 +164,7 @@ static int SafeShmUnlink(bool freezeable, const char* name) { // static bool SharedMemory::AppendPosixShmPrefix(std::string* str, pid_t pid) { -#if defined(ANDROID) +#if defined(ANDROID) || defined(__FreeBSD__) return false; #else *str += '/'; @@ -186,7 +190,7 @@ bool SharedMemory::AppendPosixShmPrefix(std::string* str, pid_t pid) { // enough for this. StringAppendF(str, "org.mozilla.ipc.%d.", static_cast(pid)); return true; -#endif // !ANDROID +#endif // !ANDROID && !__FreeBSD__ } bool SharedMemory::CreateInternal(size_t size, bool freezeable) { @@ -212,6 +216,9 @@ bool SharedMemory::CreateInternal(size_t size, bool freezeable) { return false; } needs_truncate = false; +#elif defined(__FreeBSD__) + // FreeBSD supports anonymous shm_open + fd.reset(shm_open(SHM_ANON, O_RDWR, 0600)); #else // Generic Unix: shm_open + shm_unlink do { -@@ -275,6 +282,13 @@ bool SharedMemory::Freeze() { - CHROMIUM_LOG(WARNING) << "failed to freeze shm: " << strerror(errno); +@@ -277,6 +284,14 @@ bool SharedMemory::ReadOnlyCopy(SharedMemory* ro_out) { return false; } + ro_file = mapped_file_; +#elif defined(__FreeBSD__) + cap_rights_t rights; + cap_rights_init(&rights, CAP_MMAP_R); + if (cap_rights_limit(mapped_file_, &rights) != 0) { + CHROMIUM_LOG(WARNING) << "failed to freeze shm: " << strerror(errno); + return false; + } ++ ro_file = mapped_file_; #else DCHECK(frozen_file_ >= 0); DCHECK(mapped_file_ >= 0); Index: head/www/firefox/files/patch-bug1628567 =================================================================== --- head/www/firefox/files/patch-bug1628567 (nonexistent) +++ head/www/firefox/files/patch-bug1628567 (revision 533209) @@ -0,0 +1,34 @@ +Don't pass --target when CC/CXX contains clang + +--- third_party/rust/cc/src/lib.rs.orig 2020-04-10 00:57:23 UTC ++++ third_party/rust/cc/src/lib.rs +@@ -2344,28 +2344,7 @@ impl Tool { + } + + fn with_features(path: PathBuf, clang_driver: Option<&str>, cuda: bool) -> Self { +- // Try to detect family of the tool from its name, falling back to Gnu. +- let family = if let Some(fname) = path.file_name().and_then(|p| p.to_str()) { +- if fname.contains("clang-cl") { +- ToolFamily::Msvc { clang_cl: true } +- } else if fname.contains("cl") +- && !fname.contains("cloudabi") +- && !fname.contains("uclibc") +- && !fname.contains("clang") +- { +- ToolFamily::Msvc { clang_cl: false } +- } else if fname.contains("clang") { +- match clang_driver { +- Some("cl") => ToolFamily::Msvc { clang_cl: true }, +- _ => ToolFamily::Clang, +- } +- } else { +- ToolFamily::Gnu +- } +- } else { +- ToolFamily::Gnu +- }; +- ++ let family = ToolFamily::Gnu; + Tool { + path: path, + cc_wrapper_path: None, Property changes on: head/www/firefox/files/patch-bug1628567 ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/www/firefox/files/patch-bug847568 =================================================================== --- head/www/firefox/files/patch-bug847568 (revision 533208) +++ head/www/firefox/files/patch-bug847568 (revision 533209) @@ -1,287 +1,287 @@ # Allow building against system-wide graphite2/harfbuzz. diff --git config/system-headers.mozbuild config/system-headers.mozbuild index 7620b4d00623..09d3db5ca8c0 100644 --- config/system-headers.mozbuild +++ config/system-headers.mozbuild @@ -1299,6 +1299,19 @@ if CONFIG['MOZ_ENABLE_LIBPROXY']: 'proxy.h', ] +if CONFIG['MOZ_SYSTEM_GRAPHITE2']: + system_headers += [ + 'graphite2/Font.h', + 'graphite2/Segment.h', + ] + +if CONFIG['MOZ_SYSTEM_HARFBUZZ']: + system_headers += [ + 'harfbuzz/hb-glib.h', + 'harfbuzz/hb-ot.h', + 'harfbuzz/hb.h', + ] + if CONFIG['MOZ_SYSTEM_LIBVPX']: system_headers += [ 'vpx_mem/vpx_mem.h', diff --git dom/base/moz.build dom/base/moz.build index 8e19020315ae..2fcdbb6f7b42 100644 --- dom/base/moz.build +++ dom/base/moz.build @@ -543,6 +543,9 @@ if CONFIG['MOZ_BUILD_APP'] in ['browser', 'mobile/android', 'xulrunner']: if CONFIG['MOZ_X11']: CXXFLAGS += CONFIG['TK_CFLAGS'] +if CONFIG['MOZ_SYSTEM_HARFBUZZ']: + CXXFLAGS += CONFIG['MOZ_HARFBUZZ_CFLAGS'] + GeneratedFile('UseCounterList.h', script='gen-usecounters.py', entry_point='use_counter_list', inputs=['UseCounters.conf']) diff --git gfx/graphite2/geckoextra/moz.build gfx/graphite2/geckoextra/moz.build new file mode 100644 index 0000000000000..24e8d7a03274a --- /dev/null +++ gfx/graphite2/geckoextra/moz.build @@ -0,0 +1,21 @@ +# -*- 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/. + +EXPORTS.graphite2 += [ + 'include/GraphiteExtra.h', + 'include/GraphiteStructsForRLBox.h', +] + +UNIFIED_SOURCES += [ + '../geckoextra/src/GraphiteExtra.cpp', +] + +CXXFLAGS += CONFIG['MOZ_GRAPHITE2_CFLAGS'] + +# Match bundled graphite2 configuration +AllowCompilerWarnings() + +FINAL_LIBRARY = 'gkmedias' diff --git gfx/graphite2/moz-gr-update.sh gfx/graphite2/moz-gr-update.sh index faaab1b17971..04eff5f09882 100644 --- gfx/graphite2/moz-gr-update.sh +++ gfx/graphite2/moz-gr-update.sh @@ -1,6 +1,7 @@ #!/bin/bash # Script used to update the Graphite2 library in the mozilla source tree +# and bump version for --with-system-graphite2 # This script lives in gfx/graphite2, along with the library source, # but must be run from the top level of the mozilla-central tree. @@ -37,12 +38,16 @@ echo "See" $0 "for update procedure." >> gfx/graphite2/README.mozilla #find gfx/graphite2/ -name "*.cpp" -exec perl -p -i -e "s///;s/Windows.h/windows.h/;" {} \; #find gfx/graphite2/ -name "*.h" -exec perl -p -i -e "s///;s/Windows.h/windows.h/;" {} \; +# chase version for --with-system-graphite2 +perl -p -i -e "s/[0-9]+\,[0-9]+\,[0-9]+/$RELEASE/ and tr/./,/ \ + if /GR2_VERSION_REQUIRE/" old-configure.in + # summarize what's been touched echo Updated to $RELEASE. echo Here is what changed in the gfx/graphite2 directory: echo -hg stat gfx/graphite2 +hg stat old-configure.in gfx/graphite2 echo echo If gfx/graphite2/src/files.mk has changed, please make corresponding diff --git gfx/harfbuzz/README-mozilla gfx/harfbuzz/README-mozilla index 22c76a7df020..a01490bd49ee 100644 --- gfx/harfbuzz/README-mozilla +++ gfx/harfbuzz/README-mozilla @@ -15,3 +15,8 @@ from within the gfx/harfbuzz directory. If the collection of source files changes, manual updates to moz.build may be needed as we don't use the upstream makefiles. + +The in-tree copy may be omitted during build by --with-system-harfbuzz. +Make sure to keep pkg-config version check within toolkit/moz.configure in sync +with checkout version or increment latest tag by one if it's not based +on upstream release. diff --git gfx/moz.build gfx/moz.build index 771f652e837a..3b358d84e384 100644 --- gfx/moz.build +++ gfx/moz.build @@ -13,6 +13,14 @@ with Files('wr/**'): if CONFIG['MOZ_TREE_CAIRO']: DIRS += ['cairo'] +if CONFIG['MOZ_SYSTEM_GRAPHITE2']: + DIRS += ['graphite2/geckoextra'] +else: + DIRS += ['graphite2/src' ] + +if not CONFIG['MOZ_SYSTEM_HARFBUZZ']: + DIRS += ['harfbuzz/src'] + DIRS += [ '2d', 'ycbcr', @@ -21,8 +29,6 @@ DIRS += [ 'qcms', 'gl', 'layers', - 'graphite2/src', - 'harfbuzz/src', 'ots/src', 'thebes', 'ipc', diff --git gfx/skia/generate_mozbuild.py gfx/skia/generate_mozbuild.py index e06ae3457a47..93faa61594a3 100755 --- gfx/skia/generate_mozbuild.py +++ gfx/skia/generate_mozbuild.py @@ -117,6 +117,9 @@ if CONFIG['CC_TYPE'] in ('clang', 'clang-cl'): '-Wno-unused-private-field', ] +if CONFIG['MOZ_SYSTEM_HARFBUZZ']: + CXXFLAGS += CONFIG['MOZ_HARFBUZZ_CFLAGS'] + if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('gtk', 'android'): CXXFLAGS += CONFIG['MOZ_CAIRO_CFLAGS'] CXXFLAGS += CONFIG['CAIRO_FT_CFLAGS'] diff --git gfx/skia/moz.build gfx/skia/moz.build index 2118677ca3a8..e4978b413784 100644 --- gfx/skia/moz.build +++ gfx/skia/moz.build @@ -493,6 +493,9 @@ if CONFIG['CC_TYPE'] in ('clang', 'clang-cl'): '-Wno-unused-private-field', ] +if CONFIG['MOZ_SYSTEM_HARFBUZZ']: + CXXFLAGS += CONFIG['MOZ_HARFBUZZ_CFLAGS'] + if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('gtk', 'android'): CXXFLAGS += CONFIG['MOZ_CAIRO_CFLAGS'] CXXFLAGS += CONFIG['CAIRO_FT_CFLAGS'] diff --git gfx/thebes/moz.build gfx/thebes/moz.build index 56f1b9fe3f4b..0ac1100b0df3 100644 --- gfx/thebes/moz.build +++ gfx/thebes/moz.build @@ -284,7 +284,13 @@ if CONFIG['MOZ_WAYLAND']: LOCAL_INCLUDES += CONFIG['SKIA_INCLUDES'] -DEFINES['GRAPHITE2_STATIC'] = True +if CONFIG['MOZ_SYSTEM_GRAPHITE2']: + CXXFLAGS += CONFIG['MOZ_GRAPHITE2_CFLAGS'] +else: + DEFINES['GRAPHITE2_STATIC'] = True + +if CONFIG['MOZ_SYSTEM_HARFBUZZ']: + CXXFLAGS += CONFIG['MOZ_HARFBUZZ_CFLAGS'] if CONFIG['CC_TYPE'] == 'clang': # Suppress warnings from Skia header files. diff --git intl/unicharutil/util/moz.build intl/unicharutil/util/moz.build index cb1233c56d7e..06fb1f9f174b 100644 --- intl/unicharutil/util/moz.build +++ intl/unicharutil/util/moz.build @@ -25,4 +25,7 @@ UNIFIED_SOURCES += [ 'nsUnicodeProperties.cpp', ] +if CONFIG['MOZ_SYSTEM_HARFBUZZ']: + CXXFLAGS += CONFIG['MOZ_HARFBUZZ_CFLAGS'] + FINAL_LIBRARY = 'xul' diff --git netwerk/dns/moz.build netwerk/dns/moz.build index 79c26e3e7001..c4d93bc5f7dc 100644 --- netwerk/dns/moz.build +++ netwerk/dns/moz.build @@ -86,3 +86,6 @@ USE_LIBS += ['icu'] if CONFIG['CC_TYPE'] in ('clang', 'gcc'): CXXFLAGS += ['-Wno-error=shadow'] + +if CONFIG['MOZ_SYSTEM_HARFBUZZ']: + CXXFLAGS += CONFIG['MOZ_HARFBUZZ_CFLAGS'] diff --git old-configure.in old-configure.in index 95a58b634593..b614eef85c89 100644 --- old-configure.in +++ old-configure.in @@ -2639,6 +2639,27 @@ dnl ======================================================== AC_SUBST(MOZ_LINUX_32_SSE2_STARTUP_ERROR) +dnl ======================================================== +dnl Check for graphite2 +dnl ======================================================== +if test -n "$MOZ_SYSTEM_GRAPHITE2"; then + dnl graphite2.pc has bogus version, check manually + _SAVE_CFLAGS=$CFLAGS + CFLAGS="$CFLAGS $MOZ_GRAPHITE2_CFLAGS" + AC_TRY_COMPILE([ #include + #define GR2_VERSION_REQUIRE(major,minor,bugfix) \ + ( GR2_VERSION_MAJOR * 10000 + GR2_VERSION_MINOR \ + * 100 + GR2_VERSION_BUGFIX >= \ + (major) * 10000 + (minor) * 100 + (bugfix) ) + ], [ -+ #if !GR2_VERSION_REQUIRE(1,3,13) ++ #if !GR2_VERSION_REQUIRE(1,3,14) + #error "Insufficient graphite2 version." + #endif + ], [], + [AC_MSG_ERROR([--with-system-graphite2 requested but no working libgraphite2 found])]) + CFLAGS=$_SAVE_CFLAGS +fi + dnl ======================================================== dnl Check for pixman and cairo dnl ======================================================== diff --git toolkit/library/moz.build toolkit/library/moz.build index 24f940e1ed7e..079a575adec3 100644 --- toolkit/library/moz.build +++ toolkit/library/moz.build @@ -248,6 +248,12 @@ if CONFIG['MOZ_SYSTEM_PNG']: if CONFIG['MOZ_SYSTEM_WEBP']: OS_LIBS += CONFIG['MOZ_WEBP_LIBS'] +if CONFIG['MOZ_SYSTEM_GRAPHITE2']: + OS_LIBS += CONFIG['MOZ_GRAPHITE2_LIBS'] + +if CONFIG['MOZ_SYSTEM_HARFBUZZ']: + OS_LIBS += CONFIG['MOZ_HARFBUZZ_LIBS'] + if CONFIG['MOZ_SYSTEM_LIBEVENT']: OS_LIBS += CONFIG['MOZ_LIBEVENT_LIBS'] diff --git toolkit/moz.configure toolkit/moz.configure index 9297e4d6f501..d8e273887e4b 100644 --- toolkit/moz.configure +++ toolkit/moz.configure @@ -937,6 +937,25 @@ add_old_configure_assignment('FT2_LIBS', add_old_configure_assignment('FT2_CFLAGS', ft2_info.cflags) +# Graphite2 +# ============================================================== +option('--with-system-graphite2', + help="Use system graphite2 (located with pkgconfig)") + +system_graphite2 = pkg_check_modules('MOZ_GRAPHITE2', 'graphite2', + when='--with-system-graphite2') + +set_config('MOZ_SYSTEM_GRAPHITE2', depends_if(system_graphite2)(lambda _: True)) + +# HarfBuzz +# ============================================================== +option('--with-system-harfbuzz', + help="Use system harfbuzz (located with pkgconfig)") + +system_harfbuzz = pkg_check_modules('MOZ_HARFBUZZ', 'harfbuzz >= 2.6.4', + when='--with-system-harfbuzz') + +set_config('MOZ_SYSTEM_HARFBUZZ', depends_if(system_harfbuzz)(lambda _: True)) # Remote agent (part of CDP based remote protocol) # ==============================================================