view lang/pypy310/files/patch-rpython_rlib_clibffi.py @ 199:8b567a874360

Upgrade to PyPy v7.3.19. BUGS: - pypy311 not yet supported. - pypy39 not yet deleted. - Tests for pypy3 not yet runnable.
author Franz Glasner <fzglas.hg@dom66.de>
date Wed, 12 Mar 2025 13:45:29 +0100
parents
children
line wrap: on
line source

--- rpython/rlib/clibffi.py.orig	2025-02-22 16:54:09 UTC
+++ rpython/rlib/clibffi.py
@@ -77,11 +77,16 @@ if not _WIN32:
     library_dirs = platform.library_dirs_for_libffi()
     libraries = ['ffi']
     link_files = []
-    for libdir in library_dirs:
-        candidate = os.path.join(libdir, "libffi.a")
-        if os.path.exists(candidate):
-            link_files.append(candidate)
-            libraries = []
+    #
+    # fag: linking with libffi.a yields an error on FreeBSD because it is
+    #      not compiled with -fPIC: so link with libffi.so instead. This
+    #      is also true for previous versions of pypy.
+    #
+    # for libdir in library_dirs:
+    #     candidate = os.path.join(libdir, "libffi.a")
+    #     if os.path.exists(candidate):
+    #         link_files.append(candidate)
+    #         libraries = []
 
     eci = ExternalCompilationInfo(
         pre_include_bits = pre_include_bits,