feat: support building for 32-bit ARM Linux (linux-arm)#1245
Closed
ibrahim-mubarak wants to merge 2 commits into
Closed
feat: support building for 32-bit ARM Linux (linux-arm)#1245ibrahim-mubarak wants to merge 2 commits into
ibrahim-mubarak wants to merge 2 commits into
Conversation
Adds an 'arm' arch to the libwebrtc linux build (armv7-a + NEON hard-float baseline, also runs on armv8 AArch32 cores) and makes the webrtc-sys / yuv-sys crates build for armv7-unknown-linux-gnueabihf: - build_linux.sh: accept --arch arm; set arm_float_abi=hard and arm_use_neon. Also allow overriding the Chromium clang with CLANG_BASE_PATH for hosts Chromium ships no clang for (e.g. aarch64 linux), and use its llvm-objcopy for symbol prefixing. - webrtc-sys/build.rs: map arm to the debian_bullseye_armhf sysroot for gio headers and to a new arm-linux-gnueabihf lazy-load dir. - lazy_load_deps_for: add Implib.so-generated trampolines for the desktop-capturer X11/drm/gbm libraries on arm-linux-gnueabihf. - yuv-sys: make YuvConstants opaque in bindgen; its SIMD alignment cannot be mirrored on 32-bit ARM and it is only passed by pointer. There are no prebuilt linux-arm webrtc artifacts; consumers build libwebrtc with build_linux.sh --arch arm and point LK_CUSTOM_WEBRTC at the resulting linux-arm-release directory. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L4fDRyTiTphQnidL2Myptq
VideoDecoderFactory::GetSupportedFormats unconditionally advertised AV1 via LibaomAv1EncoderSupportedScalabilityModes(), which is defined in the libaom encoder object. In a libwebrtc build with enable_libaom=false and rtc_include_dav1d_in_internal_decoder_factory =false this leaves an undefined symbol in liblivekit_ffi. Guard the advertisement with RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY, matching the decoder's actual availability. No change for default builds. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L4fDRyTiTphQnidL2Myptq
|
|
Author
|
Closing — will iterate on our fork first. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds support for building the SDK for 32-bit ARM Linux (
armv7-unknown-linux-gnueabihf, i.e.linux-arm), targeting armv7-a + NEON hard-float as a baseline — which also covers armv8 cores running in AArch32 mode (e.g. Cortex-A32/A35 embedded SoCs).There are no prebuilt
linux-armwebrtc artifacts, so consumers build libwebrtc from source and pointLK_CUSTOM_WEBRTCat it:Changes
webrtc-sys/libwebrtc/build_linux.sh--arch arm; setsarm_float_abi="hard"andarm_use_neon=true(armv7+NEON baseline, same config as the other Linux builds otherwise — X11/PipeWire stay enabled, they are lazy-loaded/dlopen'd at runtime).CLANG_BASE_PATHenv: Chromium only publishes x86-64 Linux clang binaries, so on other build hosts (e.g. aarch64) you can point this at a matching LLVM release; it is passed asclang_base_pathto gn and itsllvm-objcopyis used for the boringssl symbol prefixing step.webrtc-sys/build.rsadd_gio_headers: maparm→debian_bullseye_armhf-sysroot/arm-linux-gnueabihf.add_lazy_load_so: select a newarm-linux-gnueabihftrampoline directory forarm.webrtc-sys/src/lazy_load_deps_for/desktop_capturer/arm-linux-gnueabihf/: Implib.so-generated trampolines for the desktop-capturer X11/drm/gbm libraries (generated withimplib-gen.py --target armhfagainst the Debian bullseye armhf sysroot libs, same procedure as the existing x86_64/aarch64 files).webrtc-sys/src/video_decoder_factory.cpp: guard the AV1 format advertisement withRTC_DAV1D_IN_INTERNAL_DECODER_FACTORY. It callsLibaomAv1EncoderSupportedScalabilityModes(), which is undefined in webrtc builds configured without AV1 (enable_libaom=false, dav1d factory off) — useful for footprint-constrained embedded builds. No change for default builds.yuv-sys/build.rs: markYuvConstantsas an opaque type for bindgen. Its SIMD vector members give it an alignment bindgen cannot mirror on 32-bit ARM (the generated layout test fails with align 2 vs 8); it is only ever passed by pointer from Rust.Testing
linux-arm-releasefrom source (webrtc-sdk/webrtc @ m144_release, commitaaeeee80…751ef663matching thewebrtc-51ef663tag) on an aarch64 Fedora host with LLVM 22.1.8 viaCLANG_BASE_PATH.cargo build -p livekit-ffi --release --target armv7-unknown-linux-gnueabihfsucceeds against it (cross gcc 13.4, glibc 2.39 sysroot); also verified a codec-reduced webrtc build (no AV1/H26x/VP9) links cleanly with the factory guard.liblivekit_ffi.sois a clean 32-bit ARM EABI5 hard-float object whose only hard deps are libc/libm/libstdc++/libgcc.🤖 Generated with Claude Code
https://claude.ai/code/session_01L4fDRyTiTphQnidL2Myptq