From 437fe40660d97f7507fdf4e6ad9e33b2d9a13cd2 Mon Sep 17 00:00:00 2001 From: Alexander Gozman Date: Tue, 29 Sep 2015 00:08:55 +0300 Subject: [PATCH] Feature 1527: ability to compile as a position independent executable Adds corresponding configure option which enables proper CPPFLAGS and LDFLAGS. --- configure.ac | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/configure.ac b/configure.ac index ab2df12bc6..97ce3ab174 100644 --- a/configure.ac +++ b/configure.ac @@ -1693,6 +1693,16 @@ enable_geoip="yes" fi + # Position Independent Executable + AC_ARG_ENABLE(pie, + AS_HELP_STRING([--enable-pie],[Enable compiling as a position independent executable]), + [ enable_pie="yes"], + [ enable_pie="no"]) + if test "$enable_pie" = "yes"; then + CPPFLAGS="${CPPFLAGS} -fPIC" + LDFLAGS="${LDFLAGS} -pie" + fi + # get cache line size AC_PATH_PROG(HAVE_GETCONF_CMD, getconf, "no") if test "$HAVE_GETCONF_CMD" != "no"; then @@ -1832,6 +1842,7 @@ Generic build parameters: GCC Protect enabled: ${enable_gccprotect} GCC march native enabled: ${enable_gccmarch_native} GCC Profile enabled: ${enable_gccprofile} + Position Independent Executable enabled: ${enable_pie} CFLAGS ${CFLAGS} PCAP_CFLAGS ${PCAP_CFLAGS} SECCFLAGS ${SECCFLAGS}"