Enable PIE (if the compiler supports it) when compiling dumpcap.  Do this
regardless of whether we're configured to install dumpcap setuid-root because
some users will end up running dumpcap as root regardless of how we were
configured.

svn path=/trunk/; revision=46608
This commit is contained in:
Jeff Morriss 2012-12-19 02:09:48 +00:00
parent 3739c083bf
commit 8a916449e5
2 changed files with 27 additions and 2 deletions

View File

@ -85,7 +85,7 @@ diameter_DATA = \
diameter/Vodafone.xml \
diameter/AlcatelLucent.xml \
diameter/Nokia.xml \
diameter/NokiaSiemensNetworks.xml
diameter/NokiaSiemensNetworks.xml
#
# Install the DTDs directory files in the "dtds" subdirectory
@ -503,7 +503,8 @@ dumpcap_LDADD = \
@SYSTEMCONFIGURATION_FRAMEWORKS@ \
@COREFOUNDATION_FRAMEWORKS@ \
@LIBCAP_LIBS@
dumpcap_CFLAGS = $(AM_CLEAN_CFLAGS)
dumpcap_CFLAGS = $(AM_CLEAN_CFLAGS) $(PIE_CFLAGS)
dumpcap_LDFLAGS = $(PIE_LDFLAGS)
# Common headers
AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/wiretap \

View File

@ -426,6 +426,30 @@ AC_WIRESHARK_GCC_CFLAGS_CHECK(-Warray-bounds)
AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wcast-align)
AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wformat-security)
AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wold-style-definition, C)
CFLAGS_before_pie=$CFLAGS
AC_WIRESHARK_GCC_CFLAGS_CHECK(-fPIE, C)
if test "x$CLFAGS" != "x$CFLAGS_before_pie"
then
# Restore CFLAGS
CFLAGS=$CFLAGS_before_pie
LDFLAGS_before_pie=$LDFLAGS
AC_WIRESHARK_LDFLAGS_CHECK([-pie])
if test "x$LDFLAGS" != "x$LDFLAGS_before_pie"
then
# We can use PIE
PIE_CFLAGS="-fPIE"
PIE_LDFLAGS="-pie"
# Restore LDFLAGS
LDFLAGS=$LDFLAGS_before_pie
fi
fi
AC_SUBST(PIE_CFLAGS)
AC_SUBST(PIE_LDFLAGS)
#
# XXX - OK for C++?
#