From 7b0e1f182cd96903563f11c344543908a35a9b7a Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Sun, 14 Oct 2018 16:55:36 +0200 Subject: [PATCH] Add hardening flags to autotools based packages Signed-off-by: David Oberhollenzer --- util/autotools.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/util/autotools.sh b/util/autotools.sh index af3a543..a0e5017 100644 --- a/util/autotools.sh +++ b/util/autotools.sh @@ -2,8 +2,12 @@ run_configure() { local srcdir="$1" shift + local cflags="-fstack-protector-all" + local ldflags="-z noexecstack -z relro -z now" + ac_cv_func_malloc_0_nonnull=yes \ ac_cv_func_realloc_0_nonnull=yes \ + CFLAGS="$cflags" LDFLAGS="$ldflags" \ $srcdir/configure --prefix="" --build="$HOSTTUPLE" --host="$TARGET" \ --bindir="/bin" --sbindir="/bin" --sysconfdir="/etc" \ --libexecdir="/lib/libexec" --datarootdir="/share" \