Skip to content

fix: ARM64 Support #421

@MatthewJones517

Description

@MatthewJones517

Description
Hi! First off, thanks for flutter_soloud! it's a great package and I've been using it successfully on mobile and desktop.

I ran into a couple of issues when building for Linux on ARM64 (Raspberry Pi 4/5 with 64-bit OS, using flutter-pi as the embedder). Wanted to flag them in case you'd consider fixing them upstream:

1. x86-specific compiler flags in linux/CMakeLists.txt

This line passes -msse2 and -msse3, which don't exist on ARM and cause the build to fail immediately:

target_compile_options("${PLUGIN_NAME}" PRIVATE -Wall -Wno-error -Wno-vla -O2 -msse3 -msse2)

A simple fix would be wrapping them in an architecture check:

if(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64|AMD64|i686")
  target_compile_options("${PLUGIN_NAME}" PRIVATE -Wall -Wno-error -Wno-vla -O2 -msse3 -msse2)
else()
  target_compile_options("${PLUGIN_NAME}" PRIVATE -Wall -Wno-error -Wno-vla -O2)
endif()

2. Prebuilt libraries in linux/libs/ are x86_64 only

The bundled .so files for FLAC, Ogg, Opus, and Vorbis are compiled for x86_64, which causes a linker error on ARM64 ("file in wrong format").

The workaround is either enabling NO_OPUS_OGG_LIBS or manually replacing them with ARM64 system versions, but it would be great if the build could fall back to system installed libraries when the bundled ones don't match the target architecture, or if ARM64 variants were included.

Thanks again for maintaining this package!

Steps To Reproduce

Build a Flutter project using flutter_soloud for an arm_64 based device. Specifically, the Raspnerry Pi 5.

Expected Behavior

I would expect this to behave the same way as it does on x86 projects.

Additional Context

Specifically, I run into this problem when I build projects for the Pi. I've been hand editing the CMakeLists.txt myself and recompiling the libraries.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions