CMPDYLIB(1)
π¦ CMPDYLIB(1) π¦
okay so this is a page from the General Commands Manual β yes, the real one, sitting pretty at section 1, bestie. pull up a chair π
β¨ NAME β¨
cmpdylib β compare two dynamic shared libraries for compatibility π«Ά
πΈ SYNOPSIS πΈ
cmpdylib oldLibrary newLibrary
π DESCRIPTION π
so cmpdylib takes two versions of a dynamic shared library and is basically like "are you two still cool with each other or not". that's the whole vibe check.
if the two versions turn out to be incompatible, the reason gets printed to stdout, and the exit status is nonzero (π not slay). if they're compatible, literally nothing gets printed and the exit status is zero. silent approval. iconic.
now, how does it actually decide?? okay so, first cmpdylib verifies that newLibrary was built for all of the architectures that oldLibrary was built for. if that checks out, then for each architecture it checks whether the global symbols defined in oldLibrary are still defined in newLibrary. then it goes looking for new symbols β symbols defined in newLibrary that are not defined in oldLibrary. and if it finds any new symbols, it compares the compatibility version numbers of the two libraries:
- if the compatibility version number of
newLibraryis greater thanoldLibrary, the libraries are still compatible π - if the compatibility version number is the same or less, the libraries are incompatible π
no cap, that's the whole algorithm.
π OPTIONS π
oldLibraryβ the older version of the library. the OG.newLibraryβ the newer version of the library. the glow-up.
β EXAMPLES β
this example shows what you get when you run cmpdylib on two incompatible versions of the Foundation library. and yeah, as stated, they're incompatible because the newer version was not built for the ppc architecture β awkward π
cmpdylib /System/Library/Frameworks/Foundation.framework/Foundation
Foundation_proj/Foundation
cmpdylib: file: Foundation_proj/Foundation does not contain
architecture: ppc
cmpdylib: new dynamic shared library: Foundation_proj/Foundation does
not contain architecture ppc
π₯ DIAGNOSTICS π₯
the exit status is zero if the library versions are compatible, and nonzero if they're incompatible. simple as that. π
π BUGS π
ngl there are lots of other things that could be checked for that just... are not. for example, the Objective C API. not me leaving that on read π
ok bestie, that's the whole page. go forth and compare your libraries responsibly π§
made with love by Apple Computer, Inc. β November 3, 1997 πβ¨π
π¦ where this page comes from
- nixpkgs unstable: cctools 1010.6
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms