Meson & non-Xcode compilers -- esp older OSX versions

Craig Treleaven ctreleaven at cogeco.ca
Tue Aug 3 16:28:22 UTC 2021


Hi:

Could someone with access to 10.9 and/or older OSX versions lend a hand?

A user reported that ffmpeg on 10.9 compiled with clang-devel was failing on launch, thusly:

$ffmpeg -version
dyld: Library not loaded: @rpath/libdav1d.5.dylib
 Referenced from: /opt/MacPorts/bin/ffmpeg
 Reason: image not found
Trace/BPT trap: 5

Details in: https://trac.macports.org/ticket/63330

I had updated dav1d to 0.9.1 just recently and I noticed that the buildbot logs reported a WARNING/error on 10.9 and earlier:

:info:build [113/114] /opt/local/Library/Frameworks/Python.framework/Versions/3.9/bin/meson --internal symbolextractor /opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_multimedia_dav1d/dav1d/work/build src/libdav1d.5.dylib src/libdav1d.5.dylib src/libdav1d.5.dylib.p/libdav1d.5.dylib.symbols 
:info:build WARNING: ['nm'] does not work. Relinking will always happen on source changes.
:info:build error: /Library/Developer/CommandLineTools/usr/bin/nm: invalid argument --
:info:build Usage: /Library/Developer/CommandLineTools/usr/bin/nm [-agnopruUmxjlfAP[s segname sectname] [-] [-t format] [[-arch <arch_flag>] ...] [file …]

There are no such complaints on 10.10 and later.  On 10.9 and earlier, clang-9.0 is used as the compiler:

:notice:configure --->  Configuring dav1d
:debug:configure Preferred compilers: clang macports-clang-9.0 macports-clang-8.0 macports-clang-7.0 macports-clang-6.0 macports-clang-5.0 macports-clang-12 macports-clang-11 macports-clang-10 macports-clang-3.7 macports-clang-3.4
:debug:configure Using compiler 'MacPorts Clang 9.0'
:debug:configure Executing org.macports.configure (dav1d)
:debug:configure Environment: 
:debug:configure CC='/opt/local/bin/clang-mp-9.0’

On 10.10 and later, the Xcode-supplied compiler is used.  This makes me believe that meson may not correctly support non-Xcode compilers on Mac.  But I’m not at all sure since I don’t have access to a 10.9 or earlier system.

Therefore, could someone please install ffmpeg on 10.9 or earlier and try ‘ffmpeg -version’ to see if you also get the @rpath-related error?

Thanks,

Craig

PS On the meson GitHub issue tracker, there are a number of reports related to rpath issues on Mac.  AIUI, meson initially builds executables with @rpath-style linking to facilitate running tests in the build directory.  At install, however, they rewrite the links to absolute-style.  The available logging doesn’t provide any details regarding the rewrite step, however.  I presume (but haven’t confirmed) that the rewrite relies on the symbolextractor step that is crapping out.


More information about the macports-dev mailing list