[packages/firefox52-esr] - patches for build with current clang and nss

qboosh qboosh at pld-linux.org
Sun Oct 25 13:36:03 CET 2026


commit 7c0d04c1720b190b914bc2222ccb64bd4e936ce8
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Sun Oct 25 13:36:48 2026 +0100

    - patches for build with current clang and nss

 firefox-mozjs-clang.patch   | 36 +++++++++++++++++++++++++
 firefox-no-sse-or-mmx.patch | 65 +++++++++++++++++++++++++++++++++++++++++++++
 firefox-nss.patch           | 36 +++++++++++++++++++++++++
 firefox52-esr.spec          |  6 +++++
 4 files changed, 143 insertions(+)
---
diff --git a/firefox52-esr.spec b/firefox52-esr.spec
index bd4283a..a054b54 100644
--- a/firefox52-esr.spec
+++ b/firefox52-esr.spec
@@ -53,6 +53,8 @@ Patch10:	%{srcname}-nss.patch
 Patch11:	xulrunner-pc.patch
 Patch12:	glibc.patch
 Patch13:	%{srcname}-includes.patch
+Patch14:	%{srcname}-no-sse-or-mmx.patch
+Patch15:	%{srcname}-mozjs-clang.patch
 URL:		https://www.mozilla.org/firefox/
 BuildRequires:	OpenGL-devel
 BuildRequires:	alsa-lib-devel
@@ -238,6 +240,10 @@ echo 'LOCAL_INCLUDES += $(MOZ_HUNSPELL_CFLAGS)' >> extensions/spellcheck/src/Mak
 %patch -P11 -p1
 %patch -P12 -p1
 %patch -P13 -p1
+%if %{with clang}
+%patch -P14 -p1
+%endif
+%patch -P15 -p1
 
 %{__sed} -i -e '1s,/usr/bin/env python,%{__python},' xpcom/typelib/xpt/tools/xpt.py xpcom/idl-parser/xpidl/xpidl.py
 
