Blame SOURCES/binutils-config.patch

3dad3f
diff -Nrup a/libiberty/aclocal.m4 b/libiberty/aclocal.m4
3dad3f
--- a/libiberty/aclocal.m4	2019-01-19 09:01:34.000000000 -0700
3dad3f
+++ b/libiberty/aclocal.m4	2020-01-09 22:00:27.183312982 -0700
3dad3f
@@ -147,7 +147,7 @@ if test $ac_cv_os_cray = yes; then
3dad3f
 fi
3dad3f
 
3dad3f
 AC_CACHE_CHECK(stack direction for C alloca, ac_cv_c_stack_direction,
3dad3f
-[AC_TRY_RUN([find_stack_direction ()
3dad3f
+[AC_TRY_RUN([__attribute__ ((noclone,noinline)) find_stack_direction ()
3dad3f
 {
3dad3f
   static char *addr = 0;
3dad3f
   auto char dummy;
3dad3f
diff --git a/config/intdiv0.m4 b/config/intdiv0.m4
3dad3f
index 55dddcf1..ba906efc 100644
3dad3f
--- a/config/intdiv0.m4
3dad3f
+++ b/config/intdiv0.m4
3dad3f
@@ -31,10 +31,10 @@ sigfpe_handler (sig) int sig;
3dad3f
   exit (sig != SIGFPE);
3dad3f
 }
3dad3f
 
3dad3f
-int x = 1;
3dad3f
-int y = 0;
3dad3f
-int z;
3dad3f
-int nan;
3dad3f
+volatile int x = 1;
3dad3f
+volatile int y = 0;
3dad3f
+volatile int z;
3dad3f
+volatile int nan;
3dad3f
 
3dad3f
 int main ()
3dad3f
 {
3dad3f
diff --git a/libiberty/configure.ac b/libiberty/configure.ac
3dad3f
index f1ce7601..fc20d228 100644
3dad3f
--- a/libiberty/configure.ac
3dad3f
+++ b/libiberty/configure.ac
3dad3f
@@ -661,7 +661,7 @@ if test -z "${setobjs}"; then
3dad3f
   for v in $vars; do
3dad3f
     AC_MSG_CHECKING([for $v])
3dad3f
     AC_CACHE_VAL(libiberty_cv_var_$v,
3dad3f
-      [AC_LINK_IFELSE([AC_LANG_PROGRAM([[int *p;]],[[extern int $v []; p = $v;]])],
3dad3f
+      [AC_LINK_IFELSE([AC_LANG_PROGRAM([[__attribute__ ((used)) int *p;]],[[extern int $v []; p = $v;]])],
3dad3f
 		      [eval "libiberty_cv_var_$v=yes"],
3dad3f
 		      [eval "libiberty_cv_var_$v=no"])])
3dad3f
     if eval "test \"`echo '$libiberty_cv_var_'$v`\" = yes"; then