diff options
author | Alex Gaynor <alex.gaynor@gmail.com> | 2015-06-20 19:21:43 -0400 |
---|---|---|
committer | Alex Gaynor <alex.gaynor@gmail.com> | 2015-06-20 19:21:43 -0400 |
commit | 5e12f87d5c297771b59116914dcb2500dde25294 (patch) | |
tree | aaf9c544e2aaf7a053ab0b8dd2c819d4acdeed1b /src/_cffi_src/utils.py | |
parent | b2c2ff493c08f1c713fc88e3d2c4d9293beff4b9 (diff) | |
parent | dccbc9b00a17afcfdee35505fcf69bf3ce076056 (diff) | |
download | cryptography-5e12f87d5c297771b59116914dcb2500dde25294.tar.gz cryptography-5e12f87d5c297771b59116914dcb2500dde25294.tar.bz2 cryptography-5e12f87d5c297771b59116914dcb2500dde25294.zip |
Merge pull request #2034 from reaperhulk/windows-flags
enable ASLR and NX on windows builds (affects 2.x only)
Diffstat (limited to 'src/_cffi_src/utils.py')
-rw-r--r-- | src/_cffi_src/utils.py | 9 |
1 files changed, 9 insertions, 0 deletions
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"] |