- Fix more configure tests compromised by LTO.

This commit is contained in:
Jeff Law 2020-07-20 13:58:21 -06:00
parent 32bf168f75
commit 426edf4a6e
2 changed files with 40 additions and 2 deletions

View File

@ -10,3 +10,35 @@ diff -Nrup a/libiberty/aclocal.m4 b/libiberty/aclocal.m4
{ {
static char *addr = 0; static char *addr = 0;
auto char dummy; auto char dummy;
diff --git a/config/intdiv0.m4 b/config/intdiv0.m4
index 55dddcf1..ba906efc 100644
--- a/config/intdiv0.m4
+++ b/config/intdiv0.m4
@@ -31,10 +31,10 @@ sigfpe_handler (sig) int sig;
exit (sig != SIGFPE);
}
-int x = 1;
-int y = 0;
-int z;
-int nan;
+volatile int x = 1;
+volatile int y = 0;
+volatile int z;
+volatile int nan;
int main ()
{
diff --git a/libiberty/configure.ac b/libiberty/configure.ac
index f1ce7601..fc20d228 100644
--- a/libiberty/configure.ac
+++ b/libiberty/configure.ac
@@ -661,7 +661,7 @@ if test -z "${setobjs}"; then
for v in $vars; do
AC_MSG_CHECKING([for $v])
AC_CACHE_VAL(libiberty_cv_var_$v,
- [AC_LINK_IFELSE([AC_LANG_PROGRAM([[int *p;]],[[extern int $v []; p = $v;]])],
+ [AC_LINK_IFELSE([AC_LANG_PROGRAM([[__attribute__ ((used)) int *p;]],[[extern int $v []; p = $v;]])],
[eval "libiberty_cv_var_$v=yes"],
[eval "libiberty_cv_var_$v=no"])])
if eval "test \"`echo '$libiberty_cv_var_'$v`\" = yes"; then

View File

@ -490,7 +490,10 @@ export LDFLAGS=$RPM_LD_FLAGS
# in the subdirectories. So we just rebuild the ones we care # in the subdirectories. So we just rebuild the ones we care
# about after applying the configure patches # about after applying the configure patches
pushd libiberty pushd libiberty
autoreconf -ivf autoconf
popd
pushd intl
autoconf
popd popd
@ -801,7 +804,10 @@ exit 0
#---------------------------------------------------------------------------- #----------------------------------------------------------------------------
%changelog %changelog
- Sun Jul 19 2020 Jeff Law <law@redhat.com> - 2.34-9 * Mon Jul 20 2020 Jeff Law <law@redhat.com> - 2.34-9
- Fix more configure tests compromised by LTO.
* Sun Jul 19 2020 Jeff Law <law@redhat.com> - 2.34-9
- Fix configure test compromised by LTO. Add appropriate BuildRequires - Fix configure test compromised by LTO. Add appropriate BuildRequires
and force rebuliding the configure files in the appropriate dirs and force rebuliding the configure files in the appropriate dirs
- Fix various warnings exposed by LTO. - Fix various warnings exposed by LTO.