From 3a826fb6a7504dd40c8cee4b6cd183d5601eb8ac Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marcela=20Ma=C5=A1l=C3=A1=C5=88ov=C3=A1?= Date: Tue, 15 Mar 2011 13:04:10 +0100 Subject: [PATCH] Split relro and pie into two options. --- configure.ac | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 1af3496..ab46d2e 100644 --- a/configure.ac +++ b/configure.ac @@ -121,8 +121,8 @@ if test "x$enable_pie" = xyes; then save_CFLAGS="$CFLAGS" save_LDFLAGS="$LDFLAGS" CFLAGS="$CFLAGS -fPIE -DPIE" - LDFLAGS="$LDFLAGS -pie -Wl,-z,relro -Wl,-z,now" - AC_CACHE_CHECK([whether compiler accepts -pie & relro], ac_cv_pie_fpie, + LDFLAGS="$LDFLAGS -pie" + AC_CACHE_CHECK([whether compiler accepts -pie], ac_cv_pie_fpie, [AC_TRY_LINK([], [], ac_cv_pie_fpie=yes, ac_cv_pie_fpie=no)]) if test $ac_cv_pie_fpie = no; then @@ -131,6 +131,13 @@ if test "x$enable_pie" = xyes; then fi fi +AC_ARG_ENABLE(relro,CRONIE_HELP_STRING(--enable-relro,Build cronie with relro flag)) +if test "x$enable_relro" = xyes; then + save_CFLAGS="$CFLAGS" + save_LDFLAGS="$LDFLAGS" + LDFLAGS="-Wl,-z,relro -Wl,-z,now" +fi + # Check whether user wants SELinux support SELINUX_MSG="no" LIBSELINUX="" -- 2.40.0