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