Skip to content
This repository was archived by the owner on Aug 27, 2025. It is now read-only.

Commit c8270ce

Browse files
committed
interface/vcos/pthreads/CMakeLists.txt: fix build with libexecinfo
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 <[email protected]>
1 parent 8fa944c commit c8270ce

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

interface/vcos/pthreads/CMakeLists.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,14 @@ set (SOURCES
3333
../generic/vcos_generic_blockpool.c
3434
)
3535

36+
find_library (EXECINFO_LIBRARY execinfo)
37+
3638
if (VCOS_PTHREADS_BUILD_SHARED)
3739
add_library (vcos SHARED ${SOURCES})
38-
target_link_libraries (vcos pthread dl rt)
40+
target_link_libraries (vcos pthread dl rt $<$<BOOL:${EXECINFO_LIBRARY}>:${EXECINFO_LIBRARY}>)
3941
else ()
4042
add_library (vcos ${SOURCES})
41-
target_link_libraries (vcos pthread rt)
43+
target_link_libraries (vcos pthread rt $<$<BOOL:${EXECINFO_LIBRARY}>:${EXECINFO_LIBRARY}>)
4244
endif ()
4345

4446

0 commit comments

Comments
 (0)