mirror of
https://github.com/libevent/libevent.git
synced 2025-01-31 09:12:55 +08:00
Implement --enable-gcc-hardening configure option
Using --enable-gcc-hardening enables some additional safety features that gcc makes available such as stack smashing protection using canaries and ASLR. This commit is based on a patch for Tor: (git commit 04fa935e02270bc90aca0f1c652d31c7a872175b by Jacob Appelbaum) Copyright (c) 2007-2011, The Tor Project, Inc.
This commit is contained in:
parent
d46517ee55
commit
755026771a
@ -56,6 +56,13 @@ fi
|
||||
AC_ARG_ENABLE(gcc-warnings,
|
||||
AS_HELP_STRING(--disable-gcc-warnings, disable verbose warnings with GCC))
|
||||
|
||||
AC_ARG_ENABLE(gcc-hardening,
|
||||
AS_HELP_STRING(--enable-gcc-hardening, enable compiler security checks),
|
||||
[if test x$enableval = xyes; then
|
||||
CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=2 -fstack-protector-all"
|
||||
CFLAGS="$CFLAGS -fwrapv -fPIE -Wstack-protector"
|
||||
CFLAGS="$CFLAGS --param ssp-buffer-size=1"
|
||||
fi])
|
||||
|
||||
AC_ARG_ENABLE(thread-support,
|
||||
AS_HELP_STRING(--disable-thread-support, disable support for threading),
|
||||
|
Loading…
x
Reference in New Issue
Block a user