aboutsummaryrefslogtreecommitdiffstats
path: root/src/_cffi_src/utils.py
diff options
context:
space:
mode:
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"]