Submitted by:            Pierre Labastie <pierre dot labastie at neuf dot fr>
Date:                    2026-10-20
Initial Package Version: Seamonkey-2.53.24
Upstream Status:         Applied in Mozilla-central, but not for seamonkey
Origin:                  Rediffed from a patch by Xi Ruoyao
                         mozilla-central commit 8df170d41a0b
                         (test suite change removed)
                         harfbuzz commit 5e887d36722a (synced into mozilla-
                         central at commit b71906b223a6, the change removing
                         a previous incorrect change removed)
Description:             Allow building seamonkey with clang 23 and rustc 1.98+

diff -Naur a/build/moz.configure/rust.configure b/build/moz.configure/rust.configure
--- a/build/moz.configure/rust.configure	2026-05-30 15:08:55.000000000 +0200
+++ b/build/moz.configure/rust.configure	2026-10-20 11:07:09.367040951 +0200
@@ -226,6 +226,10 @@
         elif not candidates:
             return None
 
+        # config.guess uses the "pc" vendor for x86/x86_64 where rust uses its
+        # generic "unknown" vendor; normalize so we correlate on the right one.
+        vendor = "unknown" if host_or_target.vendor == "pc" else host_or_target.vendor
+
         # We have multiple candidates. There are two cases where we can try to
         # narrow further down using extra information from the build system.
         # - For windows targets, correlate with the C compiler type
@@ -283,10 +287,19 @@
             else:
                 suffix = ''
             for p in prefixes:
-                for c in candidates:
-                    if c.rust_target.startswith('{}-'.format(p)) and \
-                            c.rust_target.endswith(suffix):
+                matches = [
+                    c
+                    for c in candidates
+                    if c.rust_target.startswith("{}-".format(p))
+                    and c.rust_target.endswith(suffix)
+                ]
+                if not matches:
+                    continue
+                # As below, correlate on the (normalized) vendor.
+                for c in matches:
+                    if c.target.vendor == vendor:
                         return c.rust_target
+                return matches[0].rust_target
 
         # See if we can narrow down on the exact alias
         narrowed = [c for c in candidates if c.target.alias == host_or_target.alias]
@@ -300,6 +313,15 @@
         if len(narrowed) == 1:
             return narrowed[0].rust_target
         elif narrowed:
+            candidates = narrowed
+
+        # Correlate on the (normalized) vendor, so vendor-specific targets (e.g.
+        # the *-oe-linux-gnu targets added in rust 1.98) don't shadow the
+        # generic ones for aliases whose vendor doesn't match a rust target.
+        narrowed = [c for c in candidates if c.target.vendor == vendor]
+        if len(narrowed) == 1:
+            return narrowed[0].rust_target
+        elif narrowed:
             candidates = narrowed
 
         # See if we can narrow down with the raw OS and raw CPU
diff -Naur a/gfx/harfbuzz/src/hb.hh b/gfx/harfbuzz/src/hb.hh
--- a/gfx/harfbuzz/src/hb.hh	2026-05-30 15:08:55.000000000 +0200
+++ b/gfx/harfbuzz/src/hb.hh	2026-10-20 11:09:32.876744220 +0200
@@ -132,6 +132,7 @@
 #pragma GCC diagnostic ignored "-Wrange-loop-analysis" // https://github.com/harfbuzz/harfbuzz/issues/2834
 #pragma GCC diagnostic ignored "-Wstrict-aliasing"
 #pragma GCC diagnostic ignored "-Wtype-limits"
+#pragma GCC diagnostic ignored "-Wunused-template"
 #pragma GCC diagnostic ignored "-Wc++11-compat" // only gcc raises it
 #endif
 
