[med-svn] [libzstd] 03/03: patch: Ensure CPPFLAGS isn't overwritten

Kevin Murray daube-guest at moszumanska.debian.org
Mon Nov 14 00:52:20 UTC 2016


This is an automated email from the git hooks/post-receive script.

daube-guest pushed a commit to branch master
in repository libzstd.

commit 8ca998e438e1b06545cc3431e38ef19db9a7dcda
Author: Kevin Murray <spam at kdmurray.id.au>
Date:   Mon Nov 14 11:50:49 2016 +1100

    patch: Ensure CPPFLAGS isn't overwritten
---
 debian/changelog                                   |  1 +
 debian/patches/0001-Skip-long-running-tests.patch  |  4 +-
 debian/patches/0002-Build-lib-by-default.patch     |  8 +-
 ... => 0003-Add-symlinks-for-extra-manpages.patch} |  0
 ...ch => 0004-Add-help2man-d-pzstd-man-file.patch} |  0
 ...-Ensure-CPPFLAGS-makes-it-to-the-compiler.patch | 88 ++++++++++++++++++++++
 debian/patches/series                              |  5 +-
 7 files changed, 100 insertions(+), 6 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index df1241f..fb680ac 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -2,6 +2,7 @@ libzstd (1.1.1-1) UNRELEASED; urgency=medium
 
   * New upstream version 1.1.1 (Closes: #844248)
   * Whitespace fix to d/control
+  * Ensure hardening flags pass through to compiler by appending to CPPFLAGS
 
  -- Kevin Murray <kdmfoss at gmail.com>  Sun, 13 Nov 2016 23:03:48 +1100
 
diff --git a/debian/patches/0001-Skip-long-running-tests.patch b/debian/patches/0001-Skip-long-running-tests.patch
index c27d646..cd109c5 100644
--- a/debian/patches/0001-Skip-long-running-tests.patch
+++ b/debian/patches/0001-Skip-long-running-tests.patch
@@ -6,9 +6,11 @@ Subject: Skip long-running tests
  tests/Makefile | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
 
+diff --git a/tests/Makefile b/tests/Makefile
+index ecff182..5fe05cb 100644
 --- a/tests/Makefile
 +++ b/tests/Makefile
-@@ -169,11 +169,11 @@
+@@ -169,11 +169,11 @@ ifneq (,$(filter $(HOST_OS),MSYS POSIX))
  zstd-playTests: datagen
  	ZSTD=$(ZSTD) ./playTests.sh $(ZSTDRTTEST)
  
diff --git a/debian/patches/0002-Build-lib-by-default.patch b/debian/patches/0002-Build-lib-by-default.patch
index 987a101..fcd23b4 100644
--- a/debian/patches/0002-Build-lib-by-default.patch
+++ b/debian/patches/0002-Build-lib-by-default.patch
@@ -3,12 +3,14 @@ Date: Tue, 1 Dec 2015 14:52:40 +1100
 Subject: Build lib by default
 
 ---
- Makefile | 6 +++---
- 1 file changed, 3 insertions(+), 3 deletions(-)
+ Makefile | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
 
+diff --git a/Makefile b/Makefile
+index 20ae31e..589192a 100644
 --- a/Makefile
 +++ b/Makefile
-@@ -26,8 +26,8 @@
+@@ -26,8 +26,8 @@ default: libzstd zstd
  
  all:
  	$(MAKE) -C $(ZSTDDIR) $@
diff --git a/debian/patches/0004-Add-symlinks-for-extra-manpages.patch b/debian/patches/0003-Add-symlinks-for-extra-manpages.patch
similarity index 100%
rename from debian/patches/0004-Add-symlinks-for-extra-manpages.patch
rename to debian/patches/0003-Add-symlinks-for-extra-manpages.patch
diff --git a/debian/patches/0005-Add-help2man-d-pzstd-man-file.patch b/debian/patches/0004-Add-help2man-d-pzstd-man-file.patch
similarity index 100%
rename from debian/patches/0005-Add-help2man-d-pzstd-man-file.patch
rename to debian/patches/0004-Add-help2man-d-pzstd-man-file.patch
diff --git a/debian/patches/0005-Ensure-CPPFLAGS-makes-it-to-the-compiler.patch b/debian/patches/0005-Ensure-CPPFLAGS-makes-it-to-the-compiler.patch
new file mode 100644
index 0000000..5121b07
--- /dev/null
+++ b/debian/patches/0005-Ensure-CPPFLAGS-makes-it-to-the-compiler.patch
@@ -0,0 +1,88 @@
+From: Kevin Murray <spam at kdmurray.id.au>
+Date: Mon, 14 Nov 2016 10:44:27 +1100
+Subject: Ensure CPPFLAGS makes it to the compiler
+
+---
+ lib/Makefile         | 11 +++++------
+ programs/Makefile    |  5 ++---
+ tests/Makefile       |  5 ++---
+ zlibWrapper/Makefile |  4 ++--
+ 4 files changed, 11 insertions(+), 14 deletions(-)
+
+diff --git a/lib/Makefile b/lib/Makefile
+index 1117b49..eecd37f 100644
+--- a/lib/Makefile
++++ b/lib/Makefile
+@@ -23,9 +23,8 @@ PREFIX ?= /usr/local
+ LIBDIR ?= $(PREFIX)/lib
+ INCLUDEDIR=$(PREFIX)/include
+ 
+-CPPFLAGS= -I. -I./common
+-CFLAGS ?= -O3
+-CFLAGS += -Wall -Wextra -Wcast-qual -Wcast-align -Wshadow -Wstrict-aliasing=1 \
++CPPFLAGS += -I. -I./common
++CFLAGS += -O3 -Wall -Wextra -Wcast-qual -Wcast-align -Wshadow -Wstrict-aliasing=1 \
+           -Wswitch-enum -Wdeclaration-after-statement -Wstrict-prototypes -Wundef
+ FLAGS   = $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) $(MOREFLAGS)
+ 
+@@ -63,10 +62,10 @@ all: clean libzstd
+ 
+ libzstd: $(ZSTD_FILES)
+ 	@echo compiling static library
+-	@$(CC) $(FLAGS) -c $^
+-	@$(AR) rcs $@.a *.o
++	$(CC) $(FLAGS) -c $^
++	$(AR) rcs $@.a *.o
+ 	@echo compiling dynamic library $(LIBVER)
+-	@$(CC) $(FLAGS) -shared $^ -fPIC $(SONAME_FLAGS) -o $@.$(SHARED_EXT_VER)
++	$(CC) $(FLAGS) -shared $^ -fPIC $(SONAME_FLAGS) -o $@.$(SHARED_EXT_VER)
+ 	@echo creating versioned links
+ 	@ln -sf $@.$(SHARED_EXT_VER) $@.$(SHARED_EXT_MAJOR)
+ 	@ln -sf $@.$(SHARED_EXT_VER) $@.$(SHARED_EXT)
+diff --git a/programs/Makefile b/programs/Makefile
+index f5e625f..c9eddb1 100644
+--- a/programs/Makefile
++++ b/programs/Makefile
+@@ -27,9 +27,8 @@ else
+ ALIGN_LOOP =
+ endif
+ 
+-CPPFLAGS= -I$(ZSTDDIR) -I$(ZSTDDIR)/common -I$(ZSTDDIR)/dictBuilder
+-CFLAGS ?= -O3
+-CFLAGS += -Wall -Wextra -Wcast-qual -Wcast-align -Wshadow -Wstrict-aliasing=1 \
++CPPFLAGS += -I$(ZSTDDIR) -I$(ZSTDDIR)/common -I$(ZSTDDIR)/dictBuilder
++CFLAGS += -O3 -Wall -Wextra -Wcast-qual -Wcast-align -Wshadow -Wstrict-aliasing=1 \
+           -Wswitch-enum -Wdeclaration-after-statement -Wstrict-prototypes -Wundef
+ CFLAGS += $(MOREFLAGS)
+ FLAGS   = $(CPPFLAGS) $(CFLAGS) $(LDFLAGS)
+diff --git a/tests/Makefile b/tests/Makefile
+index 5fe05cb..e2df117 100644
+--- a/tests/Makefile
++++ b/tests/Makefile
+@@ -30,9 +30,8 @@ PYTHON ?= python3
+ TESTARTEFACT := versionsTest namespaceTest
+ 
+ 
+-CPPFLAGS= -I$(ZSTDDIR) -I$(ZSTDDIR)/common -I$(ZSTDDIR)/dictBuilder -I$(PRGDIR)
+-CFLAGS ?= -O3
+-CFLAGS += -Wall -Wextra -Wcast-qual -Wcast-align -Wshadow -Wstrict-aliasing=1 \
++CPPFLAGS += -I$(ZSTDDIR) -I$(ZSTDDIR)/common -I$(ZSTDDIR)/dictBuilder -I$(PRGDIR)
++CFLAGS += -O3 -Wall -Wextra -Wcast-qual -Wcast-align -Wshadow -Wstrict-aliasing=1 \
+           -Wswitch-enum -Wdeclaration-after-statement -Wstrict-prototypes -Wundef
+ CFLAGS += $(MOREFLAGS)
+ FLAGS   = $(CPPFLAGS) $(CFLAGS) $(LDFLAGS)
+diff --git a/zlibWrapper/Makefile b/zlibWrapper/Makefile
+index 0e4ca9e..56b5534 100644
+--- a/zlibWrapper/Makefile
++++ b/zlibWrapper/Makefile
+@@ -16,8 +16,8 @@ EXAMPLE_PATH = examples
+ PROGRAMS_PATH = ../programs
+ TEST_FILE = ../doc/zstd_compression_format.md
+ CC ?= gcc
+-CFLAGS ?= -O3 
+-CFLAGS += $(LOC) -I$(PROGRAMS_PATH) -I$(ZSTDLIBDIR) -I$(ZSTDLIBDIR)/common -I$(ZLIBWRAPPER_PATH) -std=gnu99
++CFLAGS ?= 
++CFLAGS += $(CPPFLAGS) -O3  $(LOC) -I$(PROGRAMS_PATH) -I$(ZSTDLIBDIR) -I$(ZSTDLIBDIR)/common -I$(ZLIBWRAPPER_PATH) -std=gnu99
+ CFLAGS += -Wall -Wextra -Wcast-qual -Wcast-align -Wshadow -Wswitch-enum -Wdeclaration-after-statement -Wstrict-prototypes -Wundef
+ LDFLAGS = $(LOC)
+ RM = rm -f
diff --git a/debian/patches/series b/debian/patches/series
index 394d58e..52a7663 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,4 +1,5 @@
 0001-Skip-long-running-tests.patch
 0002-Build-lib-by-default.patch
-0004-Add-symlinks-for-extra-manpages.patch
-0005-Add-help2man-d-pzstd-man-file.patch
+0003-Add-symlinks-for-extra-manpages.patch
+0004-Add-help2man-d-pzstd-man-file.patch
+0005-Ensure-CPPFLAGS-makes-it-to-the-compiler.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-med/libzstd.git



More information about the debian-med-commit mailing list