Opened 4 years ago

Closed 4 years ago

Last modified 3 years ago

#61132 closed defect (fixed)

clang-3.4: dyld: Library not loaded: /opt/local/lib/libffi.6.dylib

Reported by: ryandesign (Ryan Carsten Schmidt) Owned by: jeremyhu (Jeremy Huddleston Sequoia)
Priority: High Milestone:
Component: ports Version: 2.6.3
Keywords: Cc: larryv (Lawrence Velázquez), kencu (Ken), dbevans (David B. Evans), mascguy (Christopher Nielsen)
Port: llvm-3.4, llvm-3.7

Description

After the libffi 3.3 update, clang-3.4 doesn't work anymore:

dyld: Library not loaded: /opt/local/lib/libffi.6.dylib
  Referenced from: /opt/local/libexec/llvm-3.4/bin/clang
  Reason: image not found

This prevents the revbumped python27 from building on Mac OS X 10.6 which prevents lots of other ports from building.

The llvm-3.4 portfile's clang-3.4 subport contains this block:

    # Clang doesn't actually use any of these, but the LLVM makefile
    # system overlinks its binaries. Remove (or convert to build deps?)
    # after #46040 is resolved.
    depends_lib-append  port:libffi port:ncurses port:zlib

#46040 is marked resolved. So maybe when we revbump the clang-3.4 subport we take care of that comment.

The clang-3.7 port has the same comment block so might also be affected.

Change History (17)

comment:1 Changed 4 years ago by kencu (Ken)

All the clangs are broken by this. They all need to be revbumped.

Finally pushed it, eh?

comment:2 Changed 4 years ago by ryandesign (Ryan Carsten Schmidt)

All the clangs should not be broken by this, only those that still link with libffi.

The following subports also still declare dependencies on libffi and others that might now be superfluous due to #46040 being resolved: lldb-5.0 lldb-6.0 lldb-7.0 lldb-8.0 lldb-9.0

comment:3 in reply to:  2 Changed 4 years ago by ryandesign (Ryan Carsten Schmidt)

Replying to ryandesign:

All the clangs should not be broken by this, only those that still link with libffi.

You removed the libffi dependency from clang-5.0 and later in [19459a4f78211dc646c1d59a701523e9f0f33fdf/macports-ports].

comment:4 Changed 4 years ago by kencu (Ken)

Maybe. They were broken when I tried them four or five months ago after testing this libffi update I recall, as I had mentioned in Dave’s PR.

That’s why I held off the revbump for clang after that libc++ tweak.

We’ll see shortly I guess.

comment:5 Changed 4 years ago by ryandesign (Ryan Carsten Schmidt)

....ok yes, I remember. You made a change to clang-8.0 clang-9.0 clang-10 in [6ce821918ccbd829438a95b6efa72f7bbad76a99/macports-ports] for C++17 optional support but didn't increase the revision at that time. So those need a revbump for that reason, and clang < 5 needs as revbump (and possible removal of extra dependencies) for the libffi 3.3 reason.

comment:6 Changed 4 years ago by ryandesign (Ryan Carsten Schmidt)

Ok yes, you are right, other clangs I have installed on 10.13 are broken now too:

$ clang-mp-5.0 --version
dyld: Library not loaded: /opt/local/lib/libffi.6.dylib
  Referenced from: /opt/local/libexec/llvm-5.0/lib/libLLVM.dylib
  Reason: image not found
Abort trap: 6
$ clang-mp-6.0 --version
dyld: Library not loaded: /opt/local/lib/libffi.6.dylib
  Referenced from: /opt/local/libexec/llvm-6.0/lib/libLLVM.dylib
  Reason: image not found
Abort trap: 6
$ clang-mp-7.0 --version
dyld: Library not loaded: /opt/local/lib/libffi.6.dylib
  Referenced from: /opt/local/libexec/llvm-7.0/lib/libLLVM.dylib
  Reason: image not found
Abort trap: 6
$ clang-mp-8.0 --version
dyld: Library not loaded: /opt/local/lib/libffi.6.dylib
  Referenced from: /opt/local/libexec/llvm-8.0/lib/libLLVM.dylib
  Reason: image not found
Abort trap: 6
$ clang-mp-9.0 --version
dyld: Library not loaded: /opt/local/lib/libffi.6.dylib
  Referenced from: /opt/local/libexec/llvm-9.0/lib/libLLVM.dylib
  Reason: image not found
Abort trap: 6
$ clang-mp-10 --version
clang version 10.0.1
Target: x86_64-apple-darwin17.7.0
Thread model: posix
InstalledDir: /opt/local/libexec/llvm-10/bin

So they all need revbumps, and those that had their libffi dependencies removed need to have them put back, since they are still needed.

Last edited 4 years ago by ryandesign (Ryan Carsten Schmidt) (previous) (diff)

comment:7 in reply to:  6 Changed 4 years ago by ryandesign (Ryan Carsten Schmidt)

Replying to ryandesign:

Ok yes, you are right, other clangs I have installed on 10.13 are broken now too:

Oh wait, that's because of libLLVM.dylib, which is from the llvm ports, which I'm still in the process of rebuilding.

comment:8 Changed 4 years ago by jmroot (Joshua Root)

Even though clang doesn't actually need libffi, LLVM does.

comment:9 Changed 4 years ago by jmroot (Joshua Root)

I see Dave did rev bump the llvm ports in [bd5d6800828a3dcda1b65f3999fa748a365b168e/macports-ports], but he seems to have missed the clang subports that also have the dependency.

comment:10 Changed 4 years ago by jmroot (Joshua Root)

From what I can tell, the (sub)ports needing to be rev bumped still are clang-3.3, clang-3.4 and clang-3.7.

comment:11 Changed 4 years ago by kencu (Ken)

and we have to do 8,9,10 because of the libc++ thing.

K

comment:12 Changed 4 years ago by ryandesign (Ryan Carsten Schmidt)

I've now tried rebuilding clang-3.4 on my 10.6 system, and it still links with libffi. So the comment claiming that resolving #46040 eliminates the need for the dependency appears to be inaccurate and should be rewritten.

comment:13 Changed 4 years ago by ryandesign (Ryan Carsten Schmidt)

Looks like Larry wrote patches to fix the overlinking in 2014 that are attached to https://bugs.llvm.org/show_bug.cgi?id=21693.

comment:14 Changed 4 years ago by jmroot (Joshua Root)

The comment refers to #46040 which was only resolved in later versions (only in the cmake build system, IIRC). So yeah, the comment should probably be rephrased since that ticket will most likely never be resolved for the older autotools-using versions.

comment:15 Changed 4 years ago by ryandesign (Ryan Carsten Schmidt)

I think Larry believed that the patches he attached to the LLVM bug report above in 2014 solved the issue, but I'm not going to work on this now.

I've turned off the 10.6 buildbot workers, since most everything is failing due to clang-3.4 not working. Once that's fixed, I'll bring it back online. I've already deleted the failcache entries on 10.6 for the builds that failed since the libffi 3.3 update. I'll schedule a forced build on 10.6 for all the ports changed since the libffi 3.3 update.

comment:16 Changed 4 years ago by ken-cunningham-webuse

Resolution: fixed
Status: assignedclosed

In 12e92d7d6c63af6a3f8dda4dc950d9e446d8e64c/macports-ports (master):

clang-3.[3-7]: revbump for libffi update

closes: #61132

comment:17 Changed 3 years ago by mascguy (Christopher Nielsen)

Cc: mascguy added
Note: See TracTickets for help on using tickets.