From 88eeb4f3e0211a8cc714eff09441c20b3e837604 Mon Sep 17 00:00:00 2001 From: Jeff Law Date: Jul 20 2020 22:20:13 +0000 Subject: - Fix configure tests compromised by LTO --- diff --git a/binutils-config.patch b/binutils-config.patch new file mode 100644 index 0000000..8456584 --- /dev/null +++ b/binutils-config.patch @@ -0,0 +1,44 @@ +diff -Nrup a/libiberty/aclocal.m4 b/libiberty/aclocal.m4 +--- a/libiberty/aclocal.m4 2019-01-19 09:01:34.000000000 -0700 ++++ b/libiberty/aclocal.m4 2020-01-09 22:00:27.183312982 -0700 +@@ -147,7 +147,7 @@ if test $ac_cv_os_cray = yes; then + fi + + AC_CACHE_CHECK(stack direction for C alloca, ac_cv_c_stack_direction, +-[AC_TRY_RUN([find_stack_direction () ++[AC_TRY_RUN([__attribute__ ((noclone,noinline)) find_stack_direction () + { + static char *addr = 0; + 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 diff --git a/mingw-binutils.spec b/mingw-binutils.spec index 593e5a3..eaab51f 100644 --- a/mingw-binutils.spec +++ b/mingw-binutils.spec @@ -2,7 +2,7 @@ Name: mingw-binutils Version: 2.34 -Release: 0%{?dist} +Release: 1%{?dist} Summary: Cross-compiled version of binutils for Win32 and Win64 environments License: GPLv2+ and LGPLv2+ and GPLv3+ and LGPLv3+ @@ -95,6 +95,8 @@ Patch16: binutils-CVE-2019-1010204.patch ### MINGW specific patches +Patch102: binutils-config.patch + BuildRequires: gcc BuildRequires: flex BuildRequires: bison @@ -107,6 +109,7 @@ BuildRequires: dejagnu BuildRequires: sharutils %endif Provides: bundled(libiberty) +BuildRequires: autoconf, automake %description @@ -148,6 +151,19 @@ understand Windows executables and DLLs. %build +# Dependencies are not set up to rebuild the configure files +# in the subdirectories. So we just rebuild the ones we care +# about +pushd libiberty +autoreconf -ivf +popd + +# We call configure directly rather than via macros, thus if +# we are using LTO, we have to manually fix the broken configure +# scripts +[ %{_lto_cflags}x != x ] && %{_fix_broken_configure_for_lto} + + mkdir build_win32 pushd build_win32 CFLAGS="%{optflags}" \ @@ -335,6 +351,9 @@ rm -rf %{buildroot}/multilib %changelog +* Mon Jul 20 2020 Jeff Law - 2.34.0-2 +- Fix configure tests compromised by LTO + * Fri Jun 19 2020 Sandro Mani - 2.34.0-1 - Update to 2.34.0 - Modernize spec