diff --git a/srcpkgs/firefox/files/mozconfig b/srcpkgs/firefox/files/mozconfig index ac3ab4f26d9..2bd421af0c6 100644 --- a/srcpkgs/firefox/files/mozconfig +++ b/srcpkgs/firefox/files/mozconfig @@ -43,6 +43,7 @@ ac_add_options --disable-profiling ac_add_options --enable-optimize="$CFLAGS" ac_add_options --enable-pie +ac_add_options --enable-release ac_add_options --enable-official-branding ac_add_options --enable-safe-browsing ac_add_options --enable-application=browser diff --git a/srcpkgs/firefox/patches/fix-seccomp-musl.patch b/srcpkgs/firefox/patches/fix-seccomp-musl.patch deleted file mode 100644 index e752585dc78..00000000000 --- a/srcpkgs/firefox/patches/fix-seccomp-musl.patch +++ /dev/null @@ -1,184 +0,0 @@ - -# HG changeset patch -# User Jed Davis -# Date 1499804607 21600 -# Node ID a8f06d32af317f7db813252afbaae05a13d8863a -# Parent 5cac7af6804c46f6e74547a0fed3c1cb27abc134 -Bug 1376653 - Loosen restrictions on clone flags for musl. r=gcp - -I've made this non-ifdef'ed, and removed currently unused ifdef'ed cases -for old Android versions, because I'd rather have less code that we're -not even compile-testing than save a few cycles on a non-critical path. - -MozReview-Commit-ID: B4Wn1elyK4f - -diff --git security/sandbox/linux/SandboxFilter.cpp security/sandbox/linux/SandboxFilter.cpp ---- security/sandbox/linux/SandboxFilter.cpp -+++ security/sandbox/linux/SandboxFilter.cpp -@@ -120,35 +120,29 @@ public: - virtual ResultExpr ClonePolicy(ResultExpr failPolicy) const { - // Allow use for simple thread creation (pthread_create) only. - - // WARNING: s390 and cris pass the flags in the second arg -- see - // CLONE_BACKWARDS2 in arch/Kconfig in the kernel source -- but we - // don't support seccomp-bpf on those archs yet. - Arg flags(0); - -- // The glibc source hasn't changed the thread creation clone flags -- // since 2004, so this *should* be safe to hard-code. Bionic's -- // value has changed a few times, and has converged on the same one -- // as glibc; allow any of them. -- static const int flags_common = CLONE_VM | CLONE_FS | CLONE_FILES | -- CLONE_SIGHAND | CLONE_THREAD | CLONE_SYSVSEM; -- static const int flags_modern = flags_common | CLONE_SETTLS | -+ // The exact flags used can vary. CLONE_DETACHED is used by musl -+ // and by old versions of Android (<= JB 4.2), but it's been -+ // ignored by the kernel since the beginning of the Git history. -+ // -+ // If we ever need to support Android <= KK 4.4 again, SETTLS -+ // and the *TID flags will need to be made optional. -+ static const int flags_required = CLONE_VM | CLONE_FS | CLONE_FILES | -+ CLONE_SIGHAND | CLONE_THREAD | CLONE_SYSVSEM | CLONE_SETTLS | - CLONE_PARENT_SETTID | CLONE_CHILD_CLEARTID; -+ static const int flags_optional = CLONE_DETACHED; - -- // Can't use CASES here because its decltype magic infers const -- // int instead of regular int and bizarre voluminous errors issue -- // forth from the depths of the standard library implementation. -- return Switch(flags) --#ifdef ANDROID -- .Case(flags_common | CLONE_DETACHED, Allow()) // <= JB 4.2 -- .Case(flags_common, Allow()) // JB 4.3 or KK 4.4 --#endif -- .Case(flags_modern, Allow()) // Android L or glibc -- .Default(failPolicy); -+ return If((flags & ~flags_optional) == flags_required, Allow()) -+ .Else(failPolicy); - } - - virtual ResultExpr PrctlPolicy() const { - // Note: this will probably need PR_SET_VMA if/when it's used on - // Android without being overridden by an allow-all policy, and - // the constant will need to be defined locally. - Arg op(0); - return Switch(op) - - -# HG changeset patch -# User Jed Davis -# Date 1499813988 21600 -# Node ID 9b5bb669d1283995fd8d01fe779bd8646cb2cd92 -# Parent a8f06d32af317f7db813252afbaae05a13d8863a -Bug 1376653 - Unconditionalize the tkill() polyfill. r=gcp - -MozReview-Commit-ID: JzLWCRQ9Keg - -diff --git security/sandbox/linux/SandboxFilter.cpp security/sandbox/linux/SandboxFilter.cpp ---- security/sandbox/linux/SandboxFilter.cpp -+++ security/sandbox/linux/SandboxFilter.cpp -@@ -87,25 +87,24 @@ protected: - typedef const sandbox::arch_seccomp_data& ArgsRef; - - static intptr_t BlockedSyscallTrap(ArgsRef aArgs, void *aux) { - MOZ_ASSERT(!aux); - return -ENOSYS; - } - - private: --#if defined(ANDROID) && ANDROID_VERSION < 16 - // Bug 1093893: Translate tkill to tgkill for pthread_kill; fixed in - // bionic commit 10c8ce59a (in JB and up; API level 16 = Android 4.1). -+ // Bug 1376653: musl also needs this, and security-wise it's harmless. - static intptr_t TKillCompatTrap(const sandbox::arch_seccomp_data& aArgs, - void *aux) - { - return syscall(__NR_tgkill, getpid(), aArgs.args[0], aArgs.args[1]); - } --#endif - - static intptr_t SetNoNewPrivsTrap(ArgsRef& aArgs, void* aux) { - if (gSetSandboxFilter == nullptr) { - // Called after BroadcastSetThreadSandbox finished, therefore - // not our doing and not expected. - return BlockedSyscallTrap(aArgs, nullptr); - } - // Signal that the filter is already in place. -@@ -236,21 +235,19 @@ public: - - // Send signals within the process (raise(), profiling, etc.) - case __NR_tgkill: { - Arg tgid(0); - return If(tgid == getpid(), Allow()) - .Else(InvalidSyscall()); - } - --#if defined(ANDROID) && ANDROID_VERSION < 16 - // Polyfill with tgkill; see above. - case __NR_tkill: - return Trap(TKillCompatTrap, nullptr); --#endif - - // Yield - case __NR_sched_yield: - return Allow(); - - // Thread creation. - case __NR_clone: - return ClonePolicy(InvalidSyscall()); - - -# HG changeset patch -# User Jed Davis -# Date 1499814186 21600 -# Node ID f68747fe8a15bc355f6380b760d747d52a9f4d26 -# Parent 9b5bb669d1283995fd8d01fe779bd8646cb2cd92 -Bug 1376653 - Fix handling of architecture differences for getdents. r=gcp - -MozReview-Commit-ID: ArGStWwkJAg - -diff --git security/sandbox/linux/SandboxFilterUtil.h security/sandbox/linux/SandboxFilterUtil.h ---- security/sandbox/linux/SandboxFilterUtil.h -+++ security/sandbox/linux/SandboxFilterUtil.h -@@ -100,34 +100,38 @@ public: - #ifdef __NR_stat64 - #define CASES_FOR_stat case __NR_stat64 - #define CASES_FOR_lstat case __NR_lstat64 - #define CASES_FOR_fstat case __NR_fstat64 - #define CASES_FOR_fstatat case __NR_fstatat64 - #define CASES_FOR_statfs case __NR_statfs64: case __NR_statfs - #define CASES_FOR_fstatfs case __NR_fstatfs64: case __NR_fstatfs - #define CASES_FOR_fcntl case __NR_fcntl64 --// We're using the 32-bit version on 32-bit desktop for some reason. --#define CASES_FOR_getdents case __NR_getdents64: case __NR_getdents - // FIXME: we might not need the compat cases for these on non-Android: - #define CASES_FOR_lseek case __NR_lseek: case __NR__llseek - #define CASES_FOR_ftruncate case __NR_ftruncate: case __NR_ftruncate64 - #else - #define CASES_FOR_stat case __NR_stat - #define CASES_FOR_lstat case __NR_lstat - #define CASES_FOR_fstatat case __NR_newfstatat - #define CASES_FOR_fstat case __NR_fstat - #define CASES_FOR_fstatfs case __NR_fstatfs - #define CASES_FOR_statfs case __NR_statfs - #define CASES_FOR_fcntl case __NR_fcntl --#define CASES_FOR_getdents case __NR_getdents - #define CASES_FOR_lseek case __NR_lseek - #define CASES_FOR_ftruncate case __NR_ftruncate - #endif - -+// getdents is not like the other FS-related syscalls with a "64" variant -+#ifdef __NR_getdents -+#define CASES_FOR_getdents case __NR_getdents64: case __NR_getdents -+#else -+#define CASES_FOR_getdents case __NR_getdents64 -+#endif -+ - #ifdef __NR_sigprocmask - #define CASES_FOR_sigprocmask case __NR_sigprocmask: case __NR_rt_sigprocmask - #define CASES_FOR_sigaction case __NR_sigaction: case __NR_rt_sigaction - #define CASES_FOR_sigreturn case __NR_sigreturn: case __NR_rt_sigreturn - #else - #define CASES_FOR_sigprocmask case __NR_rt_sigprocmask - #define CASES_FOR_sigaction case __NR_rt_sigaction - #define CASES_FOR_sigreturn case __NR_rt_sigreturn - diff --git a/srcpkgs/firefox/patches/fix-tools.patch b/srcpkgs/firefox/patches/fix-tools.patch index 80e79173bc2..d5a94cb5798 100644 --- a/srcpkgs/firefox/patches/fix-tools.patch +++ b/srcpkgs/firefox/patches/fix-tools.patch @@ -28,14 +28,15 @@ --- tools/profiler/core/platform-linux-android.cpp.orig +++ tools/profiler/core/platform-linux-android.cpp -@@ -505,8 +505,10 @@ - MOZ_ASSERT(mIsSynchronous); - MOZ_ASSERT(aContext); - +@@ -534,9 +534,11 @@ + void + Registers::SyncPopulate() + { +#if defined(__GLIBC__) - if (!getcontext(aContext)) { - FillInSample(*this, aContext); + if (!getcontext(&sSyncUContext)) { + PopulateRegsFromContext(*this, &sSyncUContext); } +#endif } - + #endif + diff --git a/srcpkgs/firefox/patches/skia-freetype.patch b/srcpkgs/firefox/patches/skia-freetype.patch deleted file mode 100644 index 6216333b491..00000000000 --- a/srcpkgs/firefox/patches/skia-freetype.patch +++ /dev/null @@ -1,163 +0,0 @@ -# HG changeset patch -# User Lee Salzman -# Date 1504120456 14400 -# Wed Aug 30 15:14:16 2017 -0400 -# Node ID 708d52f954b6d7ca2497fcb5b5084c6483300e89 -# Parent 33224536ce20d942576cd4b9ffb350d6dce397bc -clip FreeType glyph bitmap to mask in Skia - -MozReview-Commit-ID: 9NqLj9SkHFo - -diff --git a/gfx/skia/skia/src/ports/SkFontHost_FreeType_common.cpp b/gfx/skia/skia/src/ports/SkFontHost_FreeType_common.cpp ---- gfx/skia/skia/src/ports/SkFontHost_FreeType_common.cpp -+++ gfx/skia/skia/src/ports/SkFontHost_FreeType_common.cpp -@@ -390,65 +390,131 @@ void SkScalerContext_FreeType_Base::gene - const SkMatrix& bitmapTransform) - { - const bool doBGR = SkToBool(fRec.fFlags & SkScalerContext::kLCD_BGROrder_Flag); - const bool doVert = SkToBool(fRec.fFlags & SkScalerContext::kLCD_Vertical_Flag); - - switch ( face->glyph->format ) { - case FT_GLYPH_FORMAT_OUTLINE: { - FT_Outline* outline = &face->glyph->outline; -- FT_BBox bbox; -- FT_Bitmap target; - - int dx = 0, dy = 0; - if (fRec.fFlags & SkScalerContext::kSubpixelPositioning_Flag) { - dx = SkFixedToFDot6(glyph.getSubXFixed()); - dy = SkFixedToFDot6(glyph.getSubYFixed()); - // negate dy since freetype-y-goes-up and skia-y-goes-down - dy = -dy; - } -- FT_Outline_Get_CBox(outline, &bbox); -- /* -- what we really want to do for subpixel is -- offset(dx, dy) -- compute_bounds -- offset(bbox & !63) -- but that is two calls to offset, so we do the following, which -- achieves the same thing with only one offset call. -- */ -- FT_Outline_Translate(outline, dx - ((bbox.xMin + dx) & ~63), -- dy - ((bbox.yMin + dy) & ~63)); -+ -+ memset(glyph.fImage, 0, glyph.rowBytes() * glyph.fHeight); - - if (SkMask::kLCD16_Format == glyph.fMaskFormat) { -+ FT_Outline_Translate(outline, dx, dy); - FT_Error err = FT_Render_Glyph(face->glyph, doVert ? FT_RENDER_MODE_LCD_V : - FT_RENDER_MODE_LCD); - if (err) { - SK_TRACEFTR(err, "Could not render glyph."); -- sk_bzero(glyph.fImage, glyph.computeImageSize()); - return; - } -+ - SkMask mask; - glyph.toMask(&mask); -+#ifdef SK_SHOW_TEXT_BLIT_COVERAGE -+ memset(mask.fImage, 0x80, mask.fBounds.height() * mask.fRowBytes); -+#endif -+ FT_GlyphSlotRec& ftGlyph = *face->glyph; -+ -+ if (!SkIRect::Intersects(mask.fBounds, -+ SkIRect::MakeXYWH( ftGlyph.bitmap_left, -+ -ftGlyph.bitmap_top, -+ ftGlyph.bitmap.width, -+ ftGlyph.bitmap.rows))) -+ { -+ return; -+ } -+ -+ // If the FT_Bitmap extent is larger, discard bits of the bitmap outside the mask. -+ // If the SkMask extent is larger, shrink mask to fit bitmap (clearing discarded). -+ unsigned char* origBuffer = ftGlyph.bitmap.buffer; -+ // First align the top left (origin). -+ if (-ftGlyph.bitmap_top < mask.fBounds.fTop) { -+ int32_t topDiff = mask.fBounds.fTop - (-ftGlyph.bitmap_top); -+ ftGlyph.bitmap.buffer += ftGlyph.bitmap.pitch * topDiff; -+ ftGlyph.bitmap.rows -= topDiff; -+ ftGlyph.bitmap_top = -mask.fBounds.fTop; -+ } -+ if (ftGlyph.bitmap_left < mask.fBounds.fLeft) { -+ int32_t leftDiff = mask.fBounds.fLeft - ftGlyph.bitmap_left; -+ ftGlyph.bitmap.buffer += leftDiff; -+ ftGlyph.bitmap.width -= leftDiff; -+ ftGlyph.bitmap_left = mask.fBounds.fLeft; -+ } -+ if (mask.fBounds.fTop < -ftGlyph.bitmap_top) { -+ mask.fImage += mask.fRowBytes * (-ftGlyph.bitmap_top - mask.fBounds.fTop); -+ mask.fBounds.fTop = -ftGlyph.bitmap_top; -+ } -+ if (mask.fBounds.fLeft < ftGlyph.bitmap_left) { -+ mask.fImage += sizeof(uint16_t) * (ftGlyph.bitmap_left - mask.fBounds.fLeft); -+ mask.fBounds.fLeft = ftGlyph.bitmap_left; -+ } -+ // Origins aligned, clean up the width and height. -+ int ftVertScale = (doVert ? 3 : 1); -+ int ftHoriScale = (doVert ? 1 : 3); -+ if (mask.fBounds.height() * ftVertScale < SkToInt(ftGlyph.bitmap.rows)) { -+ ftGlyph.bitmap.rows = mask.fBounds.height() * ftVertScale; -+ } -+ if (mask.fBounds.width() * ftHoriScale < SkToInt(ftGlyph.bitmap.width)) { -+ ftGlyph.bitmap.width = mask.fBounds.width() * ftHoriScale; -+ } -+ if (SkToInt(ftGlyph.bitmap.rows) < mask.fBounds.height() * ftVertScale) { -+ mask.fBounds.fBottom = mask.fBounds.fTop + ftGlyph.bitmap.rows / ftVertScale; -+ } -+ if (SkToInt(ftGlyph.bitmap.width) < mask.fBounds.width() * ftHoriScale) { -+ mask.fBounds.fRight = mask.fBounds.fLeft + ftGlyph.bitmap.width / ftHoriScale; -+ } - if (fPreBlend.isApplicable()) { -- copyFT2LCD16(face->glyph->bitmap, mask, doBGR, -+ copyFT2LCD16(ftGlyph.bitmap, mask, doBGR, - fPreBlend.fR, fPreBlend.fG, fPreBlend.fB); - } else { -- copyFT2LCD16(face->glyph->bitmap, mask, doBGR, -+ copyFT2LCD16(ftGlyph.bitmap, mask, doBGR, - fPreBlend.fR, fPreBlend.fG, fPreBlend.fB); - } -+ // Restore the buffer pointer so FreeType can properly free it. -+ ftGlyph.bitmap.buffer = origBuffer; - } else { -+ FT_BBox bbox; -+ FT_Bitmap target; -+ FT_Outline_Get_CBox(outline, &bbox); -+ /* -+ what we really want to do for subpixel is -+ offset(dx, dy) -+ compute_bounds -+ offset(bbox & !63) -+ but that is two calls to offset, so we do the following, which -+ achieves the same thing with only one offset call. -+ */ -+ FT_Outline_Translate(outline, dx - ((bbox.xMin + dx) & ~63), -+ dy - ((bbox.yMin + dy) & ~63)); -+ - target.width = glyph.fWidth; - target.rows = glyph.fHeight; - target.pitch = glyph.rowBytes(); - target.buffer = reinterpret_cast(glyph.fImage); - target.pixel_mode = compute_pixel_mode( (SkMask::Format)fRec.fMaskFormat); - target.num_grays = 256; - -- memset(glyph.fImage, 0, glyph.rowBytes() * glyph.fHeight); - FT_Outline_Get_Bitmap(face->glyph->library, outline, &target); -+#ifdef SK_SHOW_TEXT_BLIT_COVERAGE -+ for (int y = 0; y < glyph.fHeight; ++y) { -+ for (int x = 0; x < glyph.fWidth; ++x) { -+ uint8_t& a = ((uint8_t*)glyph.fImage)[(glyph.rowBytes() * y) + x]; -+ a = SkTMax(a, 0x20); -+ } -+ } -+#endif - } - } break; - - case FT_GLYPH_FORMAT_BITMAP: { - FT_Pixel_Mode pixel_mode = static_cast(face->glyph->bitmap.pixel_mode); - SkMask::Format maskFormat = static_cast(glyph.fMaskFormat); - - // Assume that the other formats do not exist. - diff --git a/srcpkgs/firefox/template b/srcpkgs/firefox/template index 06e8590d361..da8e90432f5 100644 --- a/srcpkgs/firefox/template +++ b/srcpkgs/firefox/template @@ -1,28 +1,28 @@ # Template build file for 'firefox'. pkgname=firefox -version=55.0.3 -revision=2 +version=56.0.1 +revision=1 short_desc="Mozilla Firefox web browser" maintainer="Juan RP " homepage="https://www.mozilla.org/firefox/" license="MPL-2.0, GPL-2, LGPL-2.1" distfiles="${MOZILLA_SITE}/${pkgname}/releases/${version}/source/${pkgname}-${version}.source.tar.xz" -checksum=891836df85f8798c49f7b25661820f64d1311d59703c716eda471819b93ccda2 +checksum=ece052c9385ac6ccf58edb213b875f4793014c431f7e40de146bcd2dbcb0a3cb only_for_archs="i686 i686-musl x86_64 x86_64-musl" nopie=yes lib32disabled=yes -hostmakedepends="autoconf213 unzip zip pkg-config perl python yasm rust cargo" -makedepends=" - nss-devel libjpeg-turbo-devel gtk+-devel icu-devel pixman-devel +hostmakedepends="autoconf213 unzip zip pkg-config perl python yasm rust cargo + llvm clang" +makedepends="nss-devel libjpeg-turbo-devel gtk+-devel icu-devel pixman-devel sqlite-devel libevent-devel libnotify-devel libvpx-devel libXrender-devel hunspell-devel libXcomposite-devel libSM-devel libXt-devel libXdamage-devel $(vopt_if alsa alsa-lib-devel) $(vopt_if dbus dbus-glib-devel) $(vopt_if gtk3 gtk+3-devel) $(vopt_if pulseaudio pulseaudio-devel) $(vopt_if startup_notification startup-notification-devel) $(vopt_if xscreensaver libXScrnSaver-devel)" -depends="nss>=3.32 desktop-file-utils hicolor-icon-theme" +depends="nss>=3.32.1 desktop-file-utils hicolor-icon-theme" conflicts="firefox-esr>=0" build_options="alsa dbus gtk3 pulseaudio startup_notification xscreensaver" @@ -48,10 +48,23 @@ post_extract() { do_build() { cp "${FILESDIR}/mozconfig" "${wrksrc}/.mozconfig" + case "$XBPS_TARGET_MACHINE" in + x86_64*) + # https://bugzilla.mozilla.org/show_bug.cgi?id=1341234 + echo "ac_add_options BINDGEN_CFLAGS='-I/usr/include/nspr -I/usr/include/pixman-1'" >>.mozconfig + # needed to enable stylo at runtime by default + echo "ac_add_options --enable-stylo" >>.mozconfig + ;; + i686*) + # https://bugzilla.mozilla.org/show_bug.cgi?id=1401093 + echo "ac_add_options --disable-stylo" >>.mozconfig + ;; + esac + case "$XBPS_TARGET_MACHINE" in *-musl) echo "ac_add_options --disable-jemalloc" >>.mozconfig - echo "ac_add_options --enable-gold=no" >>.mozconfig + echo "ac_add_options --disable-gold" >>.mozconfig ;; esac