From 0f874e353de65e4d26833cf328a695359b0d41ba Mon Sep 17 00:00:00 2001 From: Mark Wielaard Date: Thu, 15 Feb 2018 17:20:57 +0100 Subject: [PATCH] Add elfutils-0.170-m68k-packed-not-aligned.patch --- elfutils-0.170-m68k-packed-not-aligned.patch | 67 ++++++++++++++++++++ elfutils.spec | 3 + 2 files changed, 70 insertions(+) create mode 100644 elfutils-0.170-m68k-packed-not-aligned.patch diff --git a/elfutils-0.170-m68k-packed-not-aligned.patch b/elfutils-0.170-m68k-packed-not-aligned.patch new file mode 100644 index 0000000..d19426a --- /dev/null +++ b/elfutils-0.170-m68k-packed-not-aligned.patch @@ -0,0 +1,67 @@ +commit ab6b37ac32ddf2f2f11f800a770170814f5cbb8b +Author: Mark Wielaard +Date: Tue Oct 24 14:23:30 2017 +0200 + + backends: Ignore GCC8 -Wpacked-not-aligned for m68k_corenote.c. + + The GCC8 -Wpacked-not-aligned warns if a structure field with explicit + padding in a packed structure will be misaligned. m68k prstatus core + notes are described by a packed structure which has such aligned structure + fields. + + Signed-off-by: Mark Wielaard + +diff --git a/backends/Makefile.am b/backends/Makefile.am +index 0fde0cb..2c62add 100644 +--- a/backends/Makefile.am ++++ b/backends/Makefile.am +@@ -119,6 +119,13 @@ m68k_SRCS = m68k_init.c m68k_symbol.c m68k_regs.c \ + libebl_m68k_pic_a_SOURCES = $(m68k_SRCS) + am_libebl_m68k_pic_a_OBJECTS = $(m68k_SRCS:.c=.os) + ++# m68k prstatus core notes are described by a packed structure ++# which has not naturally aligned fields. Since we don't access ++# these fields directly, but take their offset to be used later ++# to extract the data through elfxx_xlatetom/memmove, this isn't ++# an issue. ++m68k_corenote_no_Wpacked_not_aligned = yes ++ + bpf_SRCS = bpf_init.c bpf_regs.c + cpu_bpf = ../libcpu/libcpu_bpf.a + libebl_bpf_pic_a_SOURCES = $(bpf_SRCS) +diff --git a/config/eu.am b/config/eu.am +index 796f388..05c27f0 100644 +--- a/config/eu.am ++++ b/config/eu.am +@@ -74,6 +74,7 @@ AM_CFLAGS = -std=gnu99 -Wall -Wshadow -Wformat=2 \ + $(if $($(*F)_no_Werror),,-Werror) \ + $(if $($(*F)_no_Wunused),,-Wunused -Wextra) \ + $(if $($(*F)_no_Wstack_usage),,$(STACK_USAGE_WARNING)) \ ++ $(if $($(*F)_no_Wpacked_not_aligned),-Wno-packed-not-aligned,) \ + $($(*F)_CFLAGS) + + COMPILE.os = $(filter-out -fprofile-arcs -ftest-coverage, $(COMPILE)) +--- elfutils-0.170/backends/Makefile.in.orig 2018-02-15 17:29:58.185213368 +0100 ++++ elfutils-0.170/backends/Makefile.in 2018-02-15 17:32:30.207695806 +0100 +@@ -421,6 +421,7 @@ + $(if $($(*F)_no_Werror),,-Werror) \ + $(if $($(*F)_no_Wunused),,-Wunused -Wextra) \ + $(if $($(*F)_no_Wstack_usage),,$(STACK_USAGE_WARNING)) \ ++ $(if $($(*F)_no_Wpacked_not_aligned),-Wno-packed-not-aligned,) \ + $($(*F)_CFLAGS) + + COMPILE.os = $(filter-out -fprofile-arcs -ftest-coverage, $(COMPILE)) +@@ -515,6 +516,13 @@ + + libebl_m68k_pic_a_SOURCES = $(m68k_SRCS) + am_libebl_m68k_pic_a_OBJECTS = $(m68k_SRCS:.c=.os) ++ ++# m68k prstatus core notes are described by a packed structure ++# which has not naturally aligned fields. Since we don't access ++# these fields directly, but take their offset to be used later ++# to extract the data through elfxx_xlatetom/memmove, this isn't ++# an issue. ++m68k_corenote_no_Wpacked_not_aligned = yes + bpf_SRCS = bpf_init.c bpf_regs.c + cpu_bpf = ../libcpu/libcpu_bpf.a + libebl_bpf_pic_a_SOURCES = $(bpf_SRCS) diff --git a/elfutils.spec b/elfutils.spec index ae87dd9..8f6b91d 100644 --- a/elfutils.spec +++ b/elfutils.spec @@ -23,6 +23,7 @@ Source: %{?source_url}%{name}-%{version}.tar.bz2 Patch1: elfutils-0.170-dwarf_aggregate_size.patch Source1: testfile-sizes3.o.bz2 Patch2: elfutils-0.170-sys-ptrace.patch +Patch3: elfutils-0.170-m68k-packed-not-aligned.patch Requires: elfutils-libelf%{depsuffix} = %{version}-%{release} Requires: elfutils-libs%{depsuffix} = %{version}-%{release} @@ -177,6 +178,7 @@ profiling) of processes. %patch1 -p1 -b .aggregate_size cp %SOURCE1 tests/ %patch2 -p1 -b .sys_ptrace +%patch3 -p1 -b .m68k_packed find . -name \*.sh ! -perm -0100 -print | xargs chmod +x @@ -315,6 +317,7 @@ fi * Thu Feb 15 2018 Mark Wielaard - Add elfutils-0.170-sys-ptrace.patch - Make sure spec can be build even when ldconfig_scriplets aren't defined. +- Add elfutils-0.170-m68k-packed-not-aligned.patch * Fri Feb 09 2018 Igor Gnatenko - 0.170-7 - Escape macros in %%changelog