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.

(cherry picked from commit 9dcbfa8)

Original-Signed-off-by: Keith Packard <keithp@keithp.com>
GitOrigin-RevId: 9dcbfa8
Change-Id: I0bc1fb2d2faab3bd4b9fdf8c97c317f8f0a1ed63
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/zephyr/+/5242634
Commit-Queue: Al Semjonovs <asemjonovs@google.com>
Tested-by: ChromeOS Prod (Robot) <chromeos-ci-prod@chromeos-bot.iam.gserviceaccount.com>
Reviewed-by: Al Semjonovs <asemjonovs@google.com>
Tested-by: Al Semjonovs <asemjonovs@google.com>
Reviewed-by: Tristan Honscheid <honscheid@google.com>
Tested-by: Tristan Honscheid <honscheid@google.com>
  • Loading branch information
keith-packard authored and Chromeos LUCI committed Feb 6, 2024
1 parent c20cf31 commit 03fbcd8
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 03fbcd8

Please sign in to comment.