0006-interface-vcos-pthreads-CMakeLists.txt-fix-build-wit.patch 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. From c8270cea98bcce0d22ddc8e2f86eae2c9989efd4 Mon Sep 17 00:00:00 2001
  2. From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  3. Date: Fri, 25 Feb 2022 19:21:06 +0100
  4. Subject: [PATCH] interface/vcos/pthreads/CMakeLists.txt: fix build with
  5. libexecinfo
  6. interface/vcos/glibc/vcos_backtrace.c uses execinfo.h which can be
  7. provided by libexecinfo on uclibc or musl so link with it if needed to
  8. avoid the following build failure:
  9. /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'
  10. Fixes:
  11. - http://autobuild.buildroot.org/results/93d3b8cc2ac5dfa9d4b44946c0b4d8171e8f52a1
  12. Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  13. [Upstream status: https://github.com/raspberrypi/userland/pull/719]
  14. ---
  15. interface/vcos/pthreads/CMakeLists.txt | 6 ++++--
  16. 1 file changed, 4 insertions(+), 2 deletions(-)
  17. diff --git a/interface/vcos/pthreads/CMakeLists.txt b/interface/vcos/pthreads/CMakeLists.txt
  18. index 1d81ca3..100207f 100644
  19. --- a/interface/vcos/pthreads/CMakeLists.txt
  20. +++ b/interface/vcos/pthreads/CMakeLists.txt
  21. @@ -33,12 +33,14 @@ set (SOURCES
  22. ../generic/vcos_generic_blockpool.c
  23. )
  24. +find_library (EXECINFO_LIBRARY execinfo)
  25. +
  26. if (VCOS_PTHREADS_BUILD_SHARED)
  27. add_library (vcos SHARED ${SOURCES})
  28. - target_link_libraries (vcos pthread dl rt)
  29. + target_link_libraries (vcos pthread dl rt $<$<BOOL:${EXECINFO_LIBRARY}>:${EXECINFO_LIBRARY}>)
  30. else ()
  31. add_library (vcos ${SOURCES})
  32. - target_link_libraries (vcos pthread rt)
  33. + target_link_libraries (vcos pthread rt $<$<BOOL:${EXECINFO_LIBRARY}>:${EXECINFO_LIBRARY}>)
  34. endif ()
  35. --
  36. 2.35.1