diff options
author | John Brooks <special@dereferenced.net> | 2011-01-06 22:08:27 -0700 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2011-02-03 14:18:00 -0500 |
commit | 895409011f20d6a08da75ac8dde44ad5e9ba1371 (patch) | |
tree | 779eb2897b76ce15dd3917b8e0deae04cba36c05 /configure.in | |
parent | e94ee583d6f81f2375ea9126e77495aeb3ca18bf (diff) | |
download | tor-895409011f20d6a08da75ac8dde44ad5e9ba1371.tar.gz tor-895409011f20d6a08da75ac8dde44ad5e9ba1371.zip |
Enable ASLR and permanent DEP for Windows executables
Fix for #2358
Diffstat (limited to 'configure.in')
-rw-r--r-- | configure.in | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/configure.in b/configure.in index 7c6a8a484e..9cbfbb1ca5 100644 --- a/configure.in +++ b/configure.in @@ -848,6 +848,20 @@ AC_SUBST(BINDIR) LOCALSTATEDIR=`eval echo $localstatedir` AC_SUBST(LOCALSTATEDIR) +if test "$bwin32" = true; then + # Test if the linker supports the --nxcompat and --dynamicbase options + # for Windows + save_LDFLAGS="$LDFLAGS" + LDFLAGS="-Wl,--nxcompat -Wl,--dynamicbase" + AC_MSG_CHECKING([whether the linker supports DllCharacteristics]) + AC_LINK_IFELSE([AC_LANG_PROGRAM([])], + [AC_MSG_RESULT([yes])] + [save_LDFLAGS="$save_LDFLAGS $LDFLAGS"], + [AC_MSG_RESULT([no])] + ) + LDFLAGS="$save_LDFLAGS" +fi + # Set CFLAGS _after_ all the above checks, since our warnings are stricter # than autoconf's macros like. if test "$GCC" = yes; then |