--- pidgin-2.7.11/configure.ac 2011-03-10 18:20:27.000000000 -0800 +++ pidgin-2.7.11-configure-hardening/configure.ac 2011-04-27 17:33:57.018733540 -0700 @@ -1251,6 +1251,26 @@ AC_ARG_ENABLE(fortify, [AC_HELP_STRING([--disable-fortify], [compile without FORTIFY_SOURCE support])], , enable_fortify=yes) +dnl Other gcc hardening options that make memory corruption exploitation harder +AC_ARG_ENABLE(gcc-hardening, + AS_HELP_STRING(--enable-gcc-hardening, enable compiler security checks), +[if test x$enableval = xyes; then + enable_gcchardening="$enableval" + CFLAGS="$CFLAGS -fstack-protector-all" + CFLAGS="$CFLAGS -fwrapv -fPIE -Wstack-protector" + CFLAGS="$CFLAGS --param ssp-buffer-size=1" + LDFLAGS="$LDFLAGS -pie -fPIC" +fi]) + +dnl Linker hardening options +dnl Currently these options are ELF specific - you can't use this with MacOSX +AC_ARG_ENABLE(linker-hardening, + AS_HELP_STRING(--enable-linker-hardening, enable linker security fixups), +[if test x$enableval = xyes; then + enable_linkerhardening="$enableval" + LDFLAGS="$LDFLAGS -z relro -z now" +fi]) + DEBUG_CFLAGS="$DEBUG_CFLAGS -DPURPLE_DISABLE_DEPRECATED -DPIDGIN_DISABLE_DEPRECATED -DFINCH_DISABLE_DEPRECATED -DGNT_DISABLE_DEPRECATED" if test "x$GCC" = "xyes"; then dnl We enable -Wall later. @@ -2628,6 +2648,9 @@ eval eval echo SSL CA certificates directory. : $SSL_CERTIFICATES_DIR fi echo Build with Cyrus SASL support. : $enable_cyrus_sasl +echo Build with FORTIFY............ : $enable_fortify +echo Build with GCC hardening...... : $enable_gcchardening +echo Build with linker hardening... : $enable_linkerhardening echo Use kerberos 4 with zephyr.... : $kerberos echo Use external libzephyr........ : $zephyr echo Use external libgadu.......... : $gadu_libs