]> ruderich.org/simon Gitweb - tlsproxy/tlsproxy.git/commitdiff
configure.ac: Compile with additional security features if GCC is used.
authorSimon Ruderich <simon@ruderich.org>
Fri, 19 Aug 2011 00:14:00 +0000 (02:14 +0200)
committerSimon Ruderich <simon@ruderich.org>
Fri, 19 Aug 2011 00:14:00 +0000 (02:14 +0200)
See http://wiki.debian.org/Hardening for more information.

configure.ac

index 6cfb3f7a062687dc242eb3d592f4fb64d85aad3d..82be75124597f229f49e626c176b030b55e02a13 100644 (file)
@@ -11,6 +11,9 @@ AC_PROG_CC
 if test "x$GCC" = xyes; then
     CFLAGS="-std=c89 -pedantic -Wall -Wextra -Werror $CFLAGS"
     CFLAGS="-D_XOPEN_SOURCE=500 -Wno-error=int-to-pointer-cast $CFLAGS"
+    # Additional security flags.
+    CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=2 -fstack-protector -fPIE -pie"
+    LDFLAGS="$LDFLAGS -z relro -z now"
 fi
 
 AC_CHECK_LIB([pthread], [pthread_create],