You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using c++ and the gthread library has a dependency on pthread_cond_xxx. I found that with gcc 8.2 I had to apply the following bit of trickery (copied from newlib) to be able to link (along with corresponding stub functions in the source files, of course):
The text was updated successfully, but these errors were encountered:
github-actionsbot
changed the title
pthread component needs "newlib_include_locks_impl" type treatment for gcc 8
pthread component needs "newlib_include_locks_impl" type treatment for gcc 8 (IDFGH-1437)
Jun 29, 2019
Force linking pthread implementation from IDF, instead of the weak
functions provided by gthread library. Previously this would either
work or not depending on the linking order.
Thanks @bpietsch for suggesting the fix.
Closesespressif#3709
I'm using c++ and the gthread library has a dependency on pthread_cond_xxx. I found that with gcc 8.2 I had to apply the following bit of trickery (copied from newlib) to be able to link (along with corresponding stub functions in the source files, of course):
if(GCC_NOT_5_2_0)
set(EXTRA_LINK_FLAGS "-u pthread_include_pthread_impl")
list(APPEND EXTRA_LINK_FLAGS "-u pthread_include_pthread_cond_impl")
list(APPEND EXTRA_LINK_FLAGS "-u pthread_include_pthread_local_storage_impl")
endif()
idf_component_register(SRCS "pthread.c"
"pthread_cond_var.c"
"pthread_local_storage.c"
INCLUDE_DIRS include)
if(CONFIG_FREERTOS_ENABLE_STATIC_TASK_CLEAN_UP)
target_link_libraries(${COMPONENT_LIB} "-Wl,--wrap=vPortCleanUpTCB")
endif()
if(EXTRA_LINK_FLAGS)
target_link_libraries(${COMPONENT_LIB} INTERFACE "${EXTRA_LINK_FLAGS}")
endif()
The text was updated successfully, but these errors were encountered: