Hi,

on my ARM64 workstation firefox has recently begun crashing all the
time.  Turns out it's because QCMS (whatever that is), uses some HW
acceleration (SIMD using NEON/VFP) on ARM64, and the LLVM-backed Rust-
compiler seems to not produce a pseudo-op that instead of emitting
a proper ASM instruction creates a call to it:

         U llvm.fptosi.sat.v4i32.v4f32

This change is a workaround which simply makes QCMS not use NEON on
AArch64.  In the end the right fix would be in Rust/LLVM to create
proper ASM, but I don't know where to look.  Maybe a future update
of Rust/LLVM will fix it automatically.

This patch will continue to compile the NEON extensions, so nm(1)
will still show the reference, but the extensions won't be used.

Not sure this is worth committing.  For now I'll use this locally.

Patrick

diff --git a/www/mozilla-firefox/Makefile b/www/mozilla-firefox/Makefile
index 3de60915c21..1448b6f78ff 100644
--- a/www/mozilla-firefox/Makefile
+++ b/www/mozilla-firefox/Makefile
@@ -6,6 +6,7 @@ ONLY_FOR_ARCHS =        amd64 aarch64
 # Don't forget to bump www/firefox-i18n after updates.
 
 MOZILLA_VERSION =      94.0
+REVISION =             0
 MOZILLA_BRANCH =       release
 MOZILLA_PROJECT =      firefox
 MOZILLA_CODENAME =     browser
diff --git a/www/mozilla-firefox/patches/patch-gfx_qcms_src_transform_rs 
b/www/mozilla-firefox/patches/patch-gfx_qcms_src_transform_rs
new file mode 100644
index 00000000000..1764109fba6
--- /dev/null
+++ b/www/mozilla-firefox/patches/patch-gfx_qcms_src_transform_rs
@@ -0,0 +1,26 @@
+$OpenBSD$
+
+Index: gfx/qcms/src/transform.rs
+--- gfx/qcms/src/transform.rs.orig
++++ gfx/qcms/src/transform.rs
+@@ -21,7 +21,7 @@
+ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ 
+ #![allow(clippy::missing_safety_doc)]
+-#[cfg(all(any(target_arch = "arm", target_arch = "aarch64"), feature = 
"neon"))]
++#[cfg(all(any(target_arch = "arm"), feature = "neon"))]
+ use crate::transform_neon::{
+     qcms_transform_data_bgra_out_lut_neon, 
qcms_transform_data_rgb_out_lut_neon,
+     qcms_transform_data_rgba_out_lut_neon,
+@@ -1367,10 +1367,8 @@ pub fn transform_create(
+ 
+             #[cfg(all(target_arch = "arm", feature = "neon"))]
+             let neon_supported = is_arm_feature_detected!("neon");
+-            #[cfg(all(target_arch = "aarch64", feature = "neon"))]
+-            let neon_supported = is_aarch64_feature_detected!("neon");
+ 
+-            #[cfg(all(any(target_arch = "arm", target_arch = "aarch64"), 
feature = "neon"))]
++            #[cfg(all(any(target_arch = "arm"), feature = "neon"))]
+             if neon_supported {
+                 if in_type == RGB8 {
+                     transform.transform_fn = 
Some(qcms_transform_data_rgb_out_lut_neon)

Reply via email to