fix webrtc build on OpenBSD/arm64
Categories
(Core :: WebRTC, defect, P3)
Tracking
()
People
(Reporter: gaston, Assigned: glandium)
References
Details
Attachments
(1 file)
(deleted),
text/x-phabricator-request
|
RyanVM
:
approval-mozilla-esr102+
|
Details |
webrtc build was fixed for OpenBSD/amd64 in bug #1747862, but at the time i didnt have access to arm64 (and still dont, and dont plan to have some), but i've been reported that as-is firefox doesnt build on OpenBSD/arm64 in webrtc.
apparently, some x86 targets are also build on arm64, which cant work.
a patch in the generated moz.build file seems to help (only reporting informations..)
Index: third_party/libwebrtc/moz.build
--- third_party/libwebrtc/moz.build.orig
+++ third_party/libwebrtc/moz.build
@@ -401,15 +401,20 @@ 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"
]
ofc, now one would have to figure out what to change where in the BUILD.gn files ..
This is the final set of diffs I needed to build and run firefox on OpenBSD arm64. They are pretty simply just making OpenBSD a normal multi-arch OS.
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: 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":
Reporter | ||
Comment 2•3 years ago
|
||
:mjf, is there any chance to land those changes directly in the moz.build files ? from my understanding, otherwise one would have to check/compare the arm64 vs amd64 json files which are generated from the BUILD.gn files to figure out what would need fixes in those files..
Anyway, were the moz.build files regenerated for a fix on another platform, i'm not even sure the generated moz.build files would still work for OpenBSD ?
(honestly, my recollection of the process is: "it was painful and time-consuming")
Reporter | ||
Updated•3 years ago
|
Reporter | ||
Comment 3•3 years ago
|
||
Fwiw, where most of the work was done for OpenBSD/amd64 was in bug #1654448 (not much in bug #1747862) if some brave soul plans to do the right thing for OpenBSD/arm64.
Reporter | ||
Comment 4•3 years ago
|
||
my take would be:
- diff
dom/media/webrtc/third_party_build/gn-configs/x64_False_{arm64,x64}_linux.json
, checking where sse2/neon appears or not - apply manually those modifications to
dom/media/webrtc/third_party_build/gn-configs/x64_*arm64_openbsd.json
Reporter | ||
Comment 5•3 years ago
|
||
or read https://searchfox.org/mozilla-central/source/dom/media/webrtc/third_party_build/gn-configs/README-openbsd.md and apply to arm64, thanks :mjf i hadnt seen that you wrote this.
Comment 6•3 years ago
|
||
(In reply to Landry Breuil (:gaston) from comment #2)
:mjf, is there any chance to land those changes directly in the moz.build files ? from my understanding, otherwise one would have to check/compare the arm64 vs amd64 json files which are generated from the BUILD.gn files to figure out what would need fixes in those files..
Since the moz.build files are generated (as are the json files), we will not accept manual changes to those files. The BUILD.gn files are the place to make the changes.
Anyway, were the moz.build files regenerated for a fix on another platform, i'm not even sure the generated moz.build files would still work for OpenBSD ?
Correct, if anything else required regenerating files, any manual changes would be lost.
Updated•3 years ago
|
Assignee | ||
Comment 7•2 years ago
|
||
Updated•2 years ago
|
Reporter | ||
Comment 8•2 years ago
|
||
that doesnt really 100% match what we have in https://github.com/openbsd/ports/blob/master/www/mozilla-firefox/patches/patch-third_party_libwebrtc_moz_build and https://github.com/openbsd/ports/blob/master/www/mozilla-firefox/patches/patch-third_party_libwebrtc_common_audio_third_party_ooura_fft_size_128_gn_moz_build but i guess i'll try to find someone to test it on arm64..
Comment 10•2 years ago
|
||
Backed out for causing build bustages.
Failure logs: https://treeherder.mozilla.org/logviewer?job_id=381951166&repo=autoland
Comment 11•2 years ago
|
||
Comment 12•2 years ago
|
||
Backed out for causing multiple failures
Backout link: https://hg.mozilla.org/integration/autoland/rev/1bff014a2d90deeec6c821a7f1ee2a2fe3014bcb
Comment 13•2 years ago
|
||
Comment 14•2 years ago
|
||
bugherder |
Assignee | ||
Comment 15•2 years ago
|
||
Comment on attachment 9281531 [details]
Bug 1760484 - Add webrtc configs for arm64 openbsd.
ESR Uplift Approval Request
- If this is not a sec:{high,crit} bug, please state case for ESR consideration: Broken builds for tier-3 downstreams.
- User impact if declined:
- Fix Landed on Version: 103
- Risk to taking this patch: Low
- Why is the change risky/not risky? (and alternatives if risky): NPOTB
Comment 16•2 years ago
|
||
Comment on attachment 9281531 [details]
Bug 1760484 - Add webrtc configs for arm64 openbsd.
Approved for 102.1esr.
Reporter | ||
Comment 17•2 years ago
|
||
Fwiw, with glandium's work in this bug and bug #1773223, i've been able to build 103.0b1 (which includes https://hg.mozilla.org/mozilla-central/rev/7be63a667b04) on OpenBSD/arm64 after having dropped/removed all the local patches we had (https://github.com/openbsd/ports/commit/48a1d304638782f82e5a52a674c0ae538849d225). Havent been able to actually test webrtc on arm64 but at least it builds fine unpatched !
Comment 18•2 years ago
|
||
bugherder uplift |
Description
•