Skip to content

Commit

Permalink
libc/picolibc: Remove the global definition of _POSIX_C_SOURCE
Browse files Browse the repository at this point in the history
This was necessary to get Picolibc to expose the whole Zephyr C library
API, but current versions of the SDK use a version of Picolibc with
built-in Zephyr support.

Signed-off-by: Keith Packard <keithp@keithp.com>
  • Loading branch information
keith-packard committed Dec 28, 2023
1 parent 87d056b commit 2f2a0c8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/libc/picolibc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@ zephyr_compile_definitions(__LINUX_ERRNO_EXTENSIONS__)

if(NOT CONFIG_PICOLIBC_USE_MODULE)

# Use picolibc provided with the toolchain
# Use picolibc provided with the toolchain. This requires a new enough
# toolchain so that the version of picolibc supports auto-detecting a
# Zephyr build (via the __ZEPHYR__ macro) to expose the Zephyr C API

zephyr_compile_options(--specs=picolibc.specs)
zephyr_compile_definitions(_POSIX_C_SOURCE=200809)
zephyr_libc_link_libraries(--specs=picolibc.specs c -lgcc)
if(CONFIG_PICOLIBC_IO_FLOAT)
zephyr_compile_definitions(PICOLIBC_DOUBLE_PRINTF_SCANF)
Expand Down

0 comments on commit 2f2a0c8

Please sign in to comment.