Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DNM: Switch Matter samples to picolibc #554

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions config/nrfconnect/chip-module/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,10 @@ else()
set(DATA_MODEL_INTERFACE "disabled")
endif()

# Force libstdc++_nano

set_linker_property(PROPERTY c++_library "-lstdc++_nano")

# ==============================================================================
# Generate configuration for CHIP GN build system
# ==============================================================================
Expand Down
5 changes: 4 additions & 1 deletion config/nrfconnect/chip-module/Kconfig.defaults
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,12 @@ if CHIP
# ==============================================================================

choice LIBC_IMPLEMENTATION
default NEWLIB_LIBC
default PICOLIBC
endchoice

config NEWLIB_LIBC_NANO
default n

config ASSERT
default y

Expand Down
1 change: 0 additions & 1 deletion config/zephyr/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ menuconfig CHIP
select CPP
imply REQUIRES_FULL_LIBCPP
imply REQUIRES_FULL_LIBC
imply NEWLIB_LIBC_NANO
imply CBPRINTF_LIBC_SUBSTS
imply POSIX_API if !ARCH_POSIX && !CHIP_NRF_PLATFORM
imply EVENTFD if !ARCH_POSIX
Expand Down
2 changes: 2 additions & 0 deletions src/platform/Zephyr/SysHeapMalloc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ EXTERNALLY_VISIBLE void * WRAP(calloc)(size_t num, size_t size) ALIAS("_ZN4chip1
EXTERNALLY_VISIBLE void * WRAP(realloc)(void * mem, size_t size) ALIAS("_ZN4chip11DeviceLayer6Malloc7ReallocEPvj");
EXTERNALLY_VISIBLE void WRAP(free)(void * mem) ALIAS("_ZN4chip11DeviceLayer6Malloc4FreeEPv");

#ifdef CONFIG_NEWLIB_LIBC
EXTERNALLY_VISIBLE void * WRAP(_malloc_r)(_reent *, size_t size)
{
return WRAP(malloc)(size);
Expand All @@ -203,6 +204,7 @@ EXTERNALLY_VISIBLE void WRAP(_free_r)(_reent *, void * mem)
{
WRAP(free)(mem);
}
#endif // CONFIG_NEWLIB_LIBC

} // extern "C"

Expand Down
Loading