With these patches, mozilla-firefox builds on aarch64, and runs for me
on my OG pinebook.

I've posted these to the bugzilla report mentioned, so hopefully someone
that understands the firefox build internals can get these sorted in
their magic configuration tool.

This shouldn't change anything for amd64 and it currently doesn't build
on aarch64, so I think no bump is needed.

OK?


Index: 
www/mozilla-firefox/patches/patch-third_party_libwebrtc_common_audio_third_party_ooura_fft_size_128_gn_moz_build
===================================================================
RCS file: 
www/mozilla-firefox/patches/patch-third_party_libwebrtc_common_audio_third_party_ooura_fft_size_128_gn_moz_build
diff -N 
www/mozilla-firefox/patches/patch-third_party_libwebrtc_common_audio_third_party_ooura_fft_size_128_gn_moz_build
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ 
www/mozilla-firefox/patches/patch-third_party_libwebrtc_common_audio_third_party_ooura_fft_size_128_gn_moz_build
    20 Mar 2022 20:20:31 -0000
@@ -0,0 +1,31 @@
+Fix builds on !intel arches
+
+https://bugzilla.mozilla.org/show_bug.cgi?id=1760484
+
+Index: 
third_party/libwebrtc/common_audio/third_party/ooura/fft_size_128_gn/moz.build
+--- 
third_party/libwebrtc/common_audio/third_party/ooura/fft_size_128_gn/moz.build.orig
++++ 
third_party/libwebrtc/common_audio/third_party/ooura/fft_size_128_gn/moz.build
+@@ -90,10 +90,6 @@ if CONFIG["OS_TARGET"] == "Linux":
+ 
+ if CONFIG["OS_TARGET"] == "OpenBSD":
+ 
+-    CXXFLAGS += [
+-        "-msse2"
+-    ]
+-
+     DEFINES["USE_GLIB"] = "1"
+     DEFINES["WEBRTC_BSD"] = True
+     DEFINES["WEBRTC_POSIX"] = True
+@@ -102,6 +98,12 @@ if CONFIG["OS_TARGET"] == "OpenBSD":
+     DEFINES["_LARGEFILE_SOURCE"] = True
+     DEFINES["__STDC_CONSTANT_MACROS"] = True
+     DEFINES["__STDC_FORMAT_MACROS"] = True
++
++if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "OpenBSD":
++
++    CXXFLAGS += [
++        "-msse2"
++    ]
+ 
+     UNIFIED_SOURCES += [
+         
"/third_party/libwebrtc/common_audio/third_party/ooura/fft_size_128/ooura_fft_sse2.cc"
Index: www/mozilla-firefox/patches/patch-third_party_libwebrtc_moz_build
===================================================================
RCS file: www/mozilla-firefox/patches/patch-third_party_libwebrtc_moz_build
diff -N www/mozilla-firefox/patches/patch-third_party_libwebrtc_moz_build
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ www/mozilla-firefox/patches/patch-third_party_libwebrtc_moz_build   20 Mar 
2022 20:20:45 -0000
@@ -0,0 +1,41 @@
+Fix build on !intel arches
+
+https://bugzilla.mozilla.org/show_bug.cgi?id=1760484
+
+Index: third_party/libwebrtc/moz.build
+--- third_party/libwebrtc/moz.build.orig
++++ third_party/libwebrtc/moz.build
+@@ -401,16 +401,29 @@ if CONFIG["OS_TARGET"] == "OpenBSD":
+     DIRS += [
+         
"/third_party/libwebrtc/api/audio_codecs/isac/audio_decoder_isac_float_gn",
+         
"/third_party/libwebrtc/api/audio_codecs/isac/audio_encoder_isac_float_gn",
+-        "/third_party/libwebrtc/common_audio/common_audio_avx2_gn",
+-        "/third_party/libwebrtc/common_audio/common_audio_sse2_gn",
+         "/third_party/libwebrtc/modules/audio_coding/isac_c_gn",
+         "/third_party/libwebrtc/modules/audio_coding/isac_gn",
+-        "/third_party/libwebrtc/modules/audio_processing/aec3/aec3_avx2_gn",
+-        
"/third_party/libwebrtc/modules/desktop_capture/desktop_capture_differ_sse2_gn",
+         
"/third_party/libwebrtc/modules/desktop_capture/desktop_capture_generic_gn",
+         "/third_party/libwebrtc/modules/desktop_capture/desktop_capture_gn",
+         "/third_party/libwebrtc/modules/desktop_capture/primitives_gn",
++    ]
++
++if CONFIG["CPU_ARCH"] == "x86_64" and CONFIG["OS_TARGET"] == "OpenBSD":
++
++    DIRS += [
++        "/third_party/libwebrtc/common_audio/common_audio_avx2_gn",
++        "/third_party/libwebrtc/common_audio/common_audio_sse2_gn",
++        "/third_party/libwebrtc/modules/audio_processing/aec3/aec3_avx2_gn",
++        
"/third_party/libwebrtc/modules/desktop_capture/desktop_capture_differ_sse2_gn",
+         
"/third_party/libwebrtc/modules/video_processing/video_processing_sse2_gn"
++    ]
++
++if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "OpenBSD":
++
++    DIRS += [
++        "/third_party/libwebrtc/common_audio/common_audio_neon_c_gn",
++        "/third_party/libwebrtc/common_audio/common_audio_neon_gn",
++        
"/third_party/libwebrtc/modules/video_processing/video_processing_neon_gn"
+     ]
+ 
+ if CONFIG["OS_TARGET"] == "WINNT":



-- 
"Life to you is a bold and dashing responsibility"
                -- a Mary Chung's fortune cookie

Reply via email to