summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'sys-libs/libselinux/files/0007-build-related-fixes-bug-500674-for-2.5.patch')
-rw-r--r--sys-libs/libselinux/files/0007-build-related-fixes-bug-500674-for-2.5.patch69
1 files changed, 69 insertions, 0 deletions
diff --git a/sys-libs/libselinux/files/0007-build-related-fixes-bug-500674-for-2.5.patch b/sys-libs/libselinux/files/0007-build-related-fixes-bug-500674-for-2.5.patch
new file mode 100644
index 000000000000..67e47ad40a67
--- /dev/null
+++ b/sys-libs/libselinux/files/0007-build-related-fixes-bug-500674-for-2.5.patch
@@ -0,0 +1,69 @@
+https://bugs.gentoo.org/500674
+
+random fixes:
+- make sure PCRE_CFLAGS get used
+- use PCRE_LIBS via pkg-config
+- move LDFLAGS to before objects, not after
+- do not hardcode -L$(LIBDIR) (let the toolchain handle it)
+- do not hardcode -I$(INCLUDEDIR) (let the toolchain handle it)
+
+diff -uNr libselinux-2.5.orig/src/Makefile libselinux-2.5/src/Makefile
+--- libselinux-2.5.orig/src/Makefile 2016-03-13 19:27:07.091000000 +0100
++++ libselinux-2.5/src/Makefile 2016-03-13 19:27:16.495000000 +0100
+@@ -73,7 +73,7 @@
+ -fipa-pure-const -Wno-suggest-attribute=pure -Wno-suggest-attribute=const \
+ -Werror -Wno-aggregate-return -Wno-redundant-decls
+
+-override CFLAGS += -I../include -I$(INCLUDEDIR) -D_GNU_SOURCE $(EMFLAGS)
++override CFLAGS += -I../include $(PCRE_CFLAGS) -D_GNU_SOURCE $(EMFLAGS)
+
+ SWIG_CFLAGS += -Wno-error -Wno-unused-variable -Wno-unused-but-set-variable -Wno-unused-parameter \
+ -Wno-shadow -Wno-uninitialized -Wno-missing-prototypes -Wno-missing-declarations
+@@ -102,17 +102,17 @@
+ $(CC) $(CFLAGS) $(SWIG_CFLAGS) $(RUBYINC) -fPIC -DSHARED -c -o $@ $<
+
+ $(SWIGSO): $(SWIGLOBJ)
+- $(CC) $(CFLAGS) -shared -o $@ $< -L. -lselinux $(LDFLAGS) -L$(LIBDIR)
++ $(CC) $(CFLAGS) $(LDFLAGS) -shared -o $@ $< -L. -lselinux
+
+ $(SWIGRUBYSO): $(SWIGRUBYLOBJ)
+- $(CC) $(CFLAGS) -shared -o $@ $^ -L. -lselinux $(LDFLAGS) -L$(LIBDIR)
++ $(CC) $(CFLAGS) $(LDFLAGS) -shared -o $@ $^ -L. -lselinux
+
+ $(LIBA): $(OBJS)
+ $(AR) rcs $@ $^
+ $(RANLIB) $@
+
+ $(LIBSO): $(LOBJS)
+- $(CC) $(CFLAGS) -shared -o $@ $^ -lpcre -ldl $(LDFLAGS) -L$(LIBDIR) -Wl,-soname,$(LIBSO),-z,defs,-z,relro
++ $(CC) $(CFLAGS) $(LDFLAGS) -shared -o $@ $^ -ldl $(PCRE_LIBS) -Wl,-soname,$(LIBSO),-z,defs,-z,relro
+ ln -sf $@ $(TARGET)
+
+ $(LIBPC): $(LIBPC).in ../VERSION
+@@ -125,7 +125,7 @@
+ $(CC) $(filter-out -Werror, $(CFLAGS)) $(PYINC) -fPIC -DSHARED -c -o $@ $<
+
+ $(AUDIT2WHYSO): $(AUDIT2WHYLOBJ)
+- $(CC) $(CFLAGS) -shared -o $@ $^ -L. $(LDFLAGS) -lselinux $(LIBDIR)/libsepol.a -L$(LIBDIR)
++ $(CC) $(CFLAGS) $(LDFLAGS) -shared -o $@ $^ -L. -lselinux $(LIBDIR)/libsepol.a
+
+ %.o: %.c policy.h
+ $(CC) $(CFLAGS) $(TLSFLAGS) -c -o $@ $<
+diff -uNr libselinux-2.5.orig/utils/Makefile libselinux-2.5/utils/Makefile
+--- libselinux-2.5.orig/utils/Makefile 2016-03-13 19:27:07.102000000 +0100
++++ libselinux-2.5/utils/Makefile 2016-03-13 19:27:40.297000000 +0100
+@@ -24,11 +24,12 @@
+ -fipa-pure-const -Wno-suggest-attribute=pure -Wno-suggest-attribute=const \
+ -Werror -Wno-aggregate-return -Wno-redundant-decls
+ override CFLAGS += -I../include -D_GNU_SOURCE $(EMFLAGS)
+-LDLIBS += -L../src -lselinux -L$(LIBDIR)
++LDLIBS += -L../src -lselinux
+
+ TARGETS=$(patsubst %.c,%,$(wildcard *.c))
+
+-sefcontext_compile: LDLIBS += -lpcre ../src/libselinux.a -lsepol
++sefcontext_compile: CFLAGS += $(PCRE_FLAGS)
++sefcontext_compile: LDLIBS += $(PCRE_LIBS) -lsepol ../src/libselinux.a
+
+ selinux_restorecon: LDLIBS += -lsepol
+