hrydgard / ppsspp

A PSP emulator for Android, Windows, Mac and Linux, written in C++. Want to contribute? Join us on Discord at https://discord.gg/5NJB6dD or just send pull requests / issues. For discussion use the forums at forums.ppsspp.org.
https://www.ppsspp.org
Other
10.81k stars 2.12k forks source link

building attempts to link to the incorrect architecture of bundled ffmpeg #18673

Open theofficialgman opened 6 months ago

theofficialgman commented 6 months ago

Platform

Linux / BSD

Compiler and build tool versions

GCC 12.2 + CMAKE 3.25 (Bookworm)

Operating system version

Debian Bookworm ARM32

Build commands used

#!/bin/bash

version=v1.16.6

# remove deprecated files
rm -f ~/.local/share/applications/ppsspp.desktop ~/ppsspp

cd /tmp || error "Could not move to /tmp folder"
install_packages build-essential cmake libgl1-mesa-dev libglew-dev libsdl2-dev libsdl2-ttf-dev libvulkan-dev libfontconfig1-dev qt5-qmake \
  qtmultimedia5-dev qttools5-dev-tools libqt5opengl5-dev libcurl4-openssl-dev qtmultimedia5-dev libavcodec-dev \
  libavdevice-dev libavfilter-dev libavformat-dev libavutil-dev libpostproc-dev libswresample-dev libswscale-dev || exit 1
rm -rf ppsspp
git clone https://github.com/hrydgard/ppsspp.git --recurse-submodules --shallow-submodules --depth=1 -b "$version" || error "Failed to clone the repo"
cd ppsspp || error "Could not move to ppsspp folder"
mkdir build || error "Could not make build folder"
cd build || error "Could not move to build folder"
# vulkan does not work for some systems in SDL backend on Linux https://github.com/hrydgard/ppsspp/pull/13054
# vulkan does not work at all in QT backend on Linux https://github.com/hrydgard/ppsspp/issues/11628
# QT backend does not work with wayland https://github.com/hrydgard/ppsspp/issues/16254
# GL cannot be used on QT backend on ARM32 due to QT5 being built with GLES and not GL on ARM32
# SDL is not guaranteed to have Wayland support builtin, so check for the headers before enabling it
# changing to vulkan in the UI does nothing and OpenGL continues to be used
# enabling it causes no compilation issues and it can not be fully disabled (always shows in the UI) so keep it enabled
# disable system FFMPEG as recommended by upstream (can be incompatible with some custom HW decoders and newew FFMPEG versions)
# bundled FFMPEG requires minimum GLIBC 2.28 and is available for armv7l and armv8
cmake .. -DUSING_QT_UI=OFF -DUSE_SYSTEM_FFMPEG=OFF -DUSE_WAYLAND_WSI=ON || error "cmake failed to configure the build"
make -j$(nproc) || error "Could not build ppsspp"
sudo make install || error "Could not install ppsspp"
# update timestamp of top level icon directory to signal icon cache to be refreshed
sudo touch /usr/local/share/icons/hicolor

What happens

at the end of build during linking

/usr/bin/ld: /home/gman/ppsspp/ffmpeg/linux/aarch64/lib/libavformat.a: error adding symbols: file format not recognized

this is generally due to poor scripting where you check for the linux kernel architecture and not the actual system userspace architecture. this system is running an ARM32 userspace with and ARM64 kernel (very common). The scripting should be attempting to link to the armv7l libraries

PPSSPP version affected

v1.16.6

Last working version

No response

Checklist

theofficialgman commented 6 months ago

I suggest adding something along the lines of what dolphin added to fallback to armv7l builds when kernel architecture is aarch64 and the compiler architecture is armv7l https://github.com/dolphin-emu/dolphin/blob/4e57b66dcf3cb6a9a740f639802dec442fd5dd43/CMakeLists.txt#L205-L241

hrydgard commented 6 months ago

pull requests accepted. I don't have a system with your configuration so don't feel confident to try to get such a setup up and running with no local testing.