#12 Update gdb.spec for builds earlier than RHEL8
Closed 3 months ago by keiths. Opened 3 months ago by keiths.
Unknown source rawhide  into  rawhide

file modified
+26 -30
@@ -293,10 +293,6 @@

  #=fedoratest

  Patch071: gdb-rhbz1325795-framefilters-test.patch

  

- # [dts+el7] [x86*] Bundle linux_perf.h for libipt (RH BZ 1256513).

- #=fedora

- Patch072: gdb-linux_perf-bundle.patch

- 

  # Fix gdb-headless /usr/bin/ executables (BZ 1390251).

  #

  # Also, make /usr/bin/gdb.minimal be the default GDB used, if it's
@@ -304,102 +300,102 @@

  #

  #   https://fedoraproject.org/wiki/Changes/Minimal_GDB_in_buildroot

  #=fedora

- Patch073: gdb-libexec-add-index.patch

+ Patch072: gdb-libexec-add-index.patch

  

  # New testcase for: Fix <tab>-completion crash (Gary Benson, RH BZ 1398387).

  #=fedoratest

- Patch074: gdb-rhbz1398387-tab-crash-test.patch

+ Patch073: gdb-rhbz1398387-tab-crash-test.patch

  

  # [s390x] Backport arch12 instructions decoding (RH BZ 1553104).

  # =fedoratest

- Patch075: gdb-rhbz1553104-s390x-arch12-test.patch

+ Patch074: gdb-rhbz1553104-s390x-arch12-test.patch

  

  # Fix off-by-one error in ada_fold_name.patch (RH BZ 1905996)

  # Upstream patch proposal: https://sourceware.org/pipermail/gdb-patches/2020-December/173935.html

  # =fedoratest

- Patch076: gdb-rhbz1905996-fix-off-by-one-error-in-ada_fold_name.patch

+ Patch075: gdb-rhbz1905996-fix-off-by-one-error-in-ada_fold_name.patch

  

  # Backport fix for libstdc++ assert when performing tab completion

  # (RH BZ 1912985).

- Patch077: gdb-rhbz1912985-libstdc++-assert.patch

+ Patch076: gdb-rhbz1912985-libstdc++-assert.patch

  

  # Backport fix for frame_id_p assertion failure (RH BZ 1909902).

- Patch078: gdb-rhbz1909902-frame_id_p-assert-1.patch

+ Patch077: gdb-rhbz1909902-frame_id_p-assert-1.patch

  

  # Backport patch #2 which fixes a frame_id_p assertion failure (RH BZ 1909902).

- Patch079: gdb-rhbz1909902-frame_id_p-assert-2.patch

+ Patch078: gdb-rhbz1909902-frame_id_p-assert-2.patch

  

  # Backport change which fixes gdbserver testing hang on f34 and rawhide.

- Patch080: gdb-rhbz1941080-fix-gdbserver-hang.patch

+ Patch079: gdb-rhbz1941080-fix-gdbserver-hang.patch

  

  # Backport "Disable bracketed paste mode in GDB tests"

  # (Tom Tromey)

- Patch081: testing-custom-inputrc.patch

+ Patch080: testing-custom-inputrc.patch

  

  # Backport "Save/restore file offset while reading notes in core file"

  # (Keith Seitz, RHBZ 1931344)

- Patch082: gdb-rhbz1931344-bfd_seek-elf_read_notes.patch

+ Patch081: gdb-rhbz1931344-bfd_seek-elf_read_notes.patch

  

  # [fortran] Backport Andrew Burgess's commit which cleans up

  # array/string expression evaluation.

- Patch083: gdb-rhbz1964167-fortran-clean-up-array-expression-evaluation.patch

+ Patch082: gdb-rhbz1964167-fortran-clean-up-array-expression-evaluation.patch

  

  # [fortran] Backport Andrew Burgess's commit which moves Fortran

  # expression handling to f-lang.c.

- Patch084: gdb-rhbz1964167-move-fortran-expr-handling.patch

+ Patch083: gdb-rhbz1964167-move-fortran-expr-handling.patch

  

  # [fortran] Backport Andrew Burgess's commit which eliminates undesirable

  # whitespace when printing arrays.

- Patch085: gdb-rhbz1964167-fortran-whitespace_array.patch

+ Patch084: gdb-rhbz1964167-fortran-whitespace_array.patch

  

  # [fortran] Backport Andrew Burgess's commit which changes enum

  # range_type into a bit field enum.

