From dccbc9b00a17afcfdee35505fcf69bf3ce076056 Mon Sep 17 00:00:00 2001 From: Paul Kehrer Date: Tue, 16 Jun 2015 20:29:40 -0600 Subject: enable ASLR and NX on windows builds (affects 2.x only) --- src/_cffi_src/utils.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/_cffi_src/utils.py') diff --git a/src/_cffi_src/utils.py b/src/_cffi_src/utils.py index b1ad74d4..65f9f120 100644 --- a/src/_cffi_src/utils.py +++ b/src/_cffi_src/utils.py @@ -80,3 +80,12 @@ def build_ffi(module_name, cdef_source, verify_source, libraries=[], extra_link_args=extra_link_args, ) return ffi + + +def extra_link_args(platform): + if platform != "win32": + return [] + else: + # Enable NX and ASLR for Windows builds. These are enabled by default + # on Python 3.3+ but not on 2.x. + return ["/NXCOMPAT", "/DYNAMICBASE"] -- cgit v1.2.3