This patch is a Solaris-specific hack; it will not be submitted upstream.
--- Python-2.7.9/Lib/distutils/sysconfig.py.~1~ 2014-12-10 07:59:34.000000000 -0800
+++ Python-2.7.9/Lib/distutils/sysconfig.py 2014-12-11 09:28:01.439349129 -0800
@@ -209,6 +209,15 @@
else:
archiver = ar + ' ' + ar_flags
+ # Force PIC compilation. Determine if GNU compiler or otherwise
+ # and set the PIC flag(s) accordingly. Defaults to Studio compiler.
+ out = os.popen(cc + ' --version 2>/dev/null', 'r')
+ out_string = out.read()
+ out.close()
+ result = re.search(' (\d+\.\d+(\.\d+)*)', out_string)
+ kpic_flags = "-fPIC -DPIC" if result else "-KPIC -DPIC"
+ cflags += ' ' + kpic_flags
+
cc_cmd = cc + ' ' + cflags
compiler.set_executables(
preprocessor=cpp,