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
This commit is contained in:
Fridrich Strba 2021-04-14 11:26:01 +00:00 committed by Git OBS Bridge
parent b1060181e9
commit 4df43f7333
2 changed files with 24 additions and 2 deletions

21
PIE.patch Normal file
View File

@ -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)

View File

@ -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