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