diff --git a/firefox-mozjs-clang.patch b/firefox-mozjs-clang.patch
new file mode 100644
index 0000000..7d86956
--- /dev/null
+++ b/firefox-mozjs-clang.patch
@@ -0,0 +1,36 @@
+
+# HG changeset patch
+# User Mike Hommey <mh+mozilla at glandium.org>
+# Date 1714550740 0
+# Node ID 223087fdc29f18678f6174e9807b8780e439acf6
+# Parent  dbf00dfdc037f79df923fbb6681de64bc74c5a8e
+Bug 1894423 - Remove unused ExclusiveData move constructor. r=spidermonkey-reviewers,jonco
+
+Because the constructor is actually not used, the compiler used to not
+complain about it being broken. Recent changes on clang trunk made it
+catch this problem without the constructor being used.
+
+As Mutex doesn't have a move constructor, it's also not only a matter of
+adding the missing underscore to lock.
+
+As the constructor is never used, just remove it.
+
+Differential Revision: https://phabricator.services.mozilla.com/D209108
+
+diff --git a/js/src/threading/ExclusiveData.h b/js/src/threading/ExclusiveData.h
+--- a/js/src/threading/ExclusiveData.h
++++ b/js/src/threading/ExclusiveData.h
+@@ -117,13 +117,6 @@ class ExclusiveData
+         release();
+     }
+ 
+-    ExclusiveData(ExclusiveData&& rhs) :
+-      lock_(mozilla::Move(rhs.lock))
+-    {
+-        MOZ_ASSERT(&rhs != this, "self-move disallowed!");
+-        new (value_.addr()) T(mozilla::Move(*rhs.value_.addr()));
+-    }
+-
+     ExclusiveData& operator=(ExclusiveData&& rhs) {
+         this->~ExclusiveData();
+         new (this) ExclusiveData(mozilla::Move(rhs));
diff --git a/firefox-no-sse-or-mmx.patch b/firefox-no-sse-or-mmx.patch
new file mode 100644
index 0000000..14ccb40
--- /dev/null
+++ b/firefox-no-sse-or-mmx.patch
@@ -0,0 +1,65 @@
+clang 22 no longer supports MMX and plain SSE (only SSE2+ and MMX/SSE intrinsics are implemented using SSE2)
+--- firefox-52.9.0esr/gfx/qcms/transform.c.orig	2017-04-11 04:13:07.000000000 +0200
++++ firefox-52.9.0esr/gfx/qcms/transform.c	2026-10-23 20:30:03.353529639 +0200
+@@ -1284,7 +1284,7 @@ qcms_transform* qcms_transform_create(
+ 			    else
+ 				    transform->transform_fn = qcms_transform_data_rgba_out_lut_sse2;
+ 
+-#if !(defined(_MSC_VER) && defined(_M_AMD64))
++#if 0
+                     /* Microsoft Compiler for x64 doesn't support MMX.
+                      * SSE code uses MMX so that we disable on x64 */
+ 		    } else
+--- firefox-52.9.0esr/gfx/qcms/moz.build.orig	2017-04-11 04:13:07.000000000 +0200
++++ firefox-52.9.0esr/gfx/qcms/moz.build	2026-10-22 21:30:13.655373270 +0200
+@@ -27,11 +27,6 @@ use_sse2 = False
+ use_altivec = False
+ if '86' in CONFIG['OS_TEST']:
+     use_sse2 = True
+-    if CONFIG['_MSC_VER']:
+-        if CONFIG['OS_ARCH'] != 'WINNT' or CONFIG['OS_TEST'] != 'x86_64':
+-            use_sse1 = True
+-    else:
+-        use_sse1 = True
+ elif CONFIG['HAVE_ALTIVEC']:
+     use_altivec = True
+ 
+--- firefox-52.9.0esr/gfx/ycbcr/yuv_convert.cpp.orig	2017-04-11 04:13:08.000000000 +0200
++++ firefox-52.9.0esr/gfx/ycbcr/yuv_convert.cpp	2026-10-23 20:31:57.866242604 +0200
+@@ -230,7 +230,7 @@ static void FilterRows_C(uint8* ybuf, co
+   } while (ybuf < end);
+ }
+ 
+-#ifdef MOZILLA_MAY_SUPPORT_MMX
++#if 0
+ void FilterRows_MMX(uint8* ybuf, const uint8* y0_ptr, const uint8* y1_ptr,
+                     int source_width, int source_y_fraction);
+ #endif
+@@ -250,7 +250,7 @@ static inline void FilterRows(uint8* ybu
+   }
+ #endif
+ 
+-#ifdef MOZILLA_MAY_SUPPORT_MMX
++#if 0
+   if (mozilla::supports_mmx()) {
+     FilterRows_MMX(ybuf, y0_ptr, y1_ptr, source_width, source_y_fraction);
+     return;
+--- firefox-52.9.0esr/gfx/ycbcr/moz.build.orig	2017-04-11 04:13:08.000000000 +0200
++++ firefox-52.9.0esr/gfx/ycbcr/moz.build	2026-10-23 06:24:24.961736439 +0200
+@@ -23,16 +23,6 @@ if CONFIG['INTEL_ARCHITECTURE']:
+     SOURCES += ['yuv_convert_sse2.cpp']
+     SOURCES['yuv_convert_sse2.cpp'].flags += CONFIG['SSE2_FLAGS']
+ 
+-    # MSVC doesn't support MMX when targeting AMD64.
+-    if CONFIG['_MSC_VER']:
+-        if CONFIG['OS_TEST'] != 'x86_64':
+-            SOURCES += [
+-                'yuv_convert_mmx.cpp',
+-            ]
+-    else:
+-        SOURCES += ['yuv_convert_mmx.cpp']
+-        SOURCES['yuv_convert_mmx.cpp'].flags += CONFIG['MMX_FLAGS']
+-
+ if CONFIG['_MSC_VER']:
+     if CONFIG['OS_TEST'] == 'x86_64':
+         SOURCES += [
diff --git a/firefox-nss.patch b/firefox-nss.patch
index 2c9c7e6..039300f 100644
--- a/firefox-nss.patch
+++ b/firefox-nss.patch
@@ -210,3 +210,39 @@
        mDeletedSpec) {
      aRv.Throw(NS_ERROR_DOM_INDEXEDDB_NOT_ALLOWED_ERR);
      return nullptr;
+--- firefox-52.9.0esr/old-configure.in.orig	2017-09-11 22:13:47.000000000 +0200
++++ firefox-52.9.0esr/old-configure.in	2026-10-23 21:01:21.596687656 +0200
+@@ -2126,9 +2126,7 @@ if test -n "$_USE_SYSTEM_NSS"; then
+     AM_PATH_NSS(3.28.6, [MOZ_SYSTEM_NSS=1], [AC_MSG_ERROR([you don't have NSS installed or your version is too old])])
+ fi
+ 
+-if test -n "$MOZ_SYSTEM_NSS"; then
+-   NSS_LIBS="$NSS_LIBS -lcrmf"
+-else
++if test -z "$MOZ_SYSTEM_NSS"; then
+    NSS_CFLAGS="-I${DIST}/include/nss"
+ fi
+ 
+--- firefox-52.9.0esr/old-configure.orig	2026-10-23 21:18:08.584565668 +0200
++++ firefox-52.9.0esr/old-configure	2026-10-24 08:41:44.749028693 +0200
+@@ -10693,9 +10693,7 @@ echo "configure:10641: checking for NSS
+ 
+ fi
+ 
+-if test -n "$MOZ_SYSTEM_NSS"; then
+-   NSS_LIBS="$NSS_LIBS -lcrmf"
+-else
++if test -z "$MOZ_SYSTEM_NSS"; then
+    NSS_CFLAGS="-I${DIST}/include/nss"
+ fi
+ 
+--- firefox-52.9.0esr/config/external/nss/crmf/moz.build.orig	2017-04-11 04:13:09.000000000 +0200
++++ firefox-52.9.0esr/config/external/nss/crmf/moz.build	2026-10-25 07:53:17.787205201 +0100
+@@ -8,7 +8,6 @@ Library('crmf')
+ 
+ if CONFIG['MOZ_SYSTEM_NSS']:
+     OS_LIBS += [l for l in CONFIG['NSS_LIBS'] if l.startswith('-L')]
+-    OS_LIBS += ['-lcrmf']
+ else:
+     USE_LIBS += [
+         # The dependency on nss is not real, but is required to force the
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/firefox52-esr.git/commitdiff/7c0d04c1720b190b914bc2222ccb64bd4e936ce8



More information about the pld-cvs-commit mailing list