mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-10 04:43:33 +00:00
feat(newlib): Implement getentropy() function
Closes https://github.com/espressif/esp-idf/issues/11963
This commit is contained in:
@@ -53,15 +53,18 @@ target_link_libraries(${COMPONENT_LIB} INTERFACE "-u __cxa_guard_dummy")
|
||||
# Furthermore, force libcxx to appear later than libgcc because some libgcc unwind code is wrapped, if C++
|
||||
# exceptions are disabled. libcxx (this component) provides the unwind code wrappers.
|
||||
# This is to prevent linking of libgcc's unwind code which considerably increases the binary size.
|
||||
# Also force libnewlib to appear later than libstdc++ in link line since libstdc++ depends on
|
||||
# some functions in libnewlib, e.g. getentropy().
|
||||
idf_component_get_property(pthread pthread COMPONENT_LIB)
|
||||
idf_component_get_property(newlib newlib COMPONENT_LIB)
|
||||
idf_component_get_property(cxx cxx COMPONENT_LIB)
|
||||
add_library(stdcpp_pthread INTERFACE)
|
||||
add_library(stdcpp_deps INTERFACE)
|
||||
if(CMAKE_C_COMPILER_ID MATCHES "Clang")
|
||||
target_link_libraries(stdcpp_pthread INTERFACE stdc++ c $<TARGET_FILE:${pthread}>)
|
||||
target_link_libraries(stdcpp_deps INTERFACE stdc++ c $<TARGET_FILE:${pthread}> $<TARGET_FILE:${newlib}>)
|
||||
else()
|
||||
target_link_libraries(stdcpp_pthread INTERFACE stdc++ $<TARGET_FILE:${pthread}>)
|
||||
target_link_libraries(stdcpp_deps INTERFACE stdc++ $<TARGET_FILE:${pthread}> $<TARGET_FILE:${newlib}>)
|
||||
endif()
|
||||
target_link_libraries(${COMPONENT_LIB} PUBLIC stdcpp_pthread)
|
||||
target_link_libraries(${COMPONENT_LIB} PUBLIC stdcpp_deps)
|
||||
add_library(libgcc_cxx INTERFACE)
|
||||
target_link_libraries(libgcc_cxx INTERFACE ${CONFIG_COMPILER_RT_LIB_NAME} $<TARGET_FILE:${cxx}>)
|
||||
target_link_libraries(${COMPONENT_LIB} PUBLIC libgcc_cxx)
|
||||
|
Reference in New Issue
Block a user