[pypy-dev] help needed: libffi and recent macOS

Matt Billenstein matt at vazor.com
Sun May 31 20:33:58 EDT 2020


Attempting a custom build outside of the buildbot and I'm linking system
libffi, but it's not picking up gettext out of /usr/local - is there any way to
tell the toolchain to not link anything in /usr/local?

$ otool -L libpypy3-c.dylib
libpypy3-c.dylib:
    @rpath/libpypy3-c.dylib (compatibility version 0.0.0, current version 0.0.0)
    /usr/lib/libutil.dylib (compatibility version 1.0.0, current version 1.0.0)
    /usr/local/opt/gettext/lib/libintl.8.dylib (compatibility version 10.0.0, current version 10.7.0)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1281.100.1)
    /usr/lib/libexpat.1.dylib (compatibility version 7.0.0, current version 8.0.0)
    /usr/lib/libbz2.1.0.dylib (compatibility version 1.0.0, current version 1.0.5)
    /usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.11)
    /usr/lib/libffi.dylib (compatibility version 1.0.0, current version 26.0.0)
    /usr/lib/libncurses.5.4.dylib (compatibility version 5.4.0, current version 5.4.0)

   
$ ls -l /usr/local/lib/libintl.8.dylib
lrwxr-xr-x 1 mattb staff 46 Apr 29 16:54 /usr/local/lib/libintl.8.dylib -> ../Cellar/gettext/0.20.2_1/lib/libintl.8.dylib

m

On Sun, May 31, 2020 at 01:09:11AM +0300, Matti Picus wrote:
> It seems the pypy 7.3.1 tarball is broken on macOS since it links to an
> installation of libffi in the non-standard location `/usr/local/opt/libffi/lib/
> libffi.6.dylib`, see issue 3229[0].
> 
> This is due to macOS 10.15.3 not shipping its own libffi (is this true?), so
> the buildbot owner (CC) had to install it via homebrew. I don't know anything
> about macOS:
> 
> 
> - should we bundle libffi together in the tarball we supply?
> 
> - is there a way to tell clang to statically link libffi.a rather than
> dynamically link to libffi.dylib? Is that desirable?
> 
> 
> Any help would be appreciated, even better would be a pull request
> 
> - to pypy/tool/release/packaging.py to make the equivalent of a "portable PyPy"
> for macOS, or to at least bundle libffi.dylib so the runtime loader could find
> it
> 
> or
> 
> - to statically link libffi.a when building PyPY.
> 
> Thanks,
> 
> Matti
> 
> 
> 
> [0] https://foss.heptapod.net/pypy/pypy/issues/3229.
> 

-- 
Matt Billenstein
matt at vazor.com
http://www.vazor.com/


More information about the pypy-dev mailing list