Skip to content

pkg/lvgl: Fix configuration header and compilation issue#22005

Merged
crasbe merged 2 commits intoRIOT-OS:masterfrom
leandrolanzieri:pr/pkg/lvgl/fix_conf_header
Jan 21, 2026
Merged

pkg/lvgl: Fix configuration header and compilation issue#22005
crasbe merged 2 commits intoRIOT-OS:masterfrom
leandrolanzieri:pr/pkg/lvgl/fix_conf_header

Conversation

@leandrolanzieri
Copy link
Contributor

Contribution description

This fixes two issues with the lvgl package that showed during testing for 2026.01.

First, #21701 modified the guards of lv_conf.h to use #pragma. The issue is that the LVGL package checks for the macro to ensure that the configuration has been loaded. The check is here: https://github.com/lvgl/lvgl/blob/9ec3b8706b098f60940cee6ac211d3cb3141aedf/src/lv_conf_internal.h#L30-L48

Without the define, we get several warnings:

In file included from �[01m�[K/data/riotbuild/riotbase/build/pkg/lvgl/src/core/../hal/../draw/lv_draw.h:16�[m�[K,
                 from �[01m�[K/data/riotbuild/riotbase/build/pkg/lvgl/src/core/../hal/lv_hal_disp.h:21�[m�[K,
                 from �[01m�[K/data/riotbuild/riotbase/build/pkg/lvgl/src/core/../hal/lv_hal.h:16�[m�[K,
                 from �[01m�[K/data/riotbuild/riotbase/build/pkg/lvgl/src/core/lv_disp.h:16�[m�[K,
                 from �[01m�[K/data/riotbuild/riotbase/build/pkg/lvgl/src/core/lv_disp.c:9�[m�[K:
�[01m�[K/data/riotbuild/riotbase/build/pkg/lvgl/src/core/../hal/../draw/../lv_conf_internal.h:46:17:�[m�[K �[01;36m�[Knote: �[m�[K'�[01m�[K#pragma message: Possible failure to include lv_conf.h, please read the comment in this file if you get errors�[m�[K'
   46 |         #pragma �[01;36m�[Kmessage�[m�[K("Possible failure to include lv_conf.h, please read the comment in this file if you get errors")
      |                 �[01;36m�[K^~~~~~~�[m�[K
In file included from �[01m�[K/data/riotbuild/riotbase/build/pkg/lvgl/src/core/lv_obj.h:16�[m�[K,
                 from �[01m�[K/data/riotbuild/riotbase/build/pkg/lvgl/src/core/lv_event.c:9�[m�[K:
�[01m�[K/data/riotbuild/riotbase/build/pkg/lvgl/src/core/../lv_conf_internal.h:46:17:�[m�[K �[01;36m�[Knote: �[m�[K'�[01m�[K#pragma message: Possible failure to include lv_conf.h, please read the comment in this file if you get errors�[m�[K'
   46 |         #pragma �[01;36m�[Kmessage�[m�[K("Possible failure to include lv_conf.h, please read the comment in this file if you get errors")
      |                 �[01;36m�[K^~~~~~~�[m�[K

This is fixed by re-introducing the macro.

Second, a compilation issue is hitting some platforms. It seems like a change in the gcc optimization is raising a compilation issue on the package:

# on tests/pkg/lvgl

> env BUILD_IN_DOCKER=1 BOARD=samr21-xpro make
Launching build container using image "docker.io/riot/riotbuild@sha256:08fa7da2c702ac4db7cf57c23fc46c1971f3bffc4a6eff129793f853ec808736".
docker run --rm --tty --user $(id -u) --platform linux/amd64 -v '/usr/share/zoneinfo/Europe/Berlin:/etc/localtime:ro' -v '/home/lanzieri/Work/RIOT:/data/riotbuild/riotbase:delegated' -v '/home/lanzieri/.cargo/registry:/data/riotbuild/.cargo/registry:delegated' -v '/home/lanzieri/.cargo/git:/data/riotbuild/.cargo/git:delegated' -e 'RIOTBASE=/data/riotbuild/riotbase' -e 'CCACHE_BASEDIR=/data/riotbuild/riotbase' -e 'BUILD_DIR=/data/riotbuild/riotbase/build' -e 'BUILD_IN_DOCKER=0' -e 'RIOTPROJECT=/data/riotbuild/riotbase' -e 'RIOTCPU=/data/riotbuild/riotbase/cpu' -e 'RIOTBOARD=/data/riotbuild/riotbase/boards' -e 'RIOTMAKE=/data/riotbuild/riotbase/makefiles'      -e 'BOARD=samr21-xpro' -e 'DISABLE_MODULE=test_utils_interactive_sync' -e 'DEFAULT_MODULE=' -e 'FEATURES_REQUIRED=' -e 'FEATURES_BLACKLIST=' -e 'FEATURES_OPTIONAL=' -e 'USEMODULE=lvgl_contrib lvgl_extra_layout_flex lvgl_extra_theme_default lvgl_extra_theme_default_dark lvgl_extra_widget_chart lvgl_extra_widget_win' -e 'USEPKG=lvgl'  -w '/data/riotbuild/riotbase/tests/pkg/lvgl/' 'docker.io/riot/riotbuild@sha256:08fa7da2c702ac4db7cf57c23fc46c1971f3bffc4a6eff129793f853ec808736' make     
Building application "tests_lvgl" for "samr21-xpro" with CPU "samd21".

"make" -C /data/riotbuild/riotbase/pkg/cmsis/ 
"make" -C /data/riotbuild/riotbase/pkg/lvgl/ 
"make" -C /data/riotbuild/riotbase/build/pkg/lvgl/src/core -f /data/riotbuild/riotbase/pkg/lvgl/Makefile.lvgl_module MODULE=lvgl_core
/tmp/ccn3NoUX.s: Assembler messages:
/tmp/ccn3NoUX.s: Error: unaligned opcodes detected in executable segment
make[2]: *** [/data/riotbuild/riotbase/Makefile.base:157: /data/riotbuild/riotbase/tests/pkg/lvgl/bin/samr21-xpro/lvgl_core/lv_event.o] Error 1
make[1]: *** [Makefile:76: lvgl_core] Error 2
make: *** [/data/riotbuild/riotbase/Makefile.include:807: pkg-build] Error 2
make: *** [/home/lanzieri/Work/RIOT/makefiles/docker.inc.mk:395: ..in-docker-container] Error 2

This issue was discussed previously here: earlephilhower/arduino-pico#792. By setting CFLAGS += -fno-jump-tables in the package Makefile the error is fixed.

Testing procedure

Compile the LVGL package test with the docker toolchain (possibly for samr21-xpro). It should succeed.

Issues/PRs references

#21701
RIOT-OS/Release-Specs#330

@leandrolanzieri leandrolanzieri added this to the Release 2026.01 milestone Jan 21, 2026
@leandrolanzieri leandrolanzieri added Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors) Process: needs backport Integration Process: The PR is required to be backported to a release or feature branch labels Jan 21, 2026
@github-actions github-actions bot added the Area: pkg Area: External package ports label Jan 21, 2026
@leandrolanzieri leandrolanzieri added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Jan 21, 2026
@riot-ci
Copy link

riot-ci commented Jan 21, 2026

Murdock results

✔️ PASSED

59dc3c0 pkg/lvgl: prevent jump-tables optimization

Success Failures Total Runtime
11004 0 11004 16m:01s

Artifacts

@crasbe crasbe enabled auto-merge January 21, 2026 10:16
@crasbe crasbe added this pull request to the merge queue Jan 21, 2026
Merged via the queue into RIOT-OS:master with commit f19f660 Jan 21, 2026
29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: pkg Area: External package ports CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Process: needs backport Integration Process: The PR is required to be backported to a release or feature branch Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants