Skip to content

fix(cmake): export LVGL symbols on Linux so dlopen'd apps resolve them#5

Open
andreahaku wants to merge 1 commit into
CardputerZero:mainfrom
andreahaku:fix/export-lvgl-symbols-linux
Open

fix(cmake): export LVGL symbols on Linux so dlopen'd apps resolve them#5
andreahaku wants to merge 1 commit into
CardputerZero:mainfrom
andreahaku:fix/export-lvgl-symbols-linux

Conversation

@andreahaku

Copy link
Copy Markdown

On Linux, cardputer-emu whole-archives LVGL but sets ENABLE_EXPORTS only on Apple (if(APPLE)), so the LVGL symbols stay in .symtab and never reach .dynsym. As a result dlopen of libAPPLaunch.so (and any app plugin) fails at load with an undefined symbol error, e.g. undefined symbol: lv_anim_path_ease_out.

This extends ENABLE_EXPORTS to Linux as well (which adds -rdynamic), so the whole-archived LVGL symbols land in .dynsym. After the change about 1968 LVGL symbols are exported and the emulator loads libAPPLaunch.so and the app plugins without errors.

Testing

Arch Linux (gcc, ninja):

  • Before: dlopen of apps/libAPPLaunch.so fails with undefined symbol: lv_*.
  • After: the emulator starts and loads apps/libAPPLaunch.so and apps/libUserDemo.so cleanly.

The change is a no-op on macOS (already covered by the existing if(APPLE)) and on Windows.

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.
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.

1 participant