A macOS static linking mystery

Viktor Dukhovni ietf-dane at dukhovni.org
Mon Aug 8 14:46:16 UTC 2022


On Mon, Aug 08, 2022 at 09:59:48AM -0400, Viktor Dukhovni wrote:

> On my MacOS laptop I get:
> 
>     $ /usr/local/bin/pkg-config --libs libffi
>     -lffi
> 
> which does not use the "brew"-installed libffi.  Not surprising, since
> /usr/local/lib/pkgconfig/ has no symlink to the "libffi.pc" file.

When updating "libffi" HomeBrew reports:

    ==> libffi
    libffi is keg-only, which means it was not symlinked into /usr/local,
    because macOS already provides this software and installing another version in
    parallel can cause all kinds of trouble.

    For compilers to find libffi you may need to set:
      export LDFLAGS="-L/usr/local/opt/libffi/lib"
      export CPPFLAGS="-I/usr/local/opt/libffi/include"

If the MacOS libffi works, it is probably safer to use it rather than
the HomeBrew version.

-- 
    Viktor.


More information about the ghc-devs mailing list