From: Vincent Bernat Date: Thu, 21 May 2015 06:05:57 +0000 (+0200) Subject: build: only uses -pie when linking programs X-Git-Tag: 0.7.15~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f42b821489761159a7421a176b8dd8e6d51672c9;p=thirdparty%2Flldpd.git build: only uses -pie when linking programs We can't rely on libtool to remove the flag on libraries. --- diff --git a/configure.ac b/configure.ac index 196829df..616a6d2b 100644 --- a/configure.ac +++ b/configure.ac @@ -67,6 +67,7 @@ DX_PS_FEATURE(OFF) DX_INIT_DOXYGEN([lldpd], [doxygen.cfg], [doxygen]) # Check some compiler flags +AX_CFLAGS_GCC_OPTION([-Wunknown-warning-option], [LLDP_CFLAGS]) AX_CFLAGS_GCC_OPTION([-fdiagnostics-show-option], [LLDP_CFLAGS]) AX_CFLAGS_GCC_OPTION([-fdiagnostics-color=auto], [LLDP_CFLAGS]) AX_CFLAGS_GCC_OPTION([-pipe], [LLDP_CFLAGS]) @@ -98,7 +99,8 @@ if test x"$hardening" != x"no"; then AX_CFLAGS_GCC_OPTION([-fstack-protector-strong], [LLDP_CFLAGS]) AX_CFLAGS_GCC_OPTION([-D_FORTIFY_SOURCE=2], [LLDP_CPPFLAGS]) AX_CFLAGS_GCC_OPTION([-fPIE], [LLDP_CFLAGS]) - AX_LDFLAGS_OPTION([-fPIE -pie], [LLDP_LDFLAGS]) + AX_LDFLAGS_OPTION([-fPIE -pie], [LLDP_BIN_LDFLAGS], + [AX_LDFLAGS_OPTION([-fPIE -Wl,-pie], [LLDP_BIN_LDFLAGS])]) fi # OS @@ -299,6 +301,7 @@ lldp_ARG_ENABLE([oldies], [compatibility with Linux kernel older than 2.6.18], [ AC_SUBST([LLDP_CFLAGS]) AC_SUBST([LLDP_CPPFLAGS]) AC_SUBST([LLDP_LDFLAGS]) +AC_SUBST([LLDP_BIN_LDFLAGS]) AM_CONDITIONAL([HAVE_CHECK], [test x"$have_check" = x"yes"]) AM_CONDITIONAL([USE_SNMP], [test x"$with_snmp" = x"yes"]) AM_CONDITIONAL([USE_XML], [test x"$with_xml" = x"yes"]) @@ -321,7 +324,7 @@ cat <