Fix Linux ARM64 crash caused by missing fontconfig in cross-compile sysroot#3494
Merged
mattleibow merged 5 commits intomainfrom Feb 3, 2026
Merged
Fix Linux ARM64 crash caused by missing fontconfig in cross-compile sysroot#3494mattleibow merged 5 commits intomainfrom
mattleibow merged 5 commits intomainfrom
Conversation
|
Triage Summary Labels will be applied to indicate issues related to reliability on Linux ARM64, the SkiaSharp library, and its backend functionalities. This issue does not appear to be marked as a regression, but it highlights a critical reliability issue. Additional remarks:
Detailed Summary and ActionsSummary of the triage:
Summary of the actions that will be performed:
This entire triage process was automated by AI and mistakes may have been made. Please let us know so we can continue to improve. |
1b84ef3 to
fe4fec0
Compare
…e sysroot The cross-compile Docker for ARM64 was missing the fontconfig runtime library (libfontconfig1), causing the linker to silently skip linking -lfontconfig because the .so symlink pointed to a non-existent file. Root cause: The -dev package only provides headers and a symlink (libfontconfig.so -> libfontconfig.so.1.12.0), but the actual shared library (.so.1.12.0) comes from the runtime package (libfontconfig1). This resulted in: - ARM64 libSkiaSharp.so missing libfontconfig.so.1 in DT_NEEDED - Runtime crash: 'undefined symbol: uuid_generate_random' (fontconfig's dependency) - Also affected: 'undefined symbol: FT_Get_BDF_Property' (freetype via fontconfig) Fix: Download both libfontconfig1-dev (headers, .a, symlink) AND libfontconfig1 (actual .so) when setting up the cross-compile sysroot. Fixes #3369 Fixes #3272 Fixes #3436
The same broken symlink issue exists in all cross-compile Dockerfiles. This commit ensures fontconfig is properly linked on all architectures using any of the Debian-based cross-compile images.
- Add --verifyIncluded argument to native/linux/build.cake (inverse of verifyExcluded) - Update build scripts to pass through extra arguments - Only apply verifyIncluded check to libSkiaSharp (not HarfBuzz) This allows CI to verify that fontconfig is properly linked on cross-compiled builds.
This ensures fontconfig is properly linked on all cross-compiled Linux builds: - Dockerfile 10: arm, arm64, x86, riscv64 - Dockerfile 13: loongarch64 Alpine builds don't use fontconfig (skia_use_fontconfig=false) so they're excluded.
5e331c4 to
ef22ab9
Compare
The verifyIncluded=fontconfig should only apply to the regular build, not to the 'nodeps' build which uses skia_use_fontconfig=false. Moving it to the builds level ensures: - Regular builds: verify fontconfig IS included - Nodeps builds: verify fontconfig is NOT included (existing behavior)
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.
Summary
This PR fixes the hard crash on Linux ARM64 (issue #3369) by adding the fontconfig runtime library to ALL cross-compile Docker sysroots.
Root Cause Analysis
The ARM64 cross-compile Docker was only downloading
libfontconfig1-devwhich provides:The actual shared library (
libfontconfig.so.1.12.0) is in the runtime package (libfontconfig1), not the dev package.Why the build succeeded but runtime failed
-lfontconfigin the link commandlibfontconfig.sosymlink, but it points to a non-existent filelibSkiaSharp.sois missinglibfontconfig.so.1from itsDT_NEEDEDentriesuuid_generate_random()which requires libuuidundefined symbol: uuid_generate_randomComparison: x64 vs ARM64 before fix
x64 (native build) - has fontconfig:
ARM64 (cross-compile) - missing fontconfig:
ARM64 after fix
The Fix
Download both packages when setting up the cross-compile sysroot:
libfontconfig1-dev- headers and static librarylibfontconfig1- actual shared libraryFiles changed:
scripts/Docker/debian/clang-cross/10/Dockerfile(arm, arm64, x86, riscv64)scripts/Docker/debian/clang-cross/11/Dockerfile(same fix for consistency)scripts/Docker/debian/clang-cross/12/Dockerfile(same fix for consistency)scripts/Docker/debian/clang-cross/13/Dockerfile(loongarch64)Testing
✅ Built ARM64 with fix - fontconfig now appears in DT_NEEDED
✅ Tested font operations (SKTypeface.FromFamilyName, DrawText) on ARM64 Docker
✅ No more
undefined symbol: uuid_generate_randomcrashRelated Issues
This fix also resolves:
Fixes #3369
Fixes #3272
Fixes #3436