giflib/PIE.patch
Fridrich Strba 4df43f7333 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
2021-04-14 11:26:01 +00:00

22 lines
539 B
Diff

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)