Merge remote-tracking branch 'up/master' into master-riscv64

Signed-off-by: David Abdurachmanov <david.abdurachmanov@sifive.com>
This commit is contained in:
David Abdurachmanov 2020-07-31 13:17:19 +03:00
commit 036cae3241
Signed by: davidlt
GPG Key ID: 8B7F1DA0E2C9FDBB
3 changed files with 115 additions and 14 deletions

56
gdb-config.patch Normal file
View File

@ -0,0 +1,56 @@
diff -Nrup a/gnulib/import/m4/alloca.m4 b/gnulib/import/m4/alloca.m4
--- a/gnulib/import/m4/alloca.m4 2019-11-18 18:49:20.000000000 -0700
+++ b/gnulib/import/m4/alloca.m4 2020-01-11 01:07:36.200483085 -0700
@@ -89,7 +89,7 @@ AC_CACHE_CHECK([stack direction for C al
[ac_cv_c_stack_direction],
[AC_RUN_IFELSE([AC_LANG_SOURCE(
[AC_INCLUDES_DEFAULT
-int
+__attribute__ (noinline,noclone)) int
find_stack_direction (int *addr, int depth)
{
int dir, dummy = 0;
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

12
gdb-ltofix.patch Normal file
View File

@ -0,0 +1,12 @@
diff -Nrup a/gdb/gdbserver/ax.c b/gdb/gdbserver/ax.c
--- a/gdb/gdbserver/ax.c 2019-11-18 18:49:19.000000000 -0700
+++ b/gdb/gdbserver/ax.c 2019-12-19 21:30:19.512505411 -0700
@@ -25,7 +25,7 @@
static void ax_vdebug (const char *, ...) ATTRIBUTE_PRINTF (1, 2);
#ifdef IN_PROCESS_AGENT
-int debug_agent = 0;
+bool debug_agent = 0;
#endif
static void

View File

@ -34,7 +34,7 @@ Version: 9.2
# The release always contains a leading reserved number, start it at 1.
# `upstream' is not a part of `name' to stay fully rpm dependencies compatible for the testing.
Release: 2.0.riscv64%{?dist}
Release: 5.0.riscv64%{?dist}
License: GPLv3+ and GPLv3+ with exceptions and GPLv2+ and GPLv2+ with exceptions and GPL+ and LGPLv2+ and LGPLv3+ and BSD and Public Domain and GFDL
# Do not provide URL for snapshots as the file lasts there only for 2 days.
@ -131,7 +131,7 @@ Recommends: default-yama-scope
%else
%global librpmver 7
%endif
%if 0%{?fedora} >= 31
%if 0%{?fedora} >= 31 || 0%{?rhel} >= 9
%global librpmver 9
%endif
%endif
@ -154,6 +154,8 @@ Recommends: %{librpmname}
BuildRequires: %{?scl_prefix}gcc-c++
%endif
BuildRequires: autoconf
# GDB patches have the format `gdb-<version>-bz<red-hat-bz-#>-<desc>.patch'.
# They should be created using patch level 1: diff -up ./gdb (or gdb-6.3/gdb).
@ -196,6 +198,14 @@ Patch1142: v1.5-libipt-static.patch
##=fedoratest
Patch1119: gdb-testsuite-readline63-sigint-revert.patch
# Fix broken configure tests compromised by LTO
#push=Should be pushed upstream.
Patch2000: gdb-config.patch
# Fix type mismatch issue exposed by LTO
#push=Should be pushed upstream.
Patch2001: gdb-ltofix.patch
# Include the auto-generated file containing the "Patch:" directives.
# See README.local-patches for more details.
Patch9998: _gdb.spec.Patch.include
@ -483,6 +493,18 @@ done
%patch1119 -p1
%endif
%patch2000 -p1
%patch2001 -p1
# The above patches twiddle a .m4 file for configure, so update the affected
# configure files
pushd libiberty
autoconf -f
popd
pushd intl
autoconf -f
popd
find -name "*.orig" | xargs rm -f
! find -name "*.rej" # Should not happen.
@ -613,10 +635,10 @@ export CXXFLAGS="$CFLAGS"
%endif
# Prepare gdb/config.h first.
make %{?_smp_mflags} CFLAGS="$CFLAGS $FPROFILE_CFLAGS" LDFLAGS="$LDFLAGS $FPROFILE_CFLAGS" V=1 maybe-configure-gdb
%make_build CFLAGS="$CFLAGS $FPROFILE_CFLAGS" LDFLAGS="$LDFLAGS $FPROFILE_CFLAGS" V=1 maybe-configure-gdb
perl -i.relocatable -pe 's/^(D\[".*_RELOCATABLE"\]=" )1(")$/${1}0$2/' gdb/config.status
make %{?_smp_mflags} CFLAGS="$CFLAGS $FPROFILE_CFLAGS" LDFLAGS="$LDFLAGS $FPROFILE_CFLAGS" V=1
%make_build CFLAGS="$CFLAGS $FPROFILE_CFLAGS" LDFLAGS="$LDFLAGS $FPROFILE_CFLAGS" V=1
cd ..
%endif # 0%{?_build_minimal}
@ -732,12 +754,12 @@ $(: ppc64 host build crashes on ppc variant of libexpat.so ) \
if [ -z "%{!?_with_profile:no}" ]
then
# Run all the configure tests being incompatible with $FPROFILE_CFLAGS.
make %{?_smp_mflags} configure-host configure-target
make %{?_smp_mflags} clean
%make_build configure-host configure-target
%make_build clean
# Workaround -fprofile-use:
# linux-x86-low.c:2225: Error: symbol `start_i386_goto' is already defined
make %{?_smp_mflags} -C gdb/gdbserver linux-x86-low.o
%make_build -C gdb/gdbserver linux-x86-low.o
fi
# Global CFLAGS would fail on:
@ -762,10 +784,10 @@ else
fi
# Prepare gdb/config.h first.
make %{?_smp_mflags} CFLAGS="$CFLAGS $FPROFILE_CFLAGS" LDFLAGS="$LDFLAGS $FPROFILE_CFLAGS" V=1 maybe-configure-gdb
%make_build CFLAGS="$CFLAGS $FPROFILE_CFLAGS" LDFLAGS="$LDFLAGS $FPROFILE_CFLAGS" V=1 maybe-configure-gdb
perl -i.relocatable -pe 's/^(D\[".*_RELOCATABLE"\]=" )1(")$/${1}0$2/' gdb/config.status
make %{?_smp_mflags} CFLAGS="$CFLAGS $FPROFILE_CFLAGS" LDFLAGS="$LDFLAGS $FPROFILE_CFLAGS" V=1
%make_build CFLAGS="$CFLAGS $FPROFILE_CFLAGS" LDFLAGS="$LDFLAGS $FPROFILE_CFLAGS" V=1
! grep '_RELOCATABLE.*1' gdb/config.h
grep '^#define HAVE_LIBSELINUX 1$' gdb/config.h
@ -787,7 +809,7 @@ done # fprofile
cd %{gdb_build}
make %{?_smp_mflags} \
%make_build \
-C gdb/doc {gdb,annotate}{.info,/index.html,.pdf} MAKEHTMLFLAGS=--no-split MAKEINFOFLAGS=--no-split V=1
# Copy the <sourcetree>/gdb/NEWS file to the directory above it.
@ -860,7 +882,7 @@ gcc -o ./orphanripper %{SOURCE2} -Wall -lutil -ggdb2
# See also: gdb-runtest-pie-override.exp
###CHECK="$(echo $CHECK|sed 's#check//unix/[^ ]*#& &/-fPIC/-pie#g')"
./orphanripper make %{?_smp_mflags} -k $CHECK || :
./orphanripper %make_build -k $CHECK || :
)
for t in sum log
do
@ -884,7 +906,7 @@ echo ====================TESTING END=====================
cd %{gdb_build_minimal}
rm -rf $RPM_BUILD_ROOT
make %{?_smp_mflags} install DESTDIR=$RPM_BUILD_ROOT
%make_install %{?_smp_mflags}
# Delete everything except the 'gdb' binary, and then rename it to
# 'gdb.minimal'.
@ -910,7 +932,7 @@ rm -rf $RPM_BUILD_ROOT
%{?scl:PATH=%{_bindir}${PATH:+:${PATH}}}
%endif
make %{?_smp_mflags} install DESTDIR=$RPM_BUILD_ROOT
%make_install %{?_smp_mflags}
%if 0%{!?scl:1}
mkdir -p $RPM_BUILD_ROOT%{_prefix}/libexec
@ -1169,9 +1191,20 @@ fi
%endif
%changelog
* Sun Jun 28 2020 David Abdurachmanov <david.abdurachmanov@sifive.com> - 9.2-2.0.riscv64
* Fri Jul 31 2020 David Abdurachmanov <david.abdurachmanov@sifive.com> - 9.2-5.0.riscv64
- Add support for RISC-V (riscv64)
* Mon Jul 27 2020 Fedora Release Engineering <releng@fedoraproject.org>
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Wed Jul 22 2020 Tom Stellard <tstellar@redhat.com>
- Use make macros
- https://fedoraproject.org/wiki/Changes/UseMakeBuildInstallMacro
* Mon Jul 20 2020 Jeff Law <lawb@redhat.com> - 9.2-3
- Fix broken configure tests compromised by LTO
- Add BuildRequires: autoconf
* Wed Jun 17 2020 Keith Seitz <keiths@redhat.com> - 9.2-2
- Backport debuginfod support.