- Patch086: gdb-rhbz1964167-convert-enum-range_type.patch

+ Patch085: gdb-rhbz1964167-convert-enum-range_type.patch

  

  # [fortran] Backport Andrew Burgess's commit which renames enum

  # range_type to enum range_flag.

- Patch087: gdb-rhbz1964167-fortran-range_type-to-range_flag.patch

+ Patch086: gdb-rhbz1964167-fortran-range_type-to-range_flag.patch

  

  # [fortran] Backport Andrew Burgess's commit which adds support

  # for array strides in expressions.

- Patch088: gdb-rhbz1964167-fortran-array-strides-in-expressions.patch

+ Patch087: gdb-rhbz1964167-fortran-array-strides-in-expressions.patch

  

  # [fortran] Backport Andrew Burgess's commit for Fortran array

  # slice support

- Patch089: gdb-rhbz1964167-fortran-array-slices-at-prompt.patch

+ Patch088: gdb-rhbz1964167-fortran-array-slices-at-prompt.patch

  

  # [fortran] Backport Simon Marchi's commit which fixes a 32-bit build

  # problem in gdb/f-lang.c.

- Patch090: gdb-rhbz1964167-fortran-fix-type-format-mismatch-in-f-lang.c.patch

+ Patch089: gdb-rhbz1964167-fortran-fix-type-format-mismatch-in-f-lang.c.patch

  

  # Backport of "Exclude debuginfo files from 'outside of ELF segments'

  # warning"  (Keith Seitz)

- Patch091: gdb-rhbz1898252-loadable-section-outside-ELF-segments.patch

+ Patch090: gdb-rhbz1898252-loadable-section-outside-ELF-segments.patch

  

  # Backport "Fix crash when expanding partial symtabs with DW_TAG_imported_unit"

  # (Tom Tromey, gdb/27743)

- Patch092: gdb-gdb27743-psymtab-imported-unit.patch

+ Patch091: gdb-gdb27743-psymtab-imported-unit.patch

  

  # Backport "[gdb/server] Don't overwrite fs/gs_base with -m32"

  # (Tom de Vries)

- Patch093: gdb-dont-overwrite-fsgsbase-m32.patch

+ Patch092: gdb-dont-overwrite-fsgsbase-m32.patch

  

  # Backport patch fixing gdb on glibc-2.34 machines with regard to attaching

  # to processes (RH BZ 1971096).

- Patch094: gdb-rhbz1971096-glibc2.34-1.patch

+ Patch093: gdb-rhbz1971096-glibc2.34-1.patch

  

  # Backport patch fixing gdb on glibc-2.34 machines w/ regard to

  # libthread_db initialization.

- Patch095: gdb-rhbz1971096-glibc2.34-2.patch

+ Patch094: gdb-rhbz1971096-glibc2.34-2.patch

  

  # Backport testsuite patch for matching new libthread_db related output

  # when testing gdb on glibc-2.34 matchines (RH BZ 1971096).

- Patch096: gdb-rhbz1971096-glibc2.34-3.patch

+ Patch095: gdb-rhbz1971096-glibc2.34-3.patch

  

  # Backport patch adjusting test gdb.base/print-symbol-loading.exp.

  # (RH BZ 1971096).

- Patch097: gdb-rhbz1971096-glibc2.34-4.patch

+ Patch096: gdb-rhbz1971096-glibc2.34-4.patch

  

  # Backport patch adjusting test gdb.mi/mi-sym-info.exp (RH BZ 1971096).

- Patch098: gdb-rhbz1971096-glibc2.34-5.patch

+ Patch097: gdb-rhbz1971096-glibc2.34-5.patch

  

file modified
-1
@@ -95,4 +95,3 @@

  %patch095 -p1

  %patch096 -p1

  %patch097 -p1

- %patch098 -p1

file modified
-1
@@ -69,7 +69,6 @@

  gdb-rhbz1261564-aarch64-hw-watchpoint-test.patch

  gdb-container-rh-pkg.patch

  gdb-rhbz1325795-framefilters-test.patch

- gdb-linux_perf-bundle.patch

  gdb-libexec-add-index.patch

  gdb-rhbz1398387-tab-crash-test.patch

  gdb-rhbz1553104-s390x-arch12-test.patch

@@ -1,224 +0,0 @@

- From FEDORA_PATCHES Mon Sep 17 00:00:00 2001

