Skip to content

Unable to build LVGL with picolibc from source/module #93986

@aescolar

Description

@aescolar

Describe the bug

When attempting to build LVGL with the Picolibc source module things fail to compile badly.

Regression

  • This is a regression.

Steps to reproduce

  1. mkdir build && cd build
  2. cmake -GNinja -DBOARD=native_sim ../samples/modules/lvgl/demos/ -DCONFIG_PICOLIBC=y
  3. ninja
  4. see errors

Relevant log output

In file included from zephyr/build/modules/picolibc/picolibc/include/ssp/string.h:35,
                 from zephyr/build/modules/picolibc/picolibc/include/string.h:240,
                 from zephyr/modules/lvgl/include/lv_conf.h:12,
                 from modules/lib/gui/lvgl/demos/music/assets/../../../src/lv_conf_internal.h:56,
                 from modules/lib/gui/lvgl/demos/music/assets/../../../src/lv_init.h:16,
                 from modules/lib/gui/lvgl/demos/music/assets/../../../lvgl.h:21,
                 from modules/lib/gui/lvgl/demos/music/assets/../../lv_demos.h:16,
                 from modules/lib/gui/lvgl/demos/music/assets/../lv_demo_music.h:16,
                 from modules/lib/gui/lvgl/demos/music/assets/img_lv_demo_music_cover_3.c:1:
zephyr/modules/lvgl/include/lv_conf.h:41:35: error: expected declaration specifiers or ‘...’ before numeric constant
   41 | #define lv_memcpy                 memcpy
      |                                   ^~~~~~
modules/lib/gui/lvgl/demos/music/assets/../../../src/stdlib/lv_string.h:39:8: note: in expansion of macro ‘lv_memcpy’
   39 | void * lv_memcpy(void * dst, const void * src, size_t len);
      |        ^~~~~~~~~
zephyr/modules/lvgl/include/lv_conf.h:41:35: error: expected ‘)’ before ‘!=’ token
   41 | #define lv_memcpy                 memcpy
      |                                   ^~~~~~
modules/lib/gui/lvgl/demos/music/assets/../../../src/stdlib/lv_string.h:39:8: note: in expansion of macro ‘lv_memcpy’
   39 | void * lv_memcpy(void * dst, const void * src, size_t len);
      |        ^~~~~~~~~

(between many others)

Impact

Annoyance – Minor irritation; no significant impact on usability or functionality.

Environment

  • Linux Ubuntu 24.04
  • host gcc 14.2
  • zephyr version main as of now: 52bf8fb

Additional Context

Related to

Note the picolibc source module and the one prebuilt with the SDK are not the same picolibc version in general

Note this was worsened by 47c4e3d, but it was failing before, since before v4.1.0, similarly on snprintf and vsnprintf:

In file included from build/modules/picolibc/picolibc/include/stdio.h:573,
                 from include/zephyr/sys/printk.h:65,
                 from include/zephyr/kernel_includes.h:35,
                 from include/zephyr/kernel.h:17,
                 from samples/modules/lvgl/demos/src/main.c:7:
modules/lvgl/include/lv_conf.h:30:35: error: expected declaration specifiers or ‘...’ before numeric constant
   30 | #define lv_snprintf               snprintf
      |                                   ^~~~~~~~
/scratch/zephyrproject/modules/lib/gui/lvgl/src/../src/stdlib/lv_sprintf.h:52:5: note: in expansion of macro ‘lv_snprintf’
   52 | int lv_snprintf(char * buffer, size_t count, const char * format, ...);
      |     ^~~~~~~~~~~
In file included from build/modules/picolibc/picolibc/include/ssp/string.h:35,
                 from build/modules/picolibc/picolibc/include/string.h:240,
                 from include/zephyr/sys/util.h:31,
                 from include/zephyr/sys/atomic.h:18,
                 from include/zephyr/kernel_includes.h:25:
modules/lvgl/include/lv_conf.h:30:35: error: expected declaration specifiers or ‘...’ before ‘__builtin_dynamic_object_size’
   30 | #define lv_snprintf               snprintf
      |                                   ^~~~~~~~
/scratch/zephyrproject/modules/lib/gui/lvgl/src/../src/stdlib/lv_sprintf.h:52:5: note: in expansion of macro ‘lv_snprintf’
   52 | int lv_snprintf(char * buffer, size_t count, const char * format, ...);
      |     ^~~~~~~~~~~
modules/lvgl/include/lv_conf.h:31:35: error: expected declaration specifiers or ‘...’ before numeric constant
   31 | #define lv_vsnprintf              vsnprintf
      |                                   ^~~~~~~~~
/scratch/zephyrproject/modules/lib/gui/lvgl/src/../src/stdlib/lv_sprintf.h:54:5: note: in expansion of macro ‘lv_vsnprintf’
   54 | int lv_vsnprintf(char * buffer, size_t count, const char * format, va_list va);
      |     ^~~~~~~~~~~~
modules/lvgl/include/lv_conf.h:31:35: error: expected declaration specifiers or ‘...’ before ‘__builtin_dynamic_object_size’
   31 | #define lv_vsnprintf              vsnprintf
      |                                   ^~~~~~~~~
/scratch/zephyrproject/modules/lib/gui/lvgl/src/../src/stdlib/lv_sprintf.h:54:5: note: in expansion of macro ‘lv_vsnprintf’
   54 | int lv_vsnprintf(char * buffer, size_t count, const char * format, va_list va);
      |     ^~~~~~~~~~~~

Neither of this issues were present on the 4.0 release

Metadata

Metadata

Assignees

Labels

area: LVGLLight and Versatile Graphics Library Supportarea: picolibcPicolibc C Standard LibrarybugThe issue is a bug, or the PR is fixing a bugpriority: mediumMedium impact/importance bug

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions