diff options
author | Roger Dingledine <arma@torproject.org> | 2010-05-07 12:05:26 -0400 |
---|---|---|
committer | Roger Dingledine <arma@torproject.org> | 2010-05-07 12:05:26 -0400 |
commit | 8ba00e4305fe87c540c452271bc6f5c461738777 (patch) | |
tree | 5d0afdf8f1d3ee273dde0723d85e30a718a98170 /configure.in | |
parent | 89bb5fbce6ca0a06b4f01576430486811be6464d (diff) | |
parent | 04fa935e02270bc90aca0f1c652d31c7a872175b (diff) | |
download | tor-8ba00e4305fe87c540c452271bc6f5c461738777.tar.gz tor-8ba00e4305fe87c540c452271bc6f5c461738777.zip |
Merge commit 'ioerror/compileTimeHardening'
Diffstat (limited to 'configure.in')
-rw-r--r-- | configure.in | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/configure.in b/configure.in index 10e509d3c5..07b3ff423b 100644 --- a/configure.in +++ b/configure.in @@ -90,6 +90,27 @@ AC_ARG_ENABLE(gcc-warnings, AC_ARG_ENABLE(gcc-warnings-advisory, AS_HELP_STRING(--enable-gcc-warnings-advisory, [enable verbose warnings, excluding -Werror])) +dnl Adam shostack suggests the following for Windows: +dnl -D_FORTIFY_SOURCE=2 -fstack-protector-all +dnl Others suggest '/gs /safeseh /nxcompat /dynamicbase' for non-gcc on Windows +dnl This requires that we use gcc and that we add -O2 to the CFLAGS. +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+=" -fwrapv -fPIE -Wstack-protector -Wformat -Wformat-security" + CFLAGS+=" -Wpointer-sign" + LDFLAGS+=" -pie" +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 + LDFLAGS+=" -z relro -z now" +fi]) + AC_ARG_ENABLE(local-appdata, AS_HELP_STRING(--enable-local-appdata, default to host local application data paths on Windows)) if test "$enable_local_appdata" = "yes"; then |