diff --git a/elfutils-0.170-sys-ptrace.patch b/elfutils-0.170-sys-ptrace.patch new file mode 100644 index 0000000..68eb415 --- /dev/null +++ b/elfutils-0.170-sys-ptrace.patch @@ -0,0 +1,113 @@ +commit 4482d0009a99b1773f2426479b666b08f57af9d5 +Author: Mark Wielaard +Date: Thu Feb 15 14:44:18 2018 +0100 + + Include sys/ptrace.h as early as possible. + + On some systems, at least on Fedora 27 ppc64le with glibc 2.26-24 and + kernel 4.14.18-300, including sys/ptrace.h late (after signal.h or + sys/wait.h for example) will cause issues and produce errors like: + + In file included from /usr/include/asm/sigcontext.h:12:0, + from /usr/include/bits/sigcontext.h:30, + from /usr/include/signal.h:287, + from /usr/include/sys/wait.h:36, + from linux-pid-attach.c:38: + /usr/include/sys/ptrace.h:73:3: error: expected identifier before numeric constant + PTRACE_GETREGS = 12, + ^ + + Swapping the include order fixes these issues. + + Signed-off-by: Mark Wielaard + +diff --git a/backends/ppc_initreg.c b/backends/ppc_initreg.c +index 69d623b..3e4432f 100644 +--- a/backends/ppc_initreg.c ++++ b/backends/ppc_initreg.c +@@ -30,13 +30,14 @@ + # include + #endif + +-#include "system.h" + #include + #if defined(__powerpc__) && defined(__linux__) +-# include + # include ++# include + #endif + ++#include "system.h" ++ + #define BACKEND ppc_ + #include "libebl_CPU.h" + +diff --git a/libdwfl/linux-pid-attach.c b/libdwfl/linux-pid-attach.c +index e6a5c41..2ab4109 100644 +--- a/libdwfl/linux-pid-attach.c ++++ b/libdwfl/linux-pid-attach.c +@@ -35,7 +35,6 @@ + #include + #include + #include +-#include + #include + #include + +@@ -43,6 +42,7 @@ + + #include + #include ++#include + + static bool + linux_proc_pid_is_stopped (pid_t pid) +diff --git a/tests/backtrace-child.c b/tests/backtrace-child.c +index 2c27414..9c6ba94 100644 +--- a/tests/backtrace-child.c ++++ b/tests/backtrace-child.c +@@ -81,7 +81,6 @@ + #include + #include + #include +-#include + #include + #include + #include +@@ -100,6 +99,7 @@ main (int argc __attribute__ ((unused)), char **argv) + + #else /* __linux__ */ + #include ++#include + + #if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5) + #define NOINLINE_NOCLONE __attribute__ ((noinline, noclone)) +diff --git a/tests/backtrace-dwarf.c b/tests/backtrace-dwarf.c +index 2dc8a9a..7ff826c 100644 +--- a/tests/backtrace-dwarf.c ++++ b/tests/backtrace-dwarf.c +@@ -17,7 +17,6 @@ + + #include + #include +-#include + #include + #include + #include +@@ -25,7 +24,6 @@ + #include + #include + #include +-#include + #include ELFUTILS_HEADER(dwfl) + + #ifndef __linux__ +@@ -40,6 +38,8 @@ main (int argc __attribute__ ((unused)), char **argv) + + #else /* __linux__ */ + #include ++#include ++#include + + #define main cleanup_13_main + #include "cleanup-13.c" diff --git a/elfutils.spec b/elfutils.spec index d300fb8..53a63ff 100644 --- a/elfutils.spec +++ b/elfutils.spec @@ -22,6 +22,7 @@ Source: %{?source_url}%{name}-%{version}.tar.bz2 # Patches Patch1: elfutils-0.170-dwarf_aggregate_size.patch Source1: testfile-sizes3.o.bz2 +Patch2: elfutils-0.170-sys-ptrace.patch Requires: elfutils-libelf%{depsuffix} = %{version}-%{release} Requires: elfutils-libs%{depsuffix} = %{version}-%{release} @@ -175,6 +176,7 @@ profiling) of processes. # Apply patches %patch1 -p1 -b .aggregate_size cp %SOURCE1 tests/ +%patch2 -p1 -b .sys_ptrace find . -name \*.sh ! -perm -0100 -print | xargs chmod +x @@ -301,6 +303,9 @@ fi %endif %changelog +* Thu Feb 15 2018 Mark Wielaard +- Add elfutils-0.170-sys-ptrace.patch + * Fri Feb 09 2018 Igor Gnatenko - 0.170-7 - Escape macros in %%changelog