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