diff --git a/bzip2-ldflags.patch b/bzip2-ldflags.patch new file mode 100644 index 0000000..2281262 --- /dev/null +++ b/bzip2-ldflags.patch @@ -0,0 +1,36 @@ +diff -up bzip2-1.0.6/Makefile.jx bzip2-1.0.6/Makefile +--- bzip2-1.0.6/Makefile.jx 2010-09-10 18:46:02.000000000 -0400 ++++ bzip2-1.0.6/Makefile 2015-08-14 13:04:33.891504131 -0400 +@@ -18,10 +18,6 @@ SHELL=/bin/sh + CC=gcc + AR=ar + RANLIB=ranlib +-LDFLAGS= +- +-BIGFILES=-D_FILE_OFFSET_BITS=64 +-CFLAGS=-Wall -Winline -O2 -g $(BIGFILES) + + # Where you want it installed when you do 'make install' + PREFIX=/usr/local +diff -up bzip2-1.0.6/Makefile-libbz2_so.jx bzip2-1.0.6/Makefile-libbz2_so +--- bzip2-1.0.6/Makefile-libbz2_so.jx 2015-08-14 13:04:33.885503955 -0400 ++++ bzip2-1.0.6/Makefile-libbz2_so 2015-08-14 13:06:52.554581179 -0400 +@@ -24,7 +24,6 @@ + SHELL=/bin/sh + CC=gcc + BIGFILES=-D_FILE_OFFSET_BITS=64 +-CFLAGS=-fpic -fPIC -Wall -Winline -O2 -g $(BIGFILES) + + OBJS= blocksort.o \ + huffman.o \ +@@ -35,8 +34,8 @@ OBJS= blocksort.o \ + bzlib.o + + all: $(OBJS) +- $(CC) $(CFLAGS) -shared -Wl,-soname -Wl,libbz2.so.1 -o libbz2.so.1.0.6 $(OBJS) +- $(CC) $(CFLAGS) -o bzip2-shared bzip2.c libbz2.so.1.0.6 ++ $(CC) $(CFLAGS) $(LDFLAGS) -shared -Wl,-soname -Wl,libbz2.so.1 -o libbz2.so.1.0.6 $(OBJS) ++ $(CC) $(CFLAGS) $(LDFLAGS) -o bzip2-shared bzip2.c libbz2.so.1.0.6 + rm -f libbz2.so.1.0 + ln -s libbz2.so.1.0.6 libbz2.so.1.0 + diff --git a/bzip2.spec b/bzip2.spec index 6bf6ac2..591fbe4 100644 --- a/bzip2.spec +++ b/bzip2.spec @@ -3,7 +3,7 @@ Summary: A file compression utility Name: bzip2 Version: 1.0.6 -Release: 16%{?dist} +Release: 17%{?dist} License: BSD Group: Applications/File URL: http://www.bzip.org/ @@ -13,6 +13,7 @@ Patch0: bzip2-1.0.4-saneso.patch Patch1: bzip2-1.0.4-cflags.patch # resolves: #226979 Patch2: bzip2-1.0.4-bzip2recover.patch +Patch3: bzip2-ldflags.patch %description Bzip2 is a freely available, patent-free, high quality data compressor. @@ -48,6 +49,7 @@ Libraries for applications using the bzip2 compression format. %patch0 -p1 -b .saneso %patch1 -p1 -b .cflags %patch2 -p1 -b .bz2recover +%patch3 -p1 -b .ldflags %build %if 0%{?rhel} >= 7 @@ -62,11 +64,13 @@ Libraries for applications using the bzip2 compression format. make -f Makefile-libbz2_so CC="%{__cc}" AR="%{__ar}" RANLIB="%{__ranlib}" \ CFLAGS="$RPM_OPT_FLAGS -D_FILE_OFFSET_BITS=64 -fpic -fPIC $O3" \ + LDFLAGS="%{__global_ldflags}" \ %{?_smp_mflags} all rm -f *.o make CC="%{__cc}" AR="%{__ar}" RANLIB="%{__ranlib}" \ CFLAGS="$RPM_OPT_FLAGS -D_FILE_OFFSET_BITS=64 $O3" \ + LDFLAGS="%{__global_ldflags}" \ %{?_smp_mflags} all %install @@ -115,6 +119,9 @@ ln -s bzgrep.1 $RPM_BUILD_ROOT%{_mandir}/man1/bzfgrep.1 %{_libdir}/*.so %changelog +* Fri Aug 14 2015 Adam Jackson 1.0.6-17 +- Pass ldflags through so hardening actually works + * Wed Jun 17 2015 Fedora Release Engineering - 1.0.6-16 - Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild