Accepting request 698204 from devel:libraries:c_c++

- Allow LTO but only FAT LTO OBJECTS (boo#1133245)

- Add patch libsigsegv-2.12-lto.dif
  * Avoid redefinition of structures of <bits/sigcontext.h> by
    <asm/sigcontext.h>
  * Avoid moved logic in resulting assembler code for LTO objects
    in signal handler for segmentation faults

- Avoid none debugging libsigsegv, that is add -fno-lto (boo#1133245)
- Use %license if known

- Disable LTO (boo#1133245).

OBS-URL: https://build.opensuse.org/request/show/698204
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/libsigsegv?expand=0&rev=8
This commit is contained in:
Yuchen Lin 2019-04-28 17:59:08 +00:00 committed by Git OBS Bridge
commit 2d636b0285
3 changed files with 249 additions and 3 deletions

201
libsigsegv-2.12-lto.dif Normal file
View File

@ -0,0 +1,201 @@
---
configure | 42 +++++++++++++++++++++++++++---------------
1 file changed, 27 insertions(+), 15 deletions(-)
--- configure
+++ configure 2019-04-25 13:27:06.323370748 +0000
@@ -12587,7 +12587,7 @@ static int zero_fd;
# define SIGSEGV_FAULT_ADDRESS_ROUNDOFF_BITS 0UL
#endif
unsigned long page;
-int handler_called = 0;
+volatile sig_atomic_t handler_called = 0;
void sigsegv_handler (int sig, siginfo_t *sip, void *ucp)
{
void *fault_address = (void *) (sip->si_addr);
@@ -12683,7 +12683,9 @@ else
#include <signal.h>
+#ifndef _DEFAULT_SOURCE
#include <asm/sigcontext.h>
+#endif
void sigsegv_handler (int sig, struct sigcontext sc)
{
void *fault_address = (void *) (sc.cr2);
@@ -12718,7 +12720,9 @@ else
#if HAVE_SYS_SIGNAL_H
# include <sys/signal.h>
#endif
+#ifndef _DEFAULT_SOURCE
#include <asm/sigcontext.h>
+#endif
#include <sys/types.h>
#include <sys/mman.h>
#if HAVE_MMAP_DEVZERO
@@ -12750,7 +12754,7 @@ static int zero_fd;
# define SIGSEGV_FAULT_ADDRESS_ROUNDOFF_BITS 0UL
#endif
unsigned long page;
-int handler_called = 0;
+volatile sig_atomic_t handler_called = 0;
void sigsegv_handler (int sig, struct sigcontext sc)
{
void *fault_address = (void *) (sc.cr2);
@@ -12915,7 +12919,7 @@ static int zero_fd;
# define SIGSEGV_FAULT_ADDRESS_ROUNDOFF_BITS 0UL
#endif
unsigned long page;
-int handler_called = 0;
+volatile sig_atomic_t handler_called = 0;
void sigsegv_handler (int sig, unsigned int more)
{
void *fault_address = (void *) (((unsigned long *) &more) [21]);
@@ -13013,7 +13017,9 @@ else
#include <signal.h>
+#ifndef _DEFAULT_SOURCE
#include <asm/sigcontext.h>
+#endif
#include "$srcdir/src/fault-linux-m68k-old.c"
void sigsegv_handler (int sig, int code, struct sigcontext *scp)
{
@@ -13049,7 +13055,9 @@ else
#if HAVE_SYS_SIGNAL_H
# include <sys/signal.h>
#endif
+#ifndef _DEFAULT_SOURCE
#include <asm/sigcontext.h>
+#endif
#include "$srcdir/src/fault-linux-m68k-old.c"
#include <sys/types.h>
#include <sys/mman.h>
@@ -13082,7 +13090,7 @@ static int zero_fd;
# define SIGSEGV_FAULT_ADDRESS_ROUNDOFF_BITS 0UL
#endif
unsigned long page;
-int handler_called = 0;
+volatile sig_atomic_t handler_called = 0;
void sigsegv_handler (int sig, int code, struct sigcontext *scp)
{
void *fault_address = (void *) (get_fault_addr (scp));
@@ -13180,7 +13188,9 @@ else
#include <signal.h>
+#ifndef _DEFAULT_SOURCE
#include <asm/sigcontext.h>
+#endif
void sigsegv_handler (int sig, struct sigcontext *scp)
{
void *fault_address = (void *) (scp->regs->dar);
@@ -13215,7 +13225,9 @@ else
#if HAVE_SYS_SIGNAL_H
# include <sys/signal.h>
#endif
+#ifndef _DEFAULT_SOURCE
#include <asm/sigcontext.h>
+#endif
#include <sys/types.h>
#include <sys/mman.h>
#if HAVE_MMAP_DEVZERO
@@ -13247,7 +13259,7 @@ static int zero_fd;
# define SIGSEGV_FAULT_ADDRESS_ROUNDOFF_BITS 0UL
#endif
unsigned long page;
-int handler_called = 0;
+volatile sig_atomic_t handler_called = 0;
void sigsegv_handler (int sig, struct sigcontext *scp)
{
void *fault_address = (void *) (scp->regs->dar);
@@ -13413,7 +13425,7 @@ static int zero_fd;
# define SIGSEGV_FAULT_ADDRESS_ROUNDOFF_BITS 0UL
#endif
unsigned long page;
-int handler_called = 0;
+volatile sig_atomic_t handler_called = 0;
void sigsegv_handler (int sig, siginfo_t *sip, void *ucp)
{
void *fault_address = (void *) (sip->si_ptr);
@@ -13576,7 +13588,7 @@ static int zero_fd;
# define SIGSEGV_FAULT_ADDRESS_ROUNDOFF_BITS 0UL
#endif
unsigned long page;
-int handler_called = 0;
+volatile sig_atomic_t handler_called = 0;
void sigsegv_handler (int sig, int code, struct sigcontext *scp, void *addr)
{
void *fault_address = (void *) (addr);
@@ -13741,7 +13753,7 @@ static int zero_fd;
# define SIGSEGV_FAULT_ADDRESS_ROUNDOFF_BITS 0UL
#endif
unsigned long page;
-int handler_called = 0;
+volatile sig_atomic_t handler_called = 0;
void sigsegv_handler (int sig, int code, struct sigcontext *scp)
{
void *fault_address = (void *) ((unsigned long) scp->sc_badvaddr);
@@ -13916,7 +13928,7 @@ static int zero_fd;
# define SIGSEGV_FAULT_ADDRESS_ROUNDOFF_BITS 0UL
#endif
unsigned long page;
-int handler_called = 0;
+volatile sig_atomic_t handler_called = 0;
void sigsegv_handler (int sig, int code, struct sigcontext *scp)
{
void *fault_address = (void *) (GET_CR21 (scp->sc_sl.sl_ss));
@@ -14081,7 +14093,7 @@ static int zero_fd;
# define SIGSEGV_FAULT_ADDRESS_ROUNDOFF_BITS 0UL
#endif
unsigned long page;
-int handler_called = 0;
+volatile sig_atomic_t handler_called = 0;
void sigsegv_handler (int sig, int code, struct sigcontext *scp)
{
void *fault_address = (void *) (scp->sc_traparg_a0);
@@ -14246,7 +14258,7 @@ static int zero_fd;
# define SIGSEGV_FAULT_ADDRESS_ROUNDOFF_BITS 0UL
#endif
unsigned long page;
-int handler_called = 0;
+volatile sig_atomic_t handler_called = 0;
void sigsegv_handler (int sig, int code, struct sigcontext *scp)
{
void *fault_address = (void *) (get_fault_addr (scp));
@@ -14411,7 +14423,7 @@ static int zero_fd;
# define SIGSEGV_FAULT_ADDRESS_ROUNDOFF_BITS 0UL
#endif
unsigned long page;
-int handler_called = 0;
+volatile sig_atomic_t handler_called = 0;
void sigsegv_handler (int sig, int code, struct sigcontext *scp)
{
void *fault_address = (void *) (scp->sc_jmpbuf.jmp_context.o_vaddr);
@@ -14577,7 +14589,7 @@ static int zero_fd;
# define SIGSEGV_FAULT_ADDRESS_ROUNDOFF_BITS 0UL
#endif
unsigned long page;
-int handler_called = 0;
+volatile sig_atomic_t handler_called = 0;
void sigsegv_handler (int sig, siginfo_t *sip, ucontext_t *ucp)
{
void *fault_address = (void *) (get_fault_addr (sip, ucp));
@@ -14741,7 +14753,7 @@ static int zero_fd;
# define SIGSEGV_FAULT_ADDRESS_ROUNDOFF_BITS 0UL
#endif
unsigned long page;
-int handler_called = 0;
+volatile sig_atomic_t handler_called = 0;
void sigsegv_handler (int sig, int code, struct sigcontext *scp)
{
void *fault_address = (void *) (get_fault_addr (scp));
@@ -14907,7 +14919,7 @@ static int zero_fd;
# define SIGSEGV_FAULT_ADDRESS_ROUNDOFF_BITS 0UL
#endif
unsigned long page;
-int handler_called = 0;
+volatile sig_atomic_t handler_called = 0;
void sigsegv_handler (int sig, int code, struct sigcontext *scp)
{
void *fault_address = (void *) (code);

View File

@ -1,3 +1,28 @@
-------------------------------------------------------------------
Fri Apr 26 11:19:16 UTC 2019 - Dr. Werner Fink <werner@suse.de>
- Allow LTO but only FAT LTO OBJECTS (boo#1133245)
-------------------------------------------------------------------
Thu Apr 25 11:18:04 UTC 2019 - Dr. Werner Fink <werner@suse.de>
- Add patch libsigsegv-2.12-lto.dif
* Avoid redefinition of structures of <bits/sigcontext.h> by
<asm/sigcontext.h>
* Avoid moved logic in resulting assembler code for LTO objects
in signal handler for segmentation faults
-------------------------------------------------------------------
Thu Apr 25 06:34:02 UTC 2019 - Dr. Werner Fink <werner@suse.de>
- Avoid none debugging libsigsegv, that is add -fno-lto (boo#1133245)
- Use %license if known
-------------------------------------------------------------------
Wed Apr 24 17:18:04 UTC 2019 - Martin Liška <mliska@suse.cz>
- Disable LTO (boo#1133245).
-------------------------------------------------------------------
Thu Feb 1 20:16:44 UTC 2018 - astieger@suse.com

View File

@ -1,7 +1,7 @@
#
# spec file for package libsigsegv
#
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -12,7 +12,7 @@
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
@ -22,14 +22,18 @@ Name: libsigsegv
Version: 2.12
Release: 0
Summary: Library for Handling Page Faults in User Mode
License: GPL-2.0+
License: GPL-2.0-or-later
Group: System/Libraries
Url: https://www.gnu.org/software/libsigsegv/
Source0: https://ftp.gnu.org/pub/gnu/libsigsegv/libsigsegv-%{version}.tar.gz
Source1: https://ftp.gnu.org/pub/gnu/libsigsegv/libsigsegv-%{version}.tar.gz.sig
Source2: https://savannah.gnu.org/project/memberlist-gpgkeys.php?group=%{name}&download=1#/%{name}.keyring
Patch0: libsigsegv-2.12-lto.dif
BuildRequires: pkgconfig
%define add_optflags(a:f:t:p:w:W:d:g:O:A:C:D:E:H:i:M:n:P:U:u:l:s:X:B:I:L:b:V:m:x:c:S:E:o:v:) \
%global optflags %{optflags} %{**}
%description
This is a library for handling page faults in user mode. A page fault occurs
when a program tries to access to a region of memory that is currently not
@ -65,11 +69,22 @@ available.
%prep
%setup -q
%patch0 -b .p0
%build
%add_optflags -g3 -D_DEFAULT_SOURCE -D_XOPEN_SOURCE
%if 0%(case "%optflags" in (*-flto*) echo 1;; esac)
%add_optflags -ffat-lto-objects
%endif
%configure \
--with-gnu-ld \
--enable-shared \
--enable-static
sed -ri 's@^((old_striplib|striplib)=)".*"@\1""@' libtool
sed -ri 's@^(hardcode_libdir_flag_spec=)".*"@\1""@' libtool
mkdir bin/
ln -sf /bin/true bin/strip
PATH=${PWD}/bin:$PATH; export PATH
make %{?_smp_mflags}
%install
@ -88,7 +103,12 @@ make %{?_smp_mflags} check
%postun -n %{lname} -p /sbin/ldconfig
%files doc
%if %{defined license}
%license COPYING
%doc AUTHORS ChangeLog* NEWS PORTING README
%else
%doc AUTHORS COPYING ChangeLog* NEWS PORTING README
%endif
%files -n %{lname}
%{_libdir}/libsigsegv.so.%{somajor}*