From 5e794a614e4bf6a7d037bdf4d96138a1fc6da8d2 Mon Sep 17 00:00:00 2001 From: Andrea Salvatore Date: Sat, 20 Jun 2026 22:56:36 +0200 Subject: [PATCH] fix(cmake): export LVGL symbols on Linux so dlopen'd apps resolve them On Linux, cardputer-emu whole-archives LVGL but sets ENABLE_EXPORTS only on Apple, so the LVGL symbols stay in .symtab and never reach .dynsym. dlopen of libAPPLaunch.so (and any app plugin) then fails at load with an undefined symbol error (e.g. lv_anim_path_ease_out). Extend ENABLE_EXPORTS to Linux as well (adds -rdynamic) so the whole-archived LVGL symbols land in .dynsym. After the change ~1968 LVGL symbols are exported and the emulator loads libAPPLaunch.so and the app plugins cleanly. Tested on Arch Linux (gcc, ninja): before = dlopen fails; after = emulator starts and loads apps/libAPPLaunch.so and apps/libUserDemo.so without errors. --- CMakeLists.txt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e55e511..4e90262 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -231,8 +231,10 @@ else() src/emu_launcher_stubs.c) endif() add_dependencies(cardputer-emu lvgl lvgl_thorvg) -# Export all symbols so dlopen'd apps can resolve LVGL functions -if(APPLE) +# Export all symbols so dlopen'd apps can resolve LVGL functions. +# On Linux this adds -rdynamic so the whole-archive'd LVGL symbols land in +# .dynsym (otherwise dlopen of libAPPLaunch fails: undefined symbol lv_*). +if(APPLE OR (UNIX AND NOT APPLE)) set_target_properties(cardputer-emu PROPERTIES ENABLE_EXPORTS ON) endif()