]> granicus.if.org Git - python/commitdiff
Fix #1530448 - fix ctypes build failure on solaris 10.
authorThomas Heller <theller@ctypes.org>
Fri, 4 Aug 2006 18:57:34 +0000 (18:57 +0000)
committerThomas Heller <theller@ctypes.org>
Fri, 4 Aug 2006 18:57:34 +0000 (18:57 +0000)
The '-mimpure-text' linker flag is required when linking _ctypes.so.

Misc/NEWS
setup.py

index a6797f4b87937c020b9b028bc4b17ff1a6da275f..d4eb2189d2f3e69ffb8b9a0e0c9c011cbd7892fa 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -48,6 +48,8 @@ Tests
 Build
 -----
 
+- Bug #1530448, ctypes buld failure on Solaris 10 was fixed.
+
 
 Mac
 ---
index 0feb4843a02393ddd1a368688b6226bee9a8c1aa..67ddade9d9120aef95dba380d29b4ef6b778e2ac 100644 (file)
--- a/setup.py
+++ b/setup.py
@@ -1349,6 +1349,7 @@ class PyBuildExt(build_ext):
         self.use_system_libffi = False
         include_dirs = []
         extra_compile_args = []
+        extra_link_args = []
         sources = ['_ctypes/_ctypes.c',
                    '_ctypes/callbacks.c',
                    '_ctypes/callproc.c',
@@ -1363,9 +1364,13 @@ class PyBuildExt(build_ext):
 # XXX Is this still needed?
 ##            extra_link_args.extend(['-read_only_relocs', 'warning'])
 
+        elif sys.platform == 'sunos5':
+            extra_link_args.append('-mimpure-text')
+
         ext = Extension('_ctypes',
                         include_dirs=include_dirs,
                         extra_compile_args=extra_compile_args,
+                        extra_link_args=extra_link_args,
                         libraries=[],
                         sources=sources,
                         depends=depends)