From 1d224e61d8227a342eea02918df4e0c810f27a0c Mon Sep 17 00:00:00 2001 From: Jan Kratochvil Date: Wed, 17 Aug 2016 23:48:10 +0200 Subject: [PATCH 1/6] [dts60+el7] [x86*] Bundle libipt (RH BZ 1256513). --- .gitignore | 1 + gdb.spec | 45 ++++++++++++++++++++++++++++++++++++++-- sources | 1 + v1.5-libipt-static.patch | 11 ++++++++++ 4 files changed, 56 insertions(+), 2 deletions(-) create mode 100644 v1.5-libipt-static.patch diff --git a/.gitignore b/.gitignore index dbb15cb..d17dbf5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ /gdb-libstdc++-v3-python-r225521.tar.xz +/v1.5.tar.gz /gdb-7.11.1.tar.xz diff --git a/gdb.spec b/gdb.spec index 3f68e51..7325dfb 100644 --- a/gdb.spec +++ b/gdb.spec @@ -27,7 +27,7 @@ Version: 7.11.1 # 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: 77%{?dist} +Release: 78%{?dist} License: GPLv3+ and GPLv3+ with exceptions and GPLv2+ and GPLv2+ with exceptions and GPL+ and LGPLv2+ and BSD and Public Domain and GFDL Group: Development/Debuggers @@ -128,6 +128,11 @@ Source5: %{libstdcxxpython}.tar.xz # Provide gdbtui for RHEL-5 and RHEL-6 as it is removed upstream (BZ 797664). Source6: gdbtui +# libipt: Intel Processor Trace Decoder Library +%global libipt_version 1.5 +Source7: v%{libipt_version}.tar.gz +Patch1142: v1.5-libipt-static.patch + # Work around out-of-date dejagnu that does not have KFAIL #=drop: That dejagnu is too old to be supported. Patch1: gdb-6.3-rh-dummykfail-20041202.patch @@ -619,12 +624,18 @@ BuildRequires: libbabeltrace-devel%{buildisa} BuildRequires: guile-devel%{buildisa} %endif %global have_libipt 0 -%if 0%{!?rhel:1} || 0%{?rhel} > 7 +%if 0%{!?rhel:1} || 0%{?rhel} > 7 || (0%{?rhel} == 7 && 0%{?scl:1}) %ifarch %{ix86} x86_64 %global have_libipt 1 +%if 0%{?scl:1} +BuildRequires: cmake +# RHEL-7.3 kernel Bug 1270539 +BuildRequires: kernel-headers >= 3.10.0-352.el7 +%else BuildRequires: libipt-devel%{buildisa} %endif %endif +%endif %if 0%{?_with_testsuite:1} @@ -755,6 +766,14 @@ This package provides INFO, HTML and PDF user manual for GDB. tar xJf %{SOURCE5} %endif # 0%{?rhel:1} && 0%{?rhel} <= 7 +%if 0%{have_libipt} && 0%{?scl:1} +tar xzf %{SOURCE7} +( + cd processor-trace-%{libipt_version} +%patch1142 -p1 +) +%endif + # Files have `# ' statements breaking VPATH / find-debuginfo.sh . (cd gdb;rm -fv $(perl -pe 's/\\\n/ /' - 7.11.1-78.fc24 +- [dts60+el7] [x86*] Bundle libipt (RH BZ 1256513). + * Wed Aug 3 2016 Jan Kratochvil - 7.11.1-77.fc24 - [aarch64] Fix ARMv8.1/v8.2 for hw watchpoint and breakpoint (Andrew Pinski, RH BZ 1363635). diff --git a/sources b/sources index 26478eb..c03498c 100644 --- a/sources +++ b/sources @@ -1,2 +1,3 @@ 7ad32d3894aaf90d00a4343a735c3e1c gdb-libstdc++-v3-python-r225521.tar.xz +29efc08219d9d6a0536d58f9807c8722 v1.5.tar.gz 5aa71522e488e358243917967db87476 gdb-7.11.1.tar.xz diff --git a/v1.5-libipt-static.patch b/v1.5-libipt-static.patch new file mode 100644 index 0000000..93bc0f8 --- /dev/null +++ b/v1.5-libipt-static.patch @@ -0,0 +1,11 @@ +--- processor-trace-1.5/libipt/CMakeLists.txt-orig 2016-04-07 08:52:14.000000000 +0200 ++++ processor-trace-1.5/libipt/CMakeLists.txt 2016-08-17 23:12:23.241109244 +0200 +@@ -81,7 +81,7 @@ endif (CMAKE_HOST_WIN32) + + set(LIBIPT_FILES ${LIBIPT_FILES} ${LIBIPT_SECTION_FILES}) + +-add_library(libipt SHARED ++add_library(libipt STATIC + ${LIBIPT_FILES} + ) + From a4c8bcab20ef163cc93d3c434ad53ae3b4d7c2b4 Mon Sep 17 00:00:00 2001 From: Jan Kratochvil Date: Fri, 19 Aug 2016 20:58:09 +0200 Subject: [PATCH 2/6] [dts60+el7] [x86*] Bundle linux_perf.h for libipt (RH BZ 1256513). --- gdb-linux_perf-bundle.patch | 207 ++++++++++++++++++++++++++++++++++++ gdb.spec | 16 ++- 2 files changed, 220 insertions(+), 3 deletions(-) create mode 100644 gdb-linux_perf-bundle.patch diff --git a/gdb-linux_perf-bundle.patch b/gdb-linux_perf-bundle.patch new file mode 100644 index 0000000..b8bc3e8 --- /dev/null +++ b/gdb-linux_perf-bundle.patch @@ -0,0 +1,207 @@ +Index: gdb-7.11.1/gdb/nat/linux-btrace.h +=================================================================== +--- gdb-7.11.1.orig/gdb/nat/linux-btrace.h 2016-02-10 04:19:39.000000000 +0100 ++++ gdb-7.11.1/gdb/nat/linux-btrace.h 2016-08-19 20:49:18.735477251 +0200 +@@ -28,6 +28,176 @@ + # include + #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_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 +Index: gdb-7.11.1/gdb/configure +=================================================================== +--- gdb-7.11.1.orig/gdb/configure 2016-08-19 20:47:11.488325144 +0200 ++++ gdb-7.11.1/gdb/configure 2016-08-19 20:47:11.658326684 +0200 +@@ -10635,7 +10635,7 @@ + + #include + #ifndef PERF_ATTR_SIZE_VER5 +-# error ++// error // PERF_ATTR_SIZE_VER5_BUNDLE is not available here - Fedora+RHEL + #endif + + _ACEOF +Index: gdb-7.11.1/gdb/configure.ac +=================================================================== +--- gdb-7.11.1.orig/gdb/configure.ac 2016-08-19 20:47:11.489325154 +0200 ++++ gdb-7.11.1/gdb/configure.ac 2016-08-19 20:47:11.659326693 +0200 +@@ -1452,7 +1452,7 @@ + AC_PREPROC_IFELSE(AC_LANG_SOURCE([[ + #include + #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 diff --git a/gdb.spec b/gdb.spec index 7325dfb..cd09f34 100644 --- a/gdb.spec +++ b/gdb.spec @@ -27,7 +27,7 @@ Version: 7.11.1 # 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: 78%{?dist} +Release: 79%{?dist} License: GPLv3+ and GPLv3+ with exceptions and GPLv2+ and GPLv2+ with exceptions and GPL+ and LGPLv2+ and BSD and Public Domain and GFDL Group: Development/Debuggers @@ -583,6 +583,9 @@ Patch1129: gdb-bare-DW_TAG_lexical_block-2of2.patch # (Andrew Pinski, RH BZ 1363635). Patch1141: gdb-rhbz1363635-aarch64-armv8182.patch +# [dts60+el7] [x86*] Bundle linux_perf.h for libipt (RH BZ 1256513). +Patch1143: gdb-linux_perf-bundle.patch + %if 0%{!?rhel:1} || 0%{?rhel} > 6 # RL_STATE_FEDORA_GDB would not be found for: # Patch642: gdb-readline62-ask-more-rh.patch @@ -629,8 +632,6 @@ BuildRequires: guile-devel%{buildisa} %global have_libipt 1 %if 0%{?scl:1} BuildRequires: cmake -# RHEL-7.3 kernel Bug 1270539 -BuildRequires: kernel-headers >= 3.10.0-352.el7 %else BuildRequires: libipt-devel%{buildisa} %endif @@ -912,6 +913,7 @@ find -name "*.info*"|xargs rm -f %patch1128 -p1 %patch1129 -p1 %patch1141 -p1 +%patch1143 -p1 %patch1075 -p1 %if 0%{?rhel:1} && 0%{?rhel} <= 7 @@ -978,6 +980,11 @@ CFLAGS="$CFLAGS -DDNF_DEBUGINFO_INSTALL" CFLAGS="$CFLAGS -DGDB_INDEX_VERIFY_VENDOR" %endif +# [dts60+el7] [x86*] Bundle linux_perf.h for libipt (RH BZ 1256513). +%if 0%{?el7:1} && 0%{?scl:1} +CFLAGS="$CFLAGS -DPERF_ATTR_SIZE_VER5_BUNDLE" +%endif + # Patch642: gdb-readline62-ask-more-rh.patch %if 0%{!?rhel:1} || 0%{?rhel} > 6 CFLAGS="$CFLAGS -DNEED_RL_STATE_FEDORA_GDB" @@ -1450,6 +1457,9 @@ then fi %changelog +* Fri Aug 19 2016 Jan Kratochvil - 7.11.1-79.fc24 +- [dts60+el7] [x86*] Bundle linux_perf.h for libipt (RH BZ 1256513). + * Wed Aug 17 2016 Jan Kratochvil - 7.11.1-78.fc24 - [dts60+el7] [x86*] Bundle libipt (RH BZ 1256513). From b4d85c5451004a3a16ea099232b8c91cfdb22cc5 Mon Sep 17 00:00:00 2001 From: Jan Kratochvil Date: Mon, 22 Aug 2016 11:13:25 +0200 Subject: [PATCH 3/6] [dts] Upgrade libstdc++-v3-python to 6.1.1-20160817. --- .gitignore | 2 +- gdb.spec | 15 +++++++++------ sources | 2 +- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index d17dbf5..8bcd6f6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,3 @@ -/gdb-libstdc++-v3-python-r225521.tar.xz +/gdb-libstdc++-v3-python-6.1.1-20160817.tar.xz /v1.5.tar.gz /gdb-7.11.1.tar.xz diff --git a/gdb.spec b/gdb.spec index cd09f34..8b3e806 100644 --- a/gdb.spec +++ b/gdb.spec @@ -27,7 +27,7 @@ Version: 7.11.1 # 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: 79%{?dist} +Release: 80%{?dist} License: GPLv3+ and GPLv3+ with exceptions and GPLv2+ and GPLv2+ with exceptions and GPL+ and LGPLv2+ and BSD and Public Domain and GFDL Group: Development/Debuggers @@ -122,7 +122,7 @@ Source3: gdb-gstack.man Source4: gdbinit # libstdc++ pretty printers from GCC SVN. -%global libstdcxxpython gdb-libstdc++-v3-python-r225521 +%global libstdcxxpython gdb-libstdc++-v3-python-6.1.1-20160817 Source5: %{libstdcxxpython}.tar.xz # Provide gdbtui for RHEL-5 and RHEL-6 as it is removed upstream (BZ 797664). @@ -583,7 +583,7 @@ Patch1129: gdb-bare-DW_TAG_lexical_block-2of2.patch # (Andrew Pinski, RH BZ 1363635). Patch1141: gdb-rhbz1363635-aarch64-armv8182.patch -# [dts60+el7] [x86*] Bundle linux_perf.h for libipt (RH BZ 1256513). +# [dts+el7] [x86*] Bundle linux_perf.h for libipt (RH BZ 1256513). Patch1143: gdb-linux_perf-bundle.patch %if 0%{!?rhel:1} || 0%{?rhel} > 6 @@ -980,7 +980,7 @@ CFLAGS="$CFLAGS -DDNF_DEBUGINFO_INSTALL" CFLAGS="$CFLAGS -DGDB_INDEX_VERIFY_VENDOR" %endif -# [dts60+el7] [x86*] Bundle linux_perf.h for libipt (RH BZ 1256513). +# [dts+el7] [x86*] Bundle linux_perf.h for libipt (RH BZ 1256513). %if 0%{?el7:1} && 0%{?scl:1} CFLAGS="$CFLAGS -DPERF_ATTR_SIZE_VER5_BUNDLE" %endif @@ -1457,11 +1457,14 @@ then fi %changelog +* Mon Aug 22 2016 Jan Kratochvil - 7.11.1-80.fc24 +- [dts] Upgrade libstdc++-v3-python to 6.1.1-20160817. + * Fri Aug 19 2016 Jan Kratochvil - 7.11.1-79.fc24 -- [dts60+el7] [x86*] Bundle linux_perf.h for libipt (RH BZ 1256513). +- [dts+el7] [x86*] Bundle linux_perf.h for libipt (RH BZ 1256513). * Wed Aug 17 2016 Jan Kratochvil - 7.11.1-78.fc24 -- [dts60+el7] [x86*] Bundle libipt (RH BZ 1256513). +- [dts+el7] [x86*] Bundle libipt (RH BZ 1256513). * Wed Aug 3 2016 Jan Kratochvil - 7.11.1-77.fc24 - [aarch64] Fix ARMv8.1/v8.2 for hw watchpoint and breakpoint diff --git a/sources b/sources index c03498c..ff8cbe6 100644 --- a/sources +++ b/sources @@ -1,3 +1,3 @@ -7ad32d3894aaf90d00a4343a735c3e1c gdb-libstdc++-v3-python-r225521.tar.xz +131d0dfd20cd6014c168fbcab9be2c43 gdb-libstdc++-v3-python-6.1.1-20160817.tar.xz 29efc08219d9d6a0536d58f9807c8722 v1.5.tar.gz 5aa71522e488e358243917967db87476 gdb-7.11.1.tar.xz From 92d45fce5d8ba3e0ff5089d410c5810278c24dc2 Mon Sep 17 00:00:00 2001 From: Jan Kratochvil Date: Tue, 23 Aug 2016 09:22:28 +0200 Subject: [PATCH 4/6] [dts+el7] [x86*] Bundle libipt - fix its initialization (RH BZ 1256513). --- gdb-linux_perf-bundle.patch | 16 +++++++++++++++- gdb.spec | 5 ++++- v1.5-libipt-static.patch | 11 +++++++++++ 3 files changed, 30 insertions(+), 2 deletions(-) diff --git a/gdb-linux_perf-bundle.patch b/gdb-linux_perf-bundle.patch index b8bc3e8..aeb4f10 100644 --- a/gdb-linux_perf-bundle.patch +++ b/gdb-linux_perf-bundle.patch @@ -2,7 +2,7 @@ Index: gdb-7.11.1/gdb/nat/linux-btrace.h =================================================================== --- gdb-7.11.1.orig/gdb/nat/linux-btrace.h 2016-02-10 04:19:39.000000000 +0100 +++ gdb-7.11.1/gdb/nat/linux-btrace.h 2016-08-19 20:49:18.735477251 +0200 -@@ -28,6 +28,176 @@ +@@ -28,6 +28,177 @@ # include #endif @@ -11,6 +11,7 @@ Index: gdb-7.11.1/gdb/nat/linux-btrace.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 +/* @@ -205,3 +206,16 @@ Index: gdb-7.11.1/gdb/configure.ac #endif ]]), [perf_event=yes], [perf_event=no]) if test "$perf_event" != yes; then +--- gdb-7.11.1/gdb/gdb.c-orig 2016-02-10 04:19:39.000000000 +0100 ++++ gdb-7.11.1/gdb/gdb.c 2016-08-23 09:15:13.169650953 +0200 +@@ -25,6 +25,10 @@ main (int argc, char **argv) + { + struct captured_main_args args; + ++ // RHEL DTS bundle: ++ extern void __libipt_init(void); ++ __libipt_init(); ++ + memset (&args, 0, sizeof args); + args.argc = argc; + args.argv = argv; diff --git a/gdb.spec b/gdb.spec index 8b3e806..90b906c 100644 --- a/gdb.spec +++ b/gdb.spec @@ -27,7 +27,7 @@ Version: 7.11.1 # 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: 80%{?dist} +Release: 81%{?dist} License: GPLv3+ and GPLv3+ with exceptions and GPLv2+ and GPLv2+ with exceptions and GPL+ and LGPLv2+ and BSD and Public Domain and GFDL Group: Development/Debuggers @@ -1457,6 +1457,9 @@ then fi %changelog +* Tue Aug 23 2016 Jan Kratochvil - 7.11.1-81.fc24 +- [dts+el7] [x86*] Bundle libipt - fix its initialization (RH BZ 1256513). + * Mon Aug 22 2016 Jan Kratochvil - 7.11.1-80.fc24 - [dts] Upgrade libstdc++-v3-python to 6.1.1-20160817. diff --git a/v1.5-libipt-static.patch b/v1.5-libipt-static.patch index 93bc0f8..477b6c4 100644 --- a/v1.5-libipt-static.patch +++ b/v1.5-libipt-static.patch @@ -9,3 +9,14 @@ ${LIBIPT_FILES} ) +--- processor-trace-1.5/libipt/src/posix/init.c-orig 2016-04-07 08:52:14.000000000 +0200 ++++ processor-trace-1.5/libipt/src/posix/init.c 2016-08-23 09:04:11.540176668 +0200 +@@ -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(); From aacdec2a04901560801242fed1447fbd2e27e1da Mon Sep 17 00:00:00 2001 From: Jan Kratochvil Date: Tue, 23 Aug 2016 09:37:55 +0200 Subject: [PATCH 5/6] [dts+el7] [x86*] Bundle libipt - fix#2 its initialization (RH BZ 1256513). --- gdb-linux_perf-bundle.patch | 5 +++-- gdb.spec | 5 ++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/gdb-linux_perf-bundle.patch b/gdb-linux_perf-bundle.patch index aeb4f10..c280279 100644 --- a/gdb-linux_perf-bundle.patch +++ b/gdb-linux_perf-bundle.patch @@ -208,13 +208,14 @@ Index: gdb-7.11.1/gdb/configure.ac if test "$perf_event" != yes; then --- gdb-7.11.1/gdb/gdb.c-orig 2016-02-10 04:19:39.000000000 +0100 +++ gdb-7.11.1/gdb/gdb.c 2016-08-23 09:15:13.169650953 +0200 -@@ -25,6 +25,10 @@ main (int argc, char **argv) +@@ -25,6 +25,11 @@ main (int argc, char **argv) { struct captured_main_args args; -+ // RHEL DTS bundle: ++#ifdef PERF_ATTR_SIZE_VER5_BUNDLE + extern void __libipt_init(void); + __libipt_init(); ++#endif + memset (&args, 0, sizeof args); args.argc = argc; diff --git a/gdb.spec b/gdb.spec index 90b906c..9cba9e5 100644 --- a/gdb.spec +++ b/gdb.spec @@ -27,7 +27,7 @@ Version: 7.11.1 # 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: 81%{?dist} +Release: 82%{?dist} License: GPLv3+ and GPLv3+ with exceptions and GPLv2+ and GPLv2+ with exceptions and GPL+ and LGPLv2+ and BSD and Public Domain and GFDL Group: Development/Debuggers @@ -1457,6 +1457,9 @@ then fi %changelog +* Tue Aug 23 2016 Jan Kratochvil - 7.11.1-82.fc24 +- [dts+el7] [x86*] Bundle libipt - fix#2 its initialization (RH BZ 1256513). + * Tue Aug 23 2016 Jan Kratochvil - 7.11.1-81.fc24 - [dts+el7] [x86*] Bundle libipt - fix its initialization (RH BZ 1256513). From efdba24c8f9c2b4aed59624ac5a68132cc93a035 Mon Sep 17 00:00:00 2001 From: Jan Kratochvil Date: Tue, 23 Aug 2016 09:52:01 +0200 Subject: [PATCH 6/6] [dts+el7] [x86*] Bundle libipt - fix#3 its initialization (RH BZ 1256513). --- gdb.spec | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/gdb.spec b/gdb.spec index 9cba9e5..1bb7702 100644 --- a/gdb.spec +++ b/gdb.spec @@ -27,7 +27,7 @@ Version: 7.11.1 # 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: 82%{?dist} +Release: 83%{?dist} License: GPLv3+ and GPLv3+ with exceptions and GPLv2+ and GPLv2+ with exceptions and GPL+ and LGPLv2+ and BSD and Public Domain and GFDL Group: Development/Debuggers @@ -630,7 +630,7 @@ BuildRequires: guile-devel%{buildisa} %if 0%{!?rhel:1} || 0%{?rhel} > 7 || (0%{?rhel} == 7 && 0%{?scl:1}) %ifarch %{ix86} x86_64 %global have_libipt 1 -%if 0%{?scl:1} +%if 0%{?el7:1} && 0%{?scl:1} BuildRequires: cmake %else BuildRequires: libipt-devel%{buildisa} @@ -767,7 +767,7 @@ This package provides INFO, HTML and PDF user manual for GDB. tar xJf %{SOURCE5} %endif # 0%{?rhel:1} && 0%{?rhel} <= 7 -%if 0%{have_libipt} && 0%{?scl:1} +%if 0%{have_libipt} && 0%{?el7:1} && 0%{?scl:1} tar xzf %{SOURCE7} ( cd processor-trace-%{libipt_version} @@ -981,7 +981,7 @@ CFLAGS="$CFLAGS -DGDB_INDEX_VERIFY_VENDOR" %endif # [dts+el7] [x86*] Bundle linux_perf.h for libipt (RH BZ 1256513). -%if 0%{?el7:1} && 0%{?scl:1} +%if %{have_libipt} && 0%{?el7:1} && 0%{?scl:1} CFLAGS="$CFLAGS -DPERF_ATTR_SIZE_VER5_BUNDLE" %endif @@ -996,7 +996,7 @@ CFLAGS="$CFLAGS -DNEED_RL_STATE_FEDORA_GDB" CFLAGS="$CFLAGS -DNEED_DETACH_SIGSTOP" %endif -%if 0%{have_libipt} && 0%{?scl:1} +%if 0%{have_libipt} && 0%{?el7:1} && 0%{?scl:1} ( mkdir processor-trace-%{libipt_version}-root mkdir processor-trace-%{libipt_version}-build @@ -1457,6 +1457,9 @@ then fi %changelog +* Tue Aug 23 2016 Jan Kratochvil - 7.11.1-83.fc24 +- [dts+el7] [x86*] Bundle libipt - fix#3 its initialization (RH BZ 1256513). + * Tue Aug 23 2016 Jan Kratochvil - 7.11.1-82.fc24 - [dts+el7] [x86*] Bundle libipt - fix#2 its initialization (RH BZ 1256513).