CMPDYLIB(1)

πŸ“¦ version 1010.6, in nixpkgs unstable

πŸ¦‹ 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 newLibrary is greater than oldLibrary, 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