]> git.ipfire.org Git - thirdparty/lldpd.git/commitdiff
build: don't enable PIE when using embedded libevent
authorVincent Bernat <vincent@bernat.im>
Tue, 19 May 2015 13:46:41 +0000 (15:46 +0200)
committerVincent Bernat <vincent@bernat.im>
Tue, 19 May 2015 13:46:41 +0000 (15:46 +0200)
configure.ac

index cacb7cfc1302c7425ff496521e644f448fab291b..ce240c1bc09fe9c448652f1b574391a9c1f0061d 100644 (file)
@@ -89,22 +89,6 @@ AX_LDFLAGS_OPTION([-Wl,-z,now], [LLDP_LDFLAGS])
 lldp_CHECK_OS
 lldp_CFLAGS_OS
 
-# Hardening
-AC_ARG_ENABLE([hardening],
-  [AS_HELP_STRING([--enable-hardening],
-    [Enable compiler and linker options to frustrate memory corruption exploits @<:@yes@:>@])],
-  [hardening="$enableval"],
-  [hardening="yes"])
-
-if test x"$hardening" != x"no"; then
-  AX_CFLAGS_GCC_OPTION([-fstack-protector], [LLDP_CFLAGS])
-  AX_CFLAGS_GCC_OPTION([-fstack-protector-all], [LLDP_CFLAGS])
-  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])
-fi
-
 AC_CACHE_SAVE
 
 # Checks for header files.
@@ -293,6 +277,25 @@ lldp_ARG_ENABLE([dot3], [Dot3 extension (PHY stuff)], [yes])
 # Oldies
 lldp_ARG_ENABLE([oldies], [compatibility with Linux kernel older than 2.6.18], [no])
 
+
+# Hardening
+AC_ARG_ENABLE([hardening],
+  [AS_HELP_STRING([--enable-hardening],
+    [Enable compiler and linker options to frustrate memory corruption exploits @<:@yes@:>@])],
+  [hardening="$enableval"],
+  [hardening="yes"])
+
+if test x"$hardening" != x"no"; then
+  AX_CFLAGS_GCC_OPTION([-fstack-protector], [LLDP_CFLAGS])
+  AX_CFLAGS_GCC_OPTION([-fstack-protector-all], [LLDP_CFLAGS])
+  AX_CFLAGS_GCC_OPTION([-fstack-protector-strong], [LLDP_CFLAGS])
+  AX_CFLAGS_GCC_OPTION([-D_FORTIFY_SOURCE=2], [LLDP_CPPFLAGS])
+  if test x"$LIBEVENT_EMBEDDED" = x; then
+    AX_CFLAGS_GCC_OPTION([-fPIE], [LLDP_CFLAGS])
+    AX_LDFLAGS_OPTION([-fPIE -pie], [LLDP_LDFLAGS])
+  fi
+fi
+
 #######################
 # Output results
 AC_SUBST([LLDP_CFLAGS])