Really enable hardening flags
authorAndreas Tille <tille@debian.org>
Sat, 12 May 2012 06:38:37 +0000 (08:38 +0200)
committerAndreas Tille <tille@debian.org>
Sat, 12 May 2012 06:38:37 +0000 (08:38 +0200)
debian/changelog
debian/patches/use-dpkg-buildflags.patch

index caa61b52942177bab8ab100ce7d733fe4f71d2fb..f788d41a1bb8b02f1de978dfb13ccbdf714ea896 100644 (file)
@@ -3,6 +3,9 @@ tabix (0.2.5-3) UNRELEASED; urgency=low
   * debian/patches/ld-as-needed.patch:  Enable building with --as-needed
     (Thanks to David Shorten <dpshorten@gmail.com> for the patch)
     Closes: #632150
+  * debian/patches/use-dpkg-buildflags.patch: Really enable hardening
+    build flags (Thanks for the patch to Simon Ruderich <simon@ruderich.org>)
+    Closes: #670759
 
  -- Andreas Tille <tille@debian.org>  Fri, 11 May 2012 13:32:56 +0200
 
index 7856be77141317edecfb3da84e7dbc08fc925fa7..7ece66bd6d07fdf4395ef65a81736e63e7032318 100644 (file)
@@ -1,11 +1,49 @@
+Author: Simon Ruderich <simon@ruderich.org>
+Date: Sat, 28 Apr 2012 19:09:02 UTC
+Description: Fix build system to enable hardening flags
+
 --- tabix.orig/Makefile
 +++ tabix/Makefile
-@@ -12,7 +12,7 @@
+@@ -1,5 +1,8 @@
+ CC=                   gcc
+-CFLAGS=               -g -Wall -O2 -fPIC #-m64 #-arch ppc
++# Use flags when CFLAGS is not already defined in the environment.
++CFLAGS?=              -g -Wall -O2
++# But always append special flags we need.
++CFLAGS+= -fPIC #-m64 #-arch ppc
+ DFLAGS=               -D_FILE_OFFSET_BITS=64 -D_USE_KNETFILE
+ LOBJS=                bgzf.o kstring.o knetfile.o index.o bedidx.o
+ AOBJS=                main.o
+@@ -12,7 +15,7 @@
  .SUFFIXES:.c .o
  
  .c.o:
 -              $(CC) -c $(CFLAGS) $(DFLAGS) $(INCLUDES) $< -o $@
-+              $(CC) -c $(CPPFLAGS) $(CFLAGS) $(CXXFLAGS) $(DFLAGS) $(LDFLAGS) $(INCLUDES) $< -o $@
++              $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DFLAGS) $(INCLUDES) $< -o $@
  
  all-recur lib-recur clean-recur cleanlocal-recur install-recur:
                @target=`echo $@ | sed s/-recur//`; \
+@@ -29,19 +32,19 @@
+ lib:libtabix.a
+ libtabix.so.1:$(LOBJS)
+-              $(CC) -shared -Wl,-soname,libtabix.so -o $@ $(LOBJS) -lc -lz
++              $(CC) $(CFLAGS) $(LDFLAGS) -shared -Wl,-soname,libtabix.so -o $@ $(LOBJS) -lc -lz
+ libtabix.1.dylib:$(LOBJS)
+-              libtool -dynamic $(LOBJS) -o $@ -lc -lz
++              libtool $(CFLAGS) $(LDFLAGS) -dynamic $(LOBJS) -o $@ -lc -lz
+ libtabix.a:$(LOBJS)
+               $(AR) -cru $@ $(LOBJS)
+ tabix:lib $(AOBJS)
+-              $(CC) $(CFLAGS) -o $@ $(AOBJS) -lm $(LIBPATH) -lz -L. -ltabix
++              $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(AOBJS) -lm $(LIBPATH) -lz -L. -ltabix
+ bgzip:bgzip.o bgzf.o knetfile.o
+-              $(CC) $(CFLAGS) -o $@ bgzip.o bgzf.o knetfile.o -lz
++              $(CC) $(CFLAGS) $(LDFLAGS) -o $@ bgzip.o bgzf.o knetfile.o -lz
+ TabixReader.class:TabixReader.java
+               javac -cp .:sam.jar TabixReader.java