0008-configure.ac-try-execinfo-in-libc-before-searching-l.patch 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. From ba41a28cd526bccde4ec3db0998e1b00d3afc0e2 Mon Sep 17 00:00:00 2001
  2. From: "Arnout Vandecappelle (Essensium/Mind)" <arnout@mind.be>
  3. Date: Tue, 26 Jul 2022 18:31:14 +0200
  4. Subject: [PATCH] configure.ac: try execinfo in libc before searching
  5. libexecinfo
  6. execinfo is provided by glibc, so the usual case is that it is part of
  7. libc. Do this before starting a redundant search for libexecinfo.
  8. This is especially relevant for cross-compilation, where
  9. FR_SMART_CHECK_LIB can find an incompatible library.
  10. Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
  11. Upstream: https://github.com/FreeRADIUS/freeradius-server/pull/4632
  12. [Fabrice: update for 3.2.3]
  13. Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  14. ---
  15. configure.ac | 38 +++++++++++++++++++-------------------
  16. 1 file changed, 19 insertions(+), 19 deletions(-)
  17. diff --git a/configure.ac b/configure.ac
  18. index f431da6db5..faa7cfc2b4 100644
  19. --- a/configure.ac
  20. +++ b/configure.ac
  21. @@ -2165,21 +2165,21 @@ dnl #
  22. smart_try_dir=$execinfo_include_dir
  23. FR_SMART_CHECK_INCLUDE(execinfo.h)
  24. if test "x$ac_cv_header_execinfo_h" = "xyes"; then
  25. - smart_try_dir=$execinfo_lib_dir
  26. - FR_SMART_CHECK_LIB(execinfo, backtrace_symbols)
  27. + dnl # Might be provided as part of libc
  28. + AC_MSG_CHECKING([if execinfo provided as part of libc])
  29. + AC_LINK_IFELSE([AC_LANG_PROGRAM([[
  30. + #include <execinfo.h>
  31. + ]], [[
  32. + void *sym[1];
  33. + backtrace_symbols(&sym, sizeof(sym)) ]])],[
  34. + AC_MSG_RESULT(yes)
  35. + ac_cv_lib_execinfo_backtrace_symbols="yes"
  36. + ],[
  37. + AC_MSG_RESULT(no)
  38. + ])
  39. if test "x$ac_cv_lib_execinfo_backtrace_symbols" != "xyes"; then
  40. - dnl # Might be provided as part of libc
  41. - AC_MSG_CHECKING([if execinfo provided as part of libc])
  42. - AC_LINK_IFELSE([AC_LANG_PROGRAM([[
  43. - #include <execinfo.h>
  44. - ]], [[
  45. - void *sym[1];
  46. - backtrace_symbols(&sym, sizeof(sym)) ]])],[
  47. - AC_MSG_RESULT(yes)
  48. - ac_cv_lib_execinfo_backtrace_symbols="yes"
  49. - ],[
  50. - AC_MSG_RESULT(no)
  51. - ])
  52. + smart_try_dir=$execinfo_lib_dir
  53. + FR_SMART_CHECK_LIB(execinfo, backtrace_symbols)
  54. fi
  55. if test "x$ac_cv_lib_execinfo_backtrace_symbols" = "xyes"; then
  56. --
  57. 2.35.3