0006-buildsys-fix-static-configuration-and-building.patch 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. From f69e18629d1c91d83ab91314baf5e34088b57f6e Mon Sep 17 00:00:00 2001
  2. From: Lada Trimasova <ltrimas@synopsys.com>
  3. Date: Wed, 27 Jan 2016 16:26:41 +0300
  4. Subject: [PATCH] buildsys: fix static configuration and building
  5. In case of uClibc librt depends on libpthread. In particular
  6. timer_create() function uses pthread_XXX(). That means in case
  7. of static builds it's required to link not librt alone but
  8. together with libpthread. So if checking timer_create function
  9. in librt fails, it is necessary to check if timer_create function
  10. successfully links with "-lpthread".
  11. That issues was spotted in Buldroot autobuilder failures:
  12. http://autobuild.buildroot.net/results/759/75960db671807091fe9155aee9e46a6245e32590/
  13. http://autobuild.buildroot.org/results/112/112e8b85783f5aaba42a937a6eb064317615a21b/
  14. Signed-off-by: Lada Trimasova <ltrimas@synopsys.com>
  15. ---
  16. configure.ac | 13 +++++++++++--
  17. 1 file changed, 11 insertions(+), 2 deletions(-)
  18. diff --git a/configure.ac b/configure.ac
  19. index 56512c0..9392bf2 100644
  20. --- a/configure.ac
  21. +++ b/configure.ac
  22. @@ -382,14 +382,23 @@ AC_CHECK_FUNCS([clock_gettime], [],
  23. AC_SUBST([REALTIME_LIBS])
  24. have_timer="no"
  25. -AC_CHECK_FUNCS([timer_createx],
  26. +AC_CHECK_FUNCS([timer_create],
  27. [have_time="yes"],
  28. [AC_CHECK_LIB([rt], [timer_create], [
  29. have_timer="yes"
  30. REALTIME_LIBS="-lrt"
  31. - ])]
  32. + ],[
  33. + AC_SEARCH_LIBS([timer_create], [rt], [
  34. + AC_MSG_RESULT(yes)
  35. + have_timer="yes"
  36. + REALTIME_LIBS="-lrt -lpthread"
  37. + ],[], [-lpthread]
  38. + )
  39. + ])]
  40. )
  41. +AC_SUBST([REALTIME_LIBS])
  42. +
  43. AC_CHECK_MEMBER([struct sockaddr.sa_len],
  44. AC_DEFINE_UNQUOTED([HAVE_SA_LEN], [1], [Define if struct sockaddr contains sa_len]), [],
  45. --
  46. 2.5.0