| 1 |
Fromscip-debian debian bwa-mem2 2.3+ds-1 bwa-mem2/patches/hardening#From.: "Michael R. Crusoe" <[email protected]scip-debian . . . identity/`[email protected]`.> |
| 2 |
Datescip-debian debian bwa-mem2 2.3+ds-1 bwa-mem2/patches/hardening#Date.: Thu, 9 Jul 2020 16:05:44 +0200 |
| 3 |
Subjectscip-debian debian bwa-mem2 2.3+ds-1 bwa-mem2/patches/hardening#Subject.: Enable proper flag appending so that Debian can harden the build. |
| 4 |
|
| 5 |
Forwarded: https://github.com/bwa-mem2/bwa-mem2/pull/69 |
| 6 |
--- |
| 7 |
Makefile | 4 ++-- |
| 8 |
ext/safestringlib/makefile | 8 ++++---- |
| 9 |
2 files changed, 6 insertions(+), 6 deletions(-) |
| 10 |
|
| 11 |
--- bwa-mem2.orig/Makefilescip-debian debian bwa-mem2 2.3+ds-1 bwa-mem2/upstream/`bwa-mem2.orig/Makefile`: |
| 12 |
+++ bwa-mem2/Makefilescip-debian debian bwa-mem2 2.3+ds-1 bwa-mem2/upstream/`bwa-mem2/Makefile`: |
| 13 |
@@ -111,11 +111,11 @@ |
| 14 |
$(MAKE) arch=avx2 EXE=bwa-mem2.avx2 CXX=$(CXX) all |
| 15 |
rm -f src/*.o $(BWA_LIB); cd ext/safestringlib/ && $(MAKE) clean; |
| 16 |
$(MAKE) arch=avx512 EXE=bwa-mem2.avx512bw CXX=$(CXX) all |
| 17 |
|
| 18 |
+ $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) -Wall -O3 src/runsimd.cpp -Iext/safestringlib/include -Lext/safestringlib/ -lsafestring $(STATIC_GCC) -o bwa-mem2 |
| 19 |
|
| 20 |
|
| 21 |
$(EXE):$(BWA_LIB) $(SAFE_STR_LIB) src/main.o |
| 22 |
|
| 23 |
+ $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) src/main.o $(BWA_LIB) $(LIBS) -o $@ |
| 24 |
|
| 25 |
$(BWA_LIB):$(OBJS) |
| 26 |
ar rcs $(BWA_LIB) $(OBJS) |
| 27 |
--- bwa-mem2.orig/ext/safestringlib/makefilescip-debian debian bwa-mem2 2.3+ds-1 bwa-mem2/upstream/`bwa-mem2.orig/ext/safestringlib/makefile`: |
| 28 |
+++ bwa-mem2/ext/safestringlib/makefilescip-debian debian bwa-mem2 2.3+ds-1 bwa-mem2/upstream/`bwa-mem2/ext/safestringlib/makefile`: |
| 29 |
@@ -1,8 +1,8 @@ |
| 30 |
IDIR = include |
| 31 |
MKDIR_P = mkdir -p |
| 32 |
CC=gcc |
| 33 |
|
| 34 |
|
| 35 |
+CFLAGS+=-I$(IDIR) -fstack-protector-strong -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security |
| 36 |
+LDFLAGS+=-z noexecstack -z relo -z now |
| 37 |
|
| 38 |
ODIR=obj |
| 39 |
OTDIR=objtest |
| 40 |
@@ -30,7 +30,7 @@ |
| 41 |
|
| 42 |
|
| 43 |
$(ODIR)/%.o: $(SRCDIR)/%.c $(DEPS) $(ODEPS) |
| 44 |
|
| 45 |
+ $(CC) $(CPPFLAGS) $(LDFLAGS) -c -o $@ $< $(CFLAGS) |
| 46 |
|
| 47 |
libsafestring.a: $(OBJ) |
| 48 |
ar rcs $@ $^ |
| 49 |
@@ -44,7 +44,7 @@ |
| 50 |
|
| 51 |
|
| 52 |
$(OTDIR)/%.o: $(TESTDIR)/%.c $(TESTDIR)/test_private.h |
| 53 |
|
| 54 |
+ $(CC) $(CPPFLAGS) -c -o $@ $< $(CFLAGS) |
| 55 |
|
| 56 |
|
| 57 |
safestringtest: directories libsafestring.a $(TOBJ) |