0001-Make-sure-dl_iterate_phdr-is-undefined-on-Android.patch 1.2 KB

1234567891011121314151617181920212223242526272829303132333435
  1. From 4fa67c8a014ac10558be71edec9048851ca7a02d Mon Sep 17 00:00:00 2001
  2. From: Georg Koppen <gk@torproject.org>
  3. Date: Thu, 15 Nov 2018 19:04:46 +0000
  4. Subject: [PATCH] Make sure `dl_iterate_phdr` is undefined on Android
  5. If we build with API < 21 we'll run into undefined reference errors.
  6. We follow the Rust people who ran into similar issues when
  7. upgrading libbacktrace for 1.28.0 in making sure `dl_iterate_phdr` is
  8. not defined for Android.
  9. diff --git a/src/libbacktrace/configure b/src/libbacktrace/configure
  10. index 8bdb29d256..8941fcd2b0 100755
  11. --- a/src/libbacktrace/configure
  12. +++ b/src/libbacktrace/configure
  13. @@ -12397,7 +12397,15 @@ rm -f conftest*
  14. have_dl_iterate_phdr=no ;;
  15. esac
  16. else
  17. - ac_fn_c_check_func "$LINENO" "dl_iterate_phdr" "ac_cv_func_dl_iterate_phdr"
  18. + case "${host}" in
  19. + *-*-androideabi*)
  20. + # Avoid dl_iterate_phdr on older Android API (which we use),
  21. + # as defining it causes undefined reference errors when
  22. + # compiling Firefox later on.
  23. + have_dl_iterate_phdr=no ;;
  24. + *) ac_fn_c_check_func "$LINENO" "dl_iterate_phdr" "ac_cv_func_dl_iterate_phdr" ;;
  25. + esac
  26. +
  27. if test "x$ac_cv_func_dl_iterate_phdr" = x""yes; then :
  28. have_dl_iterate_phdr=yes
  29. else
  30. --
  31. 2.19.1