aboutsummaryrefslogtreecommitdiffstats
path: root/src/_cffi_src/utils.py
diff options
context:
space:
mode:
authorPaul Kehrer <paul.l.kehrer@gmail.com>2015-06-16 20:29:40 -0600
committerPaul Kehrer <paul.l.kehrer@gmail.com>2015-06-20 14:43:16 -0500
commitdccbc9b00a17afcfdee35505fcf69bf3ce076056 (patch)
tree77e1189a26098a270a4178ad690b13f7cb29b8dc /src/_cffi_src/utils.py
parent325453c941d29e79f3ad413df5ecbfbe966b4f79 (diff)
downloadcryptography-dccbc9b00a17afcfdee35505fcf69bf3ce076056.tar.gz
cryptography-dccbc9b00a17afcfdee35505fcf69bf3ce076056.tar.bz2
cryptography-dccbc9b00a17afcfdee35505fcf69bf3ce076056.zip
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.py9
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"]