From 978f5408fde8bf072973c7e73d9b62728a58a57248f41302f4a243105e8823b3 Mon Sep 17 00:00:00 2001 From: Fridrich Strba Date: Wed, 14 Apr 2021 11:26:01 +0000 Subject: [PATCH] Accepting request 885313 from home:wfrisch:branches:devel:libraries:c_c++ Enable Position Independent Code and inherit CFLAGS from the build system. FYI: The package fails to build on SLE_12_SP5 and I'm not sure why. OBS-URL: https://build.opensuse.org/request/show/885313 OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/giflib?expand=0&rev=53 --- PIE.patch | 21 +++++++++++++++++++++ giflib.spec | 5 +++-- 2 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 PIE.patch diff --git a/PIE.patch b/PIE.patch new file mode 100644 index 0000000..c5a1cc1 --- /dev/null +++ b/PIE.patch @@ -0,0 +1,21 @@ +Index: a/Makefile +=================================================================== +--- a/Makefile ++++ b/Makefile +@@ -8,7 +8,7 @@ + # + OFLAGS = -O0 -g + OFLAGS = -O2 +-CFLAGS = -std=gnu99 -fPIC -Wall -Wno-format-truncation $(OFLAGS) ++CFLAGS += -std=gnu99 -fPIC -Wall -Wno-format-truncation $(OFLAGS) + + SHELL = /bin/sh + TAR = tar +@@ -64,6 +64,7 @@ LDLIBS=libgif.a -lm + all: libgif.so libgif.a libutil.so libutil.a $(UTILS) + $(MAKE) -C doc + ++$(UTILS):: LDFLAGS += -pie + $(UTILS):: libgif.a libutil.a + + libgif.so: $(OBJECTS) $(HEADERS) diff --git a/giflib.spec b/giflib.spec index c7b79b0..24f8a63 100644 --- a/giflib.spec +++ b/giflib.spec @@ -1,7 +1,7 @@ # # spec file for package giflib # -# Copyright (c) 2020 SUSE LLC +# Copyright (c) 2021 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -25,6 +25,7 @@ License: MIT URL: http://giflib.sf.net/ Source: http://downloads.sf.net/giflib/%{name}-%{version}.tar.gz Source2: baselibs.conf +Patch1: PIE.patch BuildRequires: libtool >= 2 %description @@ -55,7 +56,7 @@ This Library allows manipulating GIF Image files. Since the LZW patents have expired, giflib can again be used instead of libungif. %prep -%autosetup +%autosetup -p1 for file in `find util -name "*.c"`; do touch -r $file $file.stamp done