Merge pull request #123 from Chocobo1/ldflags

Enable ASLR & DEP
pull/128/head
Selva Nair 2017-01-22 14:42:31 -05:00 committed by GitHub
commit f35308d7d2
2 changed files with 11 additions and 0 deletions

View File

@ -57,6 +57,14 @@ case "$host" in
*-mingw*)
CPPFLAGS="${CPPFLAGS} -DWIN32_LEAN_AND_MEAN"
CPPFLAGS="${CPPFLAGS} -D_WIN32_WINNT=NTDDI_WINXP"
LDFLAGS="${LDFLAGS} -Wl,--nxcompat,--dynamicbase"
dnl older mingw doesn't support `--high-entropy-va`
_save_ldflags="$LDFLAGS"
LDFLAGS="-Wl,--high-entropy-va"
AC_LINK_IFELSE([AC_LANG_PROGRAM([])],[AS_VAR_SET(high_entropy_aslr,[yes])],)
LDFLAGS="$_save_ldflags"
AS_VAR_IF(high_entropy_aslr,[yes],[LDFLAGS="${LDFLAGS} -Wl,--high-entropy-va"],)
;;
*)
test "${enable_distonly}" = "no" && AC_MSG_ERROR([This project is supported for windows only.])

3
main.c
View File

@ -68,6 +68,9 @@ TCHAR szTitleText[ ] = _T("OpenVPN");
/* Options structure */
options_t o;
/* Workaround for ASLR on Windows */
__declspec(dllexport) char aslr_workaround;
static int
VerifyAutoConnections()
{