Skip to content

Add Linux LoongArch 64-bit support - #394

Open
cheungxi wants to merge 1 commit into
lovell:mainfrom
cheungxi:main
Open

Add Linux LoongArch 64-bit support#394
cheungxi wants to merge 1 commit into
lovell:mainfrom
cheungxi:main

Conversation

@cheungxi

@cheungxi cheungxi commented Aug 18, 2026

Copy link
Copy Markdown

Summary

Add prebuilt libvips support for Linux LoongArch 64-bit (linux-loong64).

Changes

  • Add an Ubuntu 24.04-based LoongArch cross-compilation environment.
  • Use the Ubuntu GCC 14 LoongArch cross-toolchain.
  • Add CMake and Meson cross-compilation configuration.
  • Configure the Rust loongarch64-unknown-linux-gnu target.
  • Add the @img/sharp-libvips-linux-loong64 npm package.
  • Add linux-loong64 to the build script, CI matrix, npm workspaces and documentation.
  • Enable Highway SIMD support using the LSX baseline with optional LASX runtime dispatch.
  • Declare a minimum glibc version of 2.39, matching the Ubuntu 24.04 build sysroot.

Validation

  • Completed a full linux-loong64 cross-build on an x86_64 Ubuntu host.
  • Successfully built libvips 8.18.5 and all enabled dependencies, including:
    • zlib-ng LoongArch optimisations
    • libffi LoongArch assembly
    • librsvg using the Rust LoongArch target
    • libheif and UltraHDR
  • Verified the resulting library is a LoongArch 64-bit ELF shared object.
  • Verified that only the expected system libraries remain dynamically linked:
    • libstdc++.so.6
    • libm.so.6
    • libgcc_s.so.1
    • libc.so.6
    • ld-linux-loongarch-lp64d.so.1
  • Tested the generated library on a native LoongArch system:
    • vips_init() returned 0
    • vips_version() returned 8.18.5
  • The build-linux-loong64 GitHub Actions job completed successfully and uploaded its
    artifact.

CI validation run:

https://github.com/cheungxi/sharp-libvips/actions/runs/32037607798

@lovell

lovell commented Aug 18, 2026

Copy link
Copy Markdown
Owner

Hello, thank you for the PR.

As you've seen, this repo cross-compiles libvips binaries for various platforms and architectures. However the sharp repo uses QEMU-based emulation via uraimo/run-on-arch-action where native builds are unavailable. This does not currently support LoongArch CPUs so I am unable to merge and support this change at present.

@cheungxi

Copy link
Copy Markdown
Author

Hello, thank you for the PR.

As you've seen, this repo cross-compiles libvips binaries for various platforms and architectures. However the sharp repo uses QEMU-based emulation via uraimo/run-on-arch-action where native builds are unavailable. This does not currently support LoongArch CPUs so I am unable to merge and support this change at present.

Thank you. LoongArch64 support has now been merged and released in
run-on-arch-action v3.2.0:

https://github.com/uraimo/run-on-arch-action/releases/tag/v3.2.0

The action's LoongArch64 CI is passing:

https://github.com/uraimo/run-on-arch-action/actions/runs/32153980328

I will also prepare an end-to-end sharp QEMU build using a glibc
linux/loong64 image. Could you please confirm whether the action release
removes the platform-support blocker for this PR?

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants