v3.3.0-preview2 - #define PAGE_SIZE redefined

Working with the new v3.3.0-preview2, I have found an issue. You may already be aware, but here it is.

Issue

/workspace/zephyr/drivers/flash/soc_flash_nrf_rram.c:51: warning: "PAGE_SIZE" redefined
   51 | #define PAGE_SIZE  DT_PROP(RRAM, erase_block_size)
      | 
In file included from /workspace/zephyr/lib/libc/newlib/include/limits.h:12,
                 from /workspace/zephyr/include/zephyr/kernel_includes.h:22,
                 from /workspace/zephyr/include/zephyr/kernel.h:17,
                 from /workspace/zephyr/drivers/flash/soc_flash_nrf_rram.c:10:
/workspace/zephyr/include/zephyr/posix/posix_limits.h:94: note: this is the location of the previous definition
   94 | #define PAGE_SIZE                     CONFIG_POSIX_PAGE_SIZE
      | 

Steps to reproduce

Add these kconfig settings

CONFIG_FLASH=y
CONFIG_POSIX_SYSTEM_INTERFACES=y
CONFIG_NEWLIB_LIBC=y
Environment
SDK: v3.3.0-preview2
Board: nrf54lm20dkA & nrf54lm20dkB
Parents
  • Replacing CONFIG_NEWLIB_LIBC with CONFIG_PICOLIBC causes lots of issues with CONFIG_POSIX_* settings.

    /workspace/zephyr/include/zephyr/posix/sys/sysconf.h:182:41: error: '_POSIX_RE_DUP_MAX' undeclared (first use in this function); did you mean '_SC_RE_DUP_MAX'?
      182 | #define __z_posix_sysconf_SC_RE_DUP_MAX _POSIX_RE_DUP_MAX
      
    /workspace/zephyr/include/zephyr/posix/sys/sysconf.h:197:46: error: '_POSIX_SS_REPL_MAX' undeclared (first use in this function); did you mean '_SC_SS_REPL_MAX'?
      197 | #define __z_posix_sysconf_SC_SS_REPL_MAX     _POSIX_SS_REPL_MAX
    
    /workspace/zephyr/include/zephyr/posix/sys/sysconf.h:224:59: error: '_POSIX_TRACE_NAME_MAX' undeclared (first use in this function); did you mean '_SC_TRACE_NAME_MAX'?
      224 | #define __z_posix_sysconf_SC_TRACE_EVENT_NAME_MAX         _POSIX_TRACE_NAME_MAX
    
    etc
    

    Something to do with NEWLIB_LIBC_USE_POSIX_LIMITS_H, sysconf.h and limits.h vs posix_limits.h.
    Not sure how any of it works.

    Thanks

Reply
  • Replacing CONFIG_NEWLIB_LIBC with CONFIG_PICOLIBC causes lots of issues with CONFIG_POSIX_* settings.

    /workspace/zephyr/include/zephyr/posix/sys/sysconf.h:182:41: error: '_POSIX_RE_DUP_MAX' undeclared (first use in this function); did you mean '_SC_RE_DUP_MAX'?
      182 | #define __z_posix_sysconf_SC_RE_DUP_MAX _POSIX_RE_DUP_MAX
      
    /workspace/zephyr/include/zephyr/posix/sys/sysconf.h:197:46: error: '_POSIX_SS_REPL_MAX' undeclared (first use in this function); did you mean '_SC_SS_REPL_MAX'?
      197 | #define __z_posix_sysconf_SC_SS_REPL_MAX     _POSIX_SS_REPL_MAX
    
    /workspace/zephyr/include/zephyr/posix/sys/sysconf.h:224:59: error: '_POSIX_TRACE_NAME_MAX' undeclared (first use in this function); did you mean '_SC_TRACE_NAME_MAX'?
      224 | #define __z_posix_sysconf_SC_TRACE_EVENT_NAME_MAX         _POSIX_TRACE_NAME_MAX
    
    etc
    

    Something to do with NEWLIB_LIBC_USE_POSIX_LIMITS_H, sysconf.h and limits.h vs posix_limits.h.
    Not sure how any of it works.

    Thanks

Children
Related