guile-1.8.8-gcc46.patch 1004 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. Backported upstream patch to fix SIGSEGV with gcc-4.6
  2. http://git.savannah.gnu.org/cgit/guile.git/commit/?h=branch_release-1-8&id=62bc1072c19e81bb0f9e42a5034e7ab8c27d3b94
  3. https://bugs.gentoo.org/show_bug.cgi?id=424475
  4. --- a/configure.in
  5. +++ b/configure.in
  6. @@ -1199,23 +1199,20 @@
  7. AC_RUN_IFELSE([AC_LANG_SOURCE(
  8. [AC_INCLUDES_DEFAULT
  9. int
  10. -find_stack_direction ()
  11. +find_stack_direction (int *addr, int depth)
  12. {
  13. - static char *addr = 0;
  14. - auto char dummy;
  15. - if (addr == 0)
  16. - {
  17. - addr = &dummy;
  18. - return find_stack_direction ();
  19. - }
  20. - else
  21. - return (&dummy > addr) ? 1 : -1;
  22. + int dir, dummy = 0;
  23. + if (! addr)
  24. + addr = &dummy;
  25. + *addr = addr < &dummy ? 1 : addr == &dummy ? 0 : -1;
  26. + dir = depth ? find_stack_direction (addr, depth - 1) : 0;
  27. + return dir + dummy;
  28. }
  29. int
  30. -main ()
  31. +main (int argc, char **argv)
  32. {
  33. - return find_stack_direction () < 0;
  34. + return find_stack_direction (0, argc + !argv + 20) < 0;
  35. }])],
  36. [SCM_I_GSC_STACK_GROWS_UP=1],
  37. [],