summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorRichard Hughes <richard@hughsie.com>2013-05-07 14:07:31 +0100
committerRichard Hughes <richard@hughsie.com>2013-05-07 14:07:31 +0100
commitefa97d515fdef37e7c20b13e1e49f82080b11625 (patch)
treeb3c0dbc6a6487ac2cb2c151c193f4a81eb7882ba /configure.ac
parent61d49c3120fb5d2ce82b9871e9ce5946be0eee48 (diff)
Use PIE to better secure installed tools and also use full RELRO in the daemon
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac12
1 files changed, 12 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 51dc080..84939e3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -142,6 +142,18 @@ else
fi
AC_SUBST(WARNINGFLAGS_C)
+# check for PIE (position independent executable) support
+AX_CHECK_COMPILE_FLAG([-fPIE],
+ [AX_CHECK_LINK_FLAG([-fPIE -pie],
+ [PIE_CFLAGS="-fPIE" PIE_LDFLAGS="-pie"])])
+AC_SUBST(PIE_CFLAGS)
+AC_SUBST(PIE_LDFLAGS)
+
+# check for full RELRO (relocation read-only) support
+AX_CHECK_LINK_FLAG([-Wl,-z,relro,-z,now],
+ [RELRO_LDFLAGS="-Wl,-z,relro,-z,now"])
+AC_SUBST([RELRO_LDFLAGS])
+
PKG_CHECK_MODULES(GLIB, [glib-2.0 >= 2.21.5])
PKG_CHECK_MODULES(DBUS, [dbus-1 >= 1.0])
PKG_CHECK_MODULES(DBUS_GLIB, [dbus-glib-1 >= 0.76])