Skip to content

Fix libpng LoongArch LSX undefined symbol in native builds#3630

Closed
mattleibow wants to merge 1 commit into
mainfrom
dev/fix-libpng-loongarch-lsx
Closed

Fix libpng LoongArch LSX undefined symbol in native builds#3630
mattleibow wants to merge 1 commit into
mainfrom
dev/fix-libpng-loongarch-lsx

Conversation

@mattleibow

Copy link
Copy Markdown
Collaborator

Problem

When building libSkiaSharp for loongarch64 with -Wl,--no-undefined (from #3629), the linker fails:

undefined reference to `png_init_filter_functions_lsx'

This is a pre-existing latent bug — the loongarch64 cross-compiler defines __loongarch_sx, causing libpng's pngpriv.h to enable PNG_LOONGARCH_LSX_OPT=1 and reference png_init_filter_functions_lsx(). However, the implementation files were never included in Skia's GN build. Previously this was silently tolerated by the linker; the --no-undefined flag correctly surfaces it.

Fix

Updates the skia submodule to include mono/skia#176, which adds the missing LoongArch LSX source files (filter_lsx_intrinsics.c, loongarch_lsx_init.c) to the libpng GN build for current_cpu == "loongarch64".

Related

Points to mono/skia@3f0b580a09 which adds the missing LoongArch LSX
source files to the libpng GN build, fixing undefined symbol errors
when building with -Wl,--no-undefined on loongarch64.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@mattleibow

Copy link
Copy Markdown
Collaborator Author

Closing — folding the submodule update into #3629 instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant