From 1cd4f3809fc011f5e1f2ab26affc326736b6b20b Mon Sep 17 00:00:00 2001 From: "Fabio M. Di Nitto" Date: Wed, 30 Mar 2011 14:08:36 +0200 Subject: [PATCH] - Cleanup spec file to add sparc|sparcv9|sparc64. - Add sparc specific workarounds to toolchain badness: - disable mmap in bdf/ via --without-mmap configure option. - add patch to not build mmap support on sparc for gdb/. - gdb code is NOT at fault, but we need a working gdb while we sort out the toolchain and rebuild all packages. this workaround is NOT for upstream Signed-off-by: Fabio M. Di Nitto --- ...add-workaround-to-broken-debug-files.patch | 49 +++++++++++++++++++ gdb.spec | 36 ++++++++++++-- 2 files changed, 80 insertions(+), 5 deletions(-) create mode 100644 gdb-7.2.50-sparc-add-workaround-to-broken-debug-files.patch diff --git a/gdb-7.2.50-sparc-add-workaround-to-broken-debug-files.patch b/gdb-7.2.50-sparc-add-workaround-to-broken-debug-files.patch new file mode 100644 index 0000000..19fdcc3 --- /dev/null +++ b/gdb-7.2.50-sparc-add-workaround-to-broken-debug-files.patch @@ -0,0 +1,49 @@ +--- gdb-7.2.50.20110328.orig/gdb/dwarf2read.c 2011-03-30 12:52:20.395450001 +0200 ++++ gdb-7.2.50.20110328/gdb/dwarf2read.c 2011-03-30 13:41:55.485450006 +0200 +@@ -66,12 +66,14 @@ + #ifdef HAVE_ZLIB_H + #include + #endif ++#ifndef __sparc__ + #ifdef HAVE_MMAP + #include + #ifndef MAP_FAILED + #define MAP_FAILED ((void *) -1) + #endif + #endif ++#endif + + typedef struct symbol *symbolp; + DEF_VEC_P (symbolp); +@@ -1563,6 +1565,7 @@ + } + } + ++#ifndef __sparc__ + #ifdef HAVE_MMAP + if (pagesize == 0) + pagesize = getpagesize (); +@@ -1589,6 +1592,7 @@ + } + } + #endif ++#endif + + /* If we get here, we are a normal, not-compressed section. */ + info->buffer = buf +@@ -15439,6 +15443,7 @@ + { + if (info->was_mmapped) + { ++#ifndef __sparc__ + #ifdef HAVE_MMAP + intptr_t begin = (intptr_t) info->buffer; + intptr_t map_begin = begin & ~(pagesize - 1); +@@ -15449,6 +15454,7 @@ + /* Without HAVE_MMAP, we should never be here to begin with. */ + gdb_assert_not_reached ("no mmap support"); + #endif ++#endif + } + } + diff --git a/gdb.spec b/gdb.spec index 1d11143..0f4a62c 100644 --- a/gdb.spec +++ b/gdb.spec @@ -27,7 +27,7 @@ Version: 7.2.50.20110328 # 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: 32%{?_with_upstream:.upstream}%{?dist} +Release: 33%{?_with_upstream:.upstream}%{?dist} License: GPLv3+ and GPLv3+ with exceptions and GPLv2+ and GPLv2+ with exceptions and GPL+ and LGPLv2+ and BSD and Public Domain Group: Development/Debuggers @@ -556,6 +556,19 @@ Patch572: gdb-core-thread-internalerr-1of3.patch Patch573: gdb-core-thread-internalerr-2of3.patch Patch574: gdb-core-thread-internalerr-3of3.patch +# Toolchain on sparc is slightly broken and debuginfo files are generated +# with non 64bit aligned tables/offsets. +# See for example readelf -S ../Xvnc.debug. +# +# As a consenquence calculation of sectp->filepos as used in +# dwarf2_read_section (gdb/dwarf2read.c:1525) will return a non aligned buffer +# that cannot be used directly as done with MMAP. +# Usage will result in a BusError. +# +# While we figure out what's wrong in the toolchain and do a full archive +# rebuild to fix it, we need to be able to use gdb :) +Patch579: gdb-7.2.50-sparc-add-workaround-to-broken-debug-files.patch + BuildRequires: ncurses-devel%{?_isa} texinfo gettext flex bison expat-devel%{?_isa} Requires: readline%{?_isa} BuildRequires: readline-devel%{?_isa} @@ -610,7 +623,7 @@ BuildRequires: gcc gcc-c++ gcc-gfortran gcc-java gcc-objc # Copied from prelink-0.4.2-3.fc13. %ifarch %{ix86} alpha sparc sparcv9 sparc64 s390 s390x x86_64 ppc ppc64 # Prelink is broken on sparcv9/sparc64. -%ifnarch sparcv9 sparc64 +%ifnarch sparc sparcv9 sparc64 BuildRequires: prelink %endif %endif @@ -844,6 +857,8 @@ fi %patch487 -p1 %endif # 0%{?rhel:1} +%patch579 -p1 + find -name "*.orig" | xargs rm -f ! find -name "*.rej" # Should not happen. @@ -901,7 +916,7 @@ CFLAGS="$CFLAGS -O0 -ggdb2" --with-system-gdbinit=%{_sysconfdir}/gdbinit \ --with-gdb-datadir=%{_datadir}/gdb \ --enable-gdb-build-warnings=,-Wno-unused \ -%ifnarch %{ix86} alpha ia64 ppc s390 s390x x86_64 ppc64 sparcv9 sparc64 +%ifnarch %{ix86} alpha ia64 ppc s390 s390x x86_64 ppc64 sparc sparcv9 sparc64 --disable-werror \ %else %if 0%{?_with_upstream:1} @@ -938,12 +953,15 @@ $(: RHEL-5 librpm has incompatible API. ) \ --with-libunwind \ %else --without-libunwind \ +%endif +%ifarch sparc sparcv9 sparc64 + --without-mmap \ %endif --enable-64-bit-bfd \ %if 0%{?_with_debug:1} --enable-static --disable-shared --enable-debug \ %endif -%ifarch sparcv9 +%ifarch sparc sparcv9 sparc-%{_vendor}-%{_target_os}%{?_gnu} %else %{_target_platform} @@ -1233,7 +1251,7 @@ fi # don't include the files in include, they are part of binutils -%ifnarch sparcv9 +%ifnarch sparc sparcv9 %if 0%{!?el5:1} %files gdbserver %defattr(-,root,root) @@ -1252,6 +1270,14 @@ fi %{_infodir}/gdb.info* %changelog +* Wed Mar 30 2011 Fabio M. Di Nitto - 7.2.50.20110328-33.fc15 +- Cleanup spec file to add sparc|sparcv9|sparc64. +- Add sparc specific workarounds to toolchain badness: + - disable mmap in bdf/ via --without-mmap configure option. + - add patch to not build mmap support on sparc for gdb/. + - gdb code is NOT at fault, but we need a working gdb while we sort out + the toolchain and rebuild all packages. this workaround is NOT for upstream. + * Tue Mar 29 2011 Jan Kratochvil - 7.2.50.20110328-32.fc15 - Fix occasional crash on `print errno' with no -pthread and no -g3 (BZ 690908).