diff --git a/Modules/_ctypes/libffi/fficonfig.py.in b/Modules/_ctypes/libffi/fficonfig.py.in index 09c13db38d4..f5f3810b0d9 100644 --- a/Modules/_ctypes/libffi/fficonfig.py.in +++ b/Modules/_ctypes/libffi/fficonfig.py.in @@ -25,6 +25,7 @@ ffi_platforms = { 'SH64': ['src/sh64/sysv.S', 'src/sh64/ffi.c'], 'PA': ['src/pa/linux.S', 'src/pa/ffi.c'], 'PA_LINUX': ['src/pa/linux.S', 'src/pa/ffi.c'], + 'PA_HPUX': ['src/pa/hpux32.s', 'src/pa/ffi.c'], } ffi_srcdir = '@srcdir@' diff --git a/setup.py b/setup.py index 34035edd32c..4663cece8c1 100644 --- a/setup.py +++ b/setup.py @@ -1580,6 +1580,9 @@ class PyBuildExt(build_ext): # finding some -z option for the Sun compiler. extra_link_args.append('-mimpure-text') + elif sys.platform.startswith('hpux'): + extra_link_args.append('-fPIC') + ext = Extension('_ctypes', include_dirs=include_dirs, extra_compile_args=extra_compile_args,