Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sdl2: build without libunwind #43

Merged
merged 1 commit into from
Dec 7, 2024

Conversation

dangowrt
Copy link
Member

@dangowrt dangowrt commented Dec 6, 2024

SDL2 links tests against libunwind if libunwind is detected by CMake. This results in build failure due to undefined symbols. Prevent building with libunwind for now.

SDL2 links tests against libunwind if libunwind is detected by CMake.
This results in build failure due to undefined symbols.
Prevent building with libunwind for now.

Signed-off-by: Daniel Golle <[email protected]>
@Ansuel
Copy link
Member

Ansuel commented Dec 6, 2024

@dangowrt should we disable test instead? Test are run on host machine right?

@dangowrt
Copy link
Member Author

dangowrt commented Dec 6, 2024

Test are run on host machine right?

No, tests are built for the target system and are installable as libsdl2-tests package. The installed executables can be used e.g. to verify that audio, video or input drivers are working fine on the target, some are also useful as benchmark.

@Ansuel
Copy link
Member

Ansuel commented Dec 6, 2024

Ok so problem is that they are linking to the wrong library? aka host library are leaking? Just trying to understand the compile error without having to build the monster ahahah

@dangowrt
Copy link
Member Author

dangowrt commented Dec 6, 2024

Looks like src/test/SDL_test_memory.c uses symbols defined in libunwind.h but not actually present without linking with -lunwind, which is probably due to SDL2 use of the CMake build system. After all, this leads to linker error:

/builder/shared-workdir/build/sdk/staging_dir/toolchain-aarch64_cortex-a53_gcc-13.3.0_musl/bin/../lib/gcc/aarch64-openwrt-linux-musl/13.3.0/../../../../aarch64-openwrt-linux-musl/bin/ld.bfd: libSDL2_test.a(SDL_test_memory.c.o): in function `ret173':
SDL_test_memory.c:(.text+0x1a0): undefined reference to `_ULaarch64_init_local'
/builder/shared-workdir/build/sdk/staging_dir/toolchain-aarch64_cortex-a53_gcc-13.3.0_musl/bin/../lib/gcc/aarch64-openwrt-linux-musl/13.3.0/../../../../aarch64-openwrt-linux-musl/bin/ld.bfd: SDL_test_memory.c:(.text+0x1a8): undefined reference to `_ULaarch64_step'
/builder/shared-workdir/build/sdk/staging_dir/toolchain-aarch64_cortex-a53_gcc-13.3.0_musl/bin/../lib/gcc/aarch64-openwrt-linux-musl/13.3.0/../../../../aarch64-openwrt-linux-musl/bin/ld.bfd: SDL_test_memory.c:(.text+0x1c0): undefined reference to `_ULaarch64_get_reg'
/builder/shared-workdir/build/sdk/staging_dir/toolchain-aarch64_cortex-a53_gcc-13.3.0_musl/bin/../lib/gcc/aarch64-openwrt-linux-musl/13.3.0/../../../../aarch64-openwrt-linux-musl/bin/ld.bfd: SDL_test_memory.c:(.text+0x1dc): undefined reference to `_ULaarch64_get_proc_name'

See https://downloads.openwrt.org/snapshots/faillogs/aarch64_cortex-a53/video/sdl2/compile.txt

As libunwind is only used for one test, and even there only provides optional additional information, the easiest way is to just build without libunwind even if it is present in staging_dir/hostpkg.

@dangowrt
Copy link
Member Author

dangowrt commented Dec 7, 2024

Sadly Github CI is not very useful for those larger build jobs. Only the logs of the successful builds are part of the log archive and trying to view "raw logs" of the failed builds ends up truncated, so it's impossible to tell why it failed. Buildbots are going to tell once merged (if at all failing on the buildbots)...

@dangowrt dangowrt merged commit b4ae113 into openwrt:master Dec 7, 2024
7 of 11 checks passed
@dangowrt dangowrt deleted the sdl2-no-libunwind branch December 7, 2024 00:51
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