From f67d8b6f422332af24710f35675f532a6e0c310e Mon Sep 17 00:00:00 2001 From: Matthew Vernon Date: Fri, 7 Nov 2025 11:21:58 +0000 Subject: [PATCH] Use dpkg-buildflags to enable hardening flags (Closes: #1119360) --- Makefile | 3 ++- debian/rules | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 6365c54..4073aa9 100644 --- a/Makefile +++ b/Makefile @@ -89,7 +89,8 @@ DESTMAN1 = $(DESTMAN)/man1 # I use environment variables for these... #CFLAGS = -g CFLAGS = -Wall -Wformat -Werror -Wshadow -W -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wcast-align -Wcast-qual -Wbad-function-cast -Wpointer-arith -g2 -ggdb -DDESTLIB=\"$(DESTLIB)\" -ffile-prefix-map=$(CURDIR)=. -LDFLAGS = +CFLAGS += `dpkg-buildflags --get CFLAGS` +LDFLAGS = `dpkg-buildflags --get LDFLAGS` LDADD = -lreadline # release directories. Nobody should care about this but me diff --git a/debian/rules b/debian/rules index 6a1fd52..a73b302 100755 --- a/debian/rules +++ b/debian/rules @@ -23,7 +23,7 @@ build: dpkg-architecture -a$(DEB_BUILD_ARCH) -f -c dh_auto_build --no-parallel -- bible-index.c bible.data bible.data.conc 'LD=$$(CC)' rm -f *.o dh_auto_build --no-parallel -- bible 'LD=$$(CC)' - cd debian && $(CC) -g -O2 -ffile-prefix-map=$(CURDIR)=. -o randverse randverse.c + cd debian && $(CC) `dpkg-buildflags --get CFLAGS` -g -O2 -ffile-prefix-map=$(CURDIR)=. -o randverse randverse.c touch build build-arch: build -- 2.30.2