199a5d
diff --git a/bin/named/Makefile.in b/bin/named/Makefile.in
199a5d
index eb622d1..37053a7 100644
199a5d
--- a/bin/named/Makefile.in
199a5d
+++ b/bin/named/Makefile.in
199a5d
@@ -117,8 +117,12 @@ SRCS =		builtin.c config.c control.c \
199a5d
 		tkeyconf.c tsigconf.c zoneconf.c \
199a5d
 		${DLZDRIVER_SRCS} ${DBDRIVER_SRCS}
199a5d
 
199a5d
+EXT_CFLAGS = -fpie
199a5d
+
199a5d
 @BIND9_MAKE_RULES@
199a5d
 
199a5d
+LDFLAGS += -pie -Wl,-z,relro,-z,now,-z,nodlopen,-z,noexecstack
199a5d
+
199a5d
 main.@O@: main.c
199a5d
 	${LIBTOOL_MODE_COMPILE} ${CC} ${ALL_CFLAGS} \
199a5d
 		-DVERSION=\"${VERSION}\" \
199a5d
diff --git a/bin/named/unix/Makefile.in b/bin/named/unix/Makefile.in
199a5d
index fd9ca8d..f1c102c 100644
199a5d
--- a/bin/named/unix/Makefile.in
199a5d
+++ b/bin/named/unix/Makefile.in
199a5d
@@ -11,6 +11,8 @@ srcdir =	@srcdir@
199a5d
 VPATH =		@srcdir@
199a5d
 top_srcdir =	@top_srcdir@
199a5d
 
199a5d
+EXT_CFLAGS = -fpie
199a5d
+
199a5d
 @BIND9_MAKE_INCLUDES@
199a5d
 
199a5d
 CINCLUDES =	-I${srcdir}/include -I${srcdir}/../include \