Skip to content

Commit

Permalink
interface/vcos/pthreads/CMakeLists.txt: fix build with libexecinfo
Browse files Browse the repository at this point in the history
interface/vcos/glibc/vcos_backtrace.c uses execinfo.h which can be
provided by libexecinfo on uclibc or musl so link with it if needed to
avoid the following build failure:

/home/peko/autobuild/instance-1/output-1/host/opt/ext-toolchain/bin/../lib/gcc/arm-buildroot-linux-uclibcgnueabi/10.3.0/../../../../arm-buildroot-linux-uclibcgnueabi/bin/ld: ../../build/lib/libvcos.so: undefined reference to `backtrace_symbols'

Fixes:
 - http://autobuild.buildroot.org/results/93d3b8cc2ac5dfa9d4b44946c0b4d8171e8f52a1

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  • Loading branch information
ffontaine committed Jun 21, 2022
1 parent 8fa944c commit c8270ce
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions interface/vcos/pthreads/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,14 @@ set (SOURCES
../generic/vcos_generic_blockpool.c
)

find_library (EXECINFO_LIBRARY execinfo)

if (VCOS_PTHREADS_BUILD_SHARED)
add_library (vcos SHARED ${SOURCES})
target_link_libraries (vcos pthread dl rt)
target_link_libraries (vcos pthread dl rt $<$<BOOL:${EXECINFO_LIBRARY}>:${EXECINFO_LIBRARY}>)
else ()
add_library (vcos ${SOURCES})
target_link_libraries (vcos pthread rt)
target_link_libraries (vcos pthread rt $<$<BOOL:${EXECINFO_LIBRARY}>:${EXECINFO_LIBRARY}>)
endif ()


Expand Down

0 comments on commit c8270ce

Please sign in to comment.