- From: Fedora GDB patches <invalid@email.com>

- Date: Fri, 27 Oct 2017 21:07:50 +0200

- Subject: gdb-linux_perf-bundle.patch

- 

- ;; [dts+el7] [x86*] Bundle linux_perf.h for libipt (RH BZ 1256513).

- ;;=fedora

- 

- diff --git a/gdb/gdb.c b/gdb/gdb.c

- --- a/gdb/gdb.c

- +++ b/gdb/gdb.c

- @@ -20,11 +20,19 @@

-  #include "main.h"

-  #include "interps.h"

-  

- +#ifdef PERF_ATTR_SIZE_VER5_BUNDLE

- +extern "C" void __libipt_init(void);

- +#endif

- +

-  int

-  main (int argc, char **argv)

-  {

-    struct captured_main_args args;

-  

- +#ifdef PERF_ATTR_SIZE_VER5_BUNDLE

- +  __libipt_init();

- +#endif

- +

-    memset (&args, 0, sizeof args);

-    args.argc = argc;

-    args.argv = argv;

- diff --git a/gdb/nat/linux-btrace.h b/gdb/nat/linux-btrace.h

- --- a/gdb/nat/linux-btrace.h

- +++ b/gdb/nat/linux-btrace.h

- @@ -27,6 +27,177 @@

-  #  include <linux/perf_event.h>

-  #endif

-  

- +#ifdef PERF_ATTR_SIZE_VER5_BUNDLE

- +#ifndef HAVE_LINUX_PERF_EVENT_H

- +# error "PERF_ATTR_SIZE_VER5_BUNDLE && !HAVE_LINUX_PERF_EVENT_H"

- +#endif

- +#ifndef PERF_ATTR_SIZE_VER5

- +#define PERF_ATTR_SIZE_VER5

- +#define perf_event_mmap_page perf_event_mmap_page_bundle

- +// kernel-headers-3.10.0-493.el7.x86_64/usr/include/linux/perf_event.h

- +/*

- + * Structure of the page that can be mapped via mmap

- + */

- +struct perf_event_mmap_page {

- +	__u32	version;		/* version number of this structure */

- +	__u32	compat_version;		/* lowest version this is compat with */

- +

- +	/*

- +	 * Bits needed to read the hw events in user-space.

- +	 *

- +	 *   u32 seq, time_mult, time_shift, index, width;

- +	 *   u64 count, enabled, running;

- +	 *   u64 cyc, time_offset;

- +	 *   s64 pmc = 0;

- +	 *

- +	 *   do {

- +	 *     seq = pc->lock;

- +	 *     barrier()

- +	 *

- +	 *     enabled = pc->time_enabled;

- +	 *     running = pc->time_running;

- +	 *

- +	 *     if (pc->cap_usr_time && enabled != running) {

- +	 *       cyc = rdtsc();

- +	 *       time_offset = pc->time_offset;

- +	 *       time_mult   = pc->time_mult;

- +	 *       time_shift  = pc->time_shift;

- +	 *     }

- +	 *

- +	 *     index = pc->index;

- +	 *     count = pc->offset;

- +	 *     if (pc->cap_user_rdpmc && index) {

- +	 *       width = pc->pmc_width;

- +	 *       pmc = rdpmc(index - 1);

- +	 *     }

- +	 *

- +	 *     barrier();

- +	 *   } while (pc->lock != seq);

- +	 *

- +	 * NOTE: for obvious reason this only works on self-monitoring

- +	 *       processes.

- +	 */

- +	__u32	lock;			/* seqlock for synchronization */

- +	__u32	index;			/* hardware event identifier */

- +	__s64	offset;			/* add to hardware event value */

- +	__u64	time_enabled;		/* time event active */

- +	__u64	time_running;		/* time event on cpu */

- +	union {

- +		__u64	capabilities;

- +		struct {

- +			__u64	cap_bit0		: 1, /* Always 0, deprecated, see commit 860f085b74e9 */

- +				cap_bit0_is_deprecated	: 1, /* Always 1, signals that bit 0 is zero */

- +

- +				cap_user_rdpmc		: 1, /* The RDPMC instruction can be used to read counts */

- +				cap_user_time		: 1, /* The time_* fields are used */

- +				cap_user_time_zero	: 1, /* The time_zero field is used */

- +				cap_____res		: 59;

- +		};

- +	};

- +

- +	/*

- +	 * If cap_user_rdpmc this field provides the bit-width of the value

- +	 * read using the rdpmc() or equivalent instruction. This can be used

- +	 * to sign extend the result like:

- +	 *

- +	 *   pmc <<= 64 - width;

- +	 *   pmc >>= 64 - width; // signed shift right

- +	 *   count += pmc;

- +	 */

- +	__u16	pmc_width;

- +

- +	/*

- +	 * If cap_usr_time the below fields can be used to compute the time

- +	 * delta since time_enabled (in ns) using rdtsc or similar.

- +	 *

- +	 *   u64 quot, rem;

- +	 *   u64 delta;

- +	 *

- +	 *   quot = (cyc >> time_shift);

- +	 *   rem = cyc & (((u64)1 << time_shift) - 1);

- +	 *   delta = time_offset + quot * time_mult +

- +	 *              ((rem * time_mult) >> time_shift);

- +	 *

- +	 * Where time_offset,time_mult,time_shift and cyc are read in the

- +	 * seqcount loop described above. This delta can then be added to

- +	 * enabled and possible running (if index), improving the scaling:

- +	 *

- +	 *   enabled += delta;

- +	 *   if (index)

- +	 *     running += delta;

- +	 *

- +	 *   quot = count / running;

- +	 *   rem  = count % running;

- +	 *   count = quot * enabled + (rem * enabled) / running;

- +	 */

- +	__u16	time_shift;

- +	__u32	time_mult;

- +	__u64	time_offset;

- +	/*

- +	 * If cap_usr_time_zero, the hardware clock (e.g. TSC) can be calculated

- +	 * from sample timestamps.

- +	 *

- +	 *   time = timestamp - time_zero;

- +	 *   quot = time / time_mult;

- +	 *   rem  = time % time_mult;

- +	 *   cyc = (quot << time_shift) + (rem << time_shift) / time_mult;

- +	 *

- +	 * And vice versa:

- +	 *

- +	 *   quot = cyc >> time_shift;

- +	 *   rem  = cyc & (((u64)1 << time_shift) - 1);

- +	 *   timestamp = time_zero + quot * time_mult +

- +	 *               ((rem * time_mult) >> time_shift);

- +	 */

- +	__u64	time_zero;

- +	__u32	size;			/* Header size up to __reserved[] fields. */

- +

- +		/*

- +		 * Hole for extension of the self monitor capabilities

- +		 */

- +

- +	__u8	__reserved[118*8+4];	/* align to 1k. */

- +

- +	/*

- +	 * Control data for the mmap() data buffer.

- +	 *

- +	 * User-space reading the @data_head value should issue an smp_rmb(),

- +	 * after reading this value.

- +	 *

- +	 * When the mapping is PROT_WRITE the @data_tail value should be

- +	 * written by userspace to reflect the last read data, after issueing

- +	 * an smp_mb() to separate the data read from the ->data_tail store.

- +	 * In this case the kernel will not over-write unread data.

- +	 *

- +	 * See perf_output_put_handle() for the data ordering.

- +	 *

- +	 * data_{offset,size} indicate the location and size of the perf record

- +	 * buffer within the mmapped area.

- +	 */

- +	__u64   data_head;		/* head in the data section */

- +	__u64	data_tail;		/* user-space written tail */

- +	__u64	data_offset;		/* where the buffer starts */

- +	__u64	data_size;		/* data buffer size */

- +

- +	/*

- +	 * AUX area is defined by aux_{offset,size} fields that should be set

- +	 * by the userspace, so that

- +	 *

- +	 *   aux_offset >= data_offset + data_size

- +	 *

- +	 * prior to mmap()ing it. Size of the mmap()ed area should be aux_size.

- +	 *

- +	 * Ring buffer pointers aux_{head,tail} have the same semantics as

- +	 * data_{head,tail} and same ordering rules apply.

- +	 */

- +	__u64	aux_head;

- +	__u64	aux_tail;

- +	__u64	aux_offset;

- +	__u64	aux_size;

- +};

- +#endif // PERF_ATTR_SIZE_VER5

- +#endif // PERF_ATTR_SIZE_VER5_BUNDLE

- +

-  struct target_ops;

-  

-  #if HAVE_LINUX_PERF_EVENT_H

- diff --git a/gdbsupport/common.m4 b/gdbsupport/common.m4

- --- a/gdbsupport/common.m4

- +++ b/gdbsupport/common.m4

- @@ -145,7 +145,7 @@ AC_DEFUN([GDB_AC_COMMON], [

-      AC_PREPROC_IFELSE([AC_LANG_SOURCE([[

-    #include <linux/perf_event.h>

-    #ifndef PERF_ATTR_SIZE_VER5

- -  # error

- +  // error // PERF_ATTR_SIZE_VER5_BUNDLE is not available here - Fedora+RHEL

-    #endif

-      ]])], [perf_event=yes], [perf_event=no])

-      if test "$perf_event" != yes; then

file modified
+72 -56
@@ -13,6 +13,18 @@

  # Disable LTO until upstream fixes GDB's ODR woes.

  #%define _lto_cflags %{nil}

  

+ # Only build on x86 for RHEL6, defining missing parallel make macros.

+ %if 0%{?el6:1}

+ ExclusiveArch: %{ix86} x86_64

+ %global make_build make %{?_smp_mflags}

+ %global make_install make %{?_smp_mflags} install DESTDIR=$RPM_BUILD_ROOT

+ %endif

+ 

+ # Exclude aarch64 on RHEL7.

+ %if 0%{?scl:1} && 0%{?el7:1}

+ ExcludeArch: aarch64

+ %endif

+ 

  %{?scl:%scl_package gdb}

  %{!?scl:

   %global pkg_name %{name}
@@ -152,7 +164,7 @@

  Recommends: %{librpmname}

  %endif

  

- %if 0%{?el6:1}

+ %if 0%{?el6:1} || 0%{?el7:1}

  # GDB C++11 requires devtoolset gcc.

  BuildRequires: %{?scl_prefix}gcc-c++

  %endif
@@ -192,8 +204,6 @@

  %global libipt_version 2.0.4

  #=fedora

  Source7: v%{libipt_version}.tar.gz

- #=fedora

- Patch1142: v1.5-libipt-static.patch

  

  # Include the auto-generated file containing the "Patch:" directives.

  # See README.local-patches for more details.
@@ -201,14 +211,15 @@

  Patch9999: _gdb.spec.patch.include

  %include %{PATCH9998}

  

- %if 0%{!?rhel:1} || 0%{?rhel} > 6

- # RL_STATE_FEDORA_GDB would not be found for:

- # Patch642: gdb-readline62-ask-more-rh.patch

- # --with-system-readline

- BuildRequires: readline-devel%{buildisa} >= 6.2-4

- %endif # 0%{!?rhel:1} || 0%{?rhel} > 6

+ # System readline is too old prior to RHEL8.

+ %if 0%{!?rhel:1} || 0%{?rhel} > 7

+ %global use_system_readline 1

+ BuildRequires: readline-devel%{buildisa} >= 7.0

+ %else

+ %global use_system_readline 0

+ %endif

  

- BuildRequires: gcc-c++ ncurses-devel%{buildisa} texinfo gettext flex bison

+ BuildRequires: ncurses-devel%{buildisa} texinfo gettext flex bison

  BuildRequires: expat-devel%{buildisa}

  %if 0%{!?rhel:1} || 0%{?rhel} > 6

  BuildRequires: xz-devel%{buildisa}
@@ -219,6 +230,7 @@

  %if 0%{!?_without_python:1}

  %if 0%{?rhel:1} && 0%{?rhel} <= 7

  BuildRequires: python-devel%{buildisa}

+ %global __python /usr/bin/python2

  %else

  %global __python %{__python3}

  BuildRequires: python3-devel%{buildisa}
@@ -260,11 +272,29 @@

  # Fedora < 32, and mpfr-4 on Fedora 32+ and RHEL-9+.

  BuildRequires: mpfr-devel%{buildisa}

  %endif

+ # RHEL6 doesn't have source-highlight.

+ %if 0%{!?rhel:1} || 0%{?rhel} > 6

  BuildRequires: source-highlight-devel

+ %endif

  %if 0%{!?rhel:1}

  BuildRequires: xxhash-devel

  %endif

+ 

+ # Special case: on RHEL8, we simply require the system debuginfod.

+ # Otherwise, we require the SCL version.  Except on RHEL6, where debuginfod

+ # is not supported at all.

+ %global have_debuginfod 0

+ %global use_scl_for_debuginfod 0

+ %if 0%{?rhel} == 8

+ %global have_debuginfod 1

  BuildRequires: elfutils-debuginfod-client-devel

+ %else

+ %if 0%{!?el6:1} && 0%{?scl:1}

+ %global have_debuginfod 1

+ %global use_scl_for_debuginfod 1

+ BuildRequires: %{?scl_prefix}elfutils-debuginfod-client-devel

+ %endif

+ %endif

  

  %if 0%{?_with_testsuite:1}

  
@@ -287,12 +317,14 @@

  

  BuildRequires: sharutils dejagnu

  # gcc-objc++ is not covered by the GDB testsuite.

- BuildRequires: gcc gcc-c++ gcc-gfortran

+ # Test supported SCL toolchain components.  

+ BuildRequires: %{?scl_prefix}gcc %{?scl_prefix}gcc-c++ %{?scl_prefix}gcc-gfortran

+ 

  %if 0%{!?rhel:1} || 0%{?rhel} < 8

  BuildRequires: gcc-objc

  %endif

- %if 0%{!?rhel:1} || 0%{?rhel} > 7

- BuildRequires: gcc-gdb-plugin%{?_isa}

+ %if 0%{!?rhel:1} || 0%{?rhel} > 7 || 0%{?scl:1}

+ BuildRequires: %{?scl_prefix}gcc-gdb-plugin%{?_isa}

  %endif

  %if 0%{?rhel:1} && 0%{?rhel} < 7

  BuildRequires: gcc-java libgcj%{bits_local} libgcj%{bits_other}
@@ -362,12 +394,12 @@

  #BuildRequires: glibc-static%{bits_other}

  # Exception for RHEL<=7

  %ifarch s390x

- BuildRequires: valgrind%{bits_local}

+ BuildRequires: %{?scl_preifx}valgrind%{bits_local}

  %if 0%{!?rhel:1} || 0%{?rhel} > 7

- BuildRequires: valgrind%{bits_local} valgrind%{bits_other}

+ BuildRequires: %{?scl_prefix}valgrind%{bits_local} valgrind%{bits_other}

  %endif

  %else

- BuildRequires: valgrind%{bits_local} valgrind%{bits_other}

+ BuildRequires: %{?scl_prefix}valgrind%{bits_local} valgrind%{bits_other}

  %endif

  %if 0%{!?rhel:1} || 0%{?rhel} > 6

  BuildRequires: xz
@@ -375,8 +407,9 @@

  %if 0%{!?rhel:1} || 0%{?rhel} > 7

  BuildRequires: rust

  %endif

- 

+ %if 0%{!?el6:1}

  BuildRequires: %{?scl_prefix}elfutils-debuginfod

+ %endif

  %endif # 0%{?_with_testsuite:1}

  BuildRequires: make

  
@@ -451,10 +484,6 @@

  

  %if 0%{have_libipt} && 0%{?el7:1} && 0%{?scl:1}

  tar xzf %{SOURCE7}

- (

-  cd libipt-%{libipt_version}

- %patch1142 -p1

- )

  %endif

  

  # Files have `# <number> <file>' statements breaking VPATH / find-debuginfo.sh .
@@ -470,15 +499,6 @@

  # See README.local-patches for more details.

  %include %{PATCH9999}

  

- # 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.

  
@@ -499,14 +519,11 @@

  rm -f gdb/doc/*.info

  rm -f gdb/doc/*.info-*

  

- %if 0%{!?rhel:1} || 0%{?rhel} > 6

- # RL_STATE_FEDORA_GDB would not be found for:

- # Patch642: gdb-readline62-ask-more-rh.patch

- # --with-system-readline

+ %if 0%{use_system_readline}

  mv -f readline/readline/doc readline-doc

  rm -rf readline/readline/*

  mv -f readline-doc readline/readline/doc

- %endif # 0%{!?rhel:1} || 0%{?rhel} > 6

+ %endif

  

  rm -rf zlib texinfo

  
@@ -541,7 +558,7 @@

  	--disable-rpath						\

  	--without-stage1-ldflags				\

  	--disable-libmcheck					\

- %if 0%{!?rhel:1} || 0%{?rhel} > 6

+ %if 0%{use_system_readline}

  	--with-system-readline					\

  %else

  	--without-system-readline				\
@@ -562,7 +579,9 @@

  %else

  	--without-lzma						\

  %endif

+ %if 0%{!?rhel:1} || 0%{?have_debuginfod}

          --with-debuginfod					\

+ %endif

  %if 0%{?rhel:1}

  	--disable-libctf

  %endif
@@ -598,6 +617,11 @@

  

  export CXXFLAGS="$CFLAGS"

  

+ # If using an SCL for debuginfod, add path to SCL's pkgconfig directory.

+ %if 0%{?have_debuginfod} && 0%{?use_scl_for_debuginfod}

+ export PKG_CONFIG_PATH=%{_libdir}/pkgconfig

+ %endif

+ 

  # --htmldir and --pdfdir are not used as they are used from %{gdb_build}.

  ../configure							\

  	${COMMON_GDB_CONFIGURE_FLAGS}				\
@@ -636,25 +660,6 @@

  CFLAGS="$CFLAGS -DGDB_INDEX_VERIFY_VENDOR"

  %endif

  

- # [dts+el7] [x86*] Bundle linux_perf.h for libipt (RH BZ 1256513).

- %if %{have_libipt} && 0%{?el7:1} && 0%{?scl:1}

- CFLAGS="$CFLAGS -DPERF_ATTR_SIZE_VER5_BUNDLE"

- %endif

- 

- # Patch642: gdb-readline62-ask-more-rh.patch

- %if 0%{?rhel} == 7

- CFLAGS="$CFLAGS -DNEED_RL_STATE_FEDORA_GDB"

- %else

- # FIXME: Why not just: ! grep -w ...

- if grep -w RL_STATE_FEDORA_GDB %{_includedir}/readline/readline.h;then false;fi

- %endif

- 

- # Patch337: gdb-6.8-attach-signalled-detach-stopped.patch

- # Patch331: gdb-6.8-quit-never-aborts.patch

- %if 0%{?rhel:1} && 0%{?rhel} <= 6

- CFLAGS="$CFLAGS -DNEED_DETACH_SIGSTOP"

- %endif

- 

  %if 0%{have_libipt} && 0%{?el7:1} && 0%{?scl:1}

  (

   mkdir libipt-%{libipt_version}-root
@@ -677,6 +682,13 @@

  

  export CXXFLAGS="$CFLAGS"

  

+ # For DTS11+, gcc defaults to c++17, causing issues with system-installed

+ # headers, e.g., python. Force to c++11.  We coerce all builds to use c++11

+ # to facilitate testing.

+ %if 0%{?rhel} && 0%{?rhel} < 8

+ export CXXFLAGS="$CXXFLAGS -std=gnu++11"

+ %endif

+ 

  # The configure flags we will use when building the full GDB.

  GDB_FULL_CONFIGURE_FLAGS="\

  	--with-system-gdbinit=%{_sysconfdir}/gdbinit		\
@@ -952,7 +964,7 @@

  %endif # 0%{?_enable_debug_packages:1} && 0%{!?_without_python:1}

  

  # Compile python files

- %if 0%{!?_without_python:1}

+ %if 0%{!?_without_python:1} && (0%{!?rhel:1} || 0%{?rhel} > 7)

  %py_byte_compile %{__python3} %{buildroot}%{_datadir}/gdb/python/gdb

  %endif

  
@@ -1154,6 +1166,10 @@

  %endif

  

  %changelog

+ * Wed Jul 14 2021 Keith Seitz <keiths@redhat.com>

+ - Drop gdb-linux_perf-bundle.patch and v1.5-libipt-static.patch.

+ - Merge updates needed for RHEL6 and RHEL7.

+ 

  * Mon Jun 14 2021 Kevin Buettner <kevinb@redhat.com> - 10.2-4

  - Backport upstream patches which fix multi-threaded debugging for

    glibc-2.34 (RHBZ 1971096, Simon Marchi, Kevin Buettner).

@@ -1,13 +0,0 @@

- Index: processor-trace-2.0/libipt/src/posix/init.c

- ===================================================================

- --- processor-trace-2.0.orig/libipt/src/posix/init.c

- +++ processor-trace-2.0/libipt/src/posix/init.c

- @@ -29,7 +29,7 @@

-  #include "pt_ild.h"

-  

-  

- -static void __attribute__((constructor)) init(void)

- +void __libipt_init(void)

-  {

-  	/* Initialize the Intel(R) Processor Trace instruction decoder. */

-  	pt_ild_init();

Also drops unnecessary patches:
o gdb-linux_perf-bundle.patch.
o v1.5-libipt-static.patch.

I have tested on rhel6 (system & DTS builds), rhel7 (system & DTS builds), rhel8 (system and GTS bulds), rhel9 (system build), and rawhide.

Pull-Request has been closed by keiths

3 months ago