Skip to content

Commit

Permalink
libc/newlib: Add -D_POSIX_C_SOURCE=200809L to zephyr compile definitions
Browse files Browse the repository at this point in the history
Newlib doesn't have Zephyr support, so the only way to get it to expose the
full Zephyr C library API is to have it expose all of the POSIX API.

Signed-off-by: Keith Packard <keithp@keithp.com>
  • Loading branch information
keith-packard committed Dec 29, 2023
1 parent ae7567c commit 7411af2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/libc/newlib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
endif()
zephyr_link_libraries(c)

# newlib needs this to expose the full Zephyr C Library API
zephyr_compile_definitions(_POSIX_C_SOURCE=200809L)

if(CONFIG_NEWLIB_LIBC_NANO)
zephyr_link_libraries(
-specs=nano.specs
Expand Down

0 comments on commit 7411af2

Please sign in to comment.