Hi Branden,
> Partly. What I need to know at this point is an easy way from a shell
> script to ask the system what its libc implementation is, when it's
> "libSystem.dylib" in particular.I don't know if there's any such thing
> as running an alternative libc on a macOS/Darwin system--maybe the
> system crashes; maybe Apple activates a kill switch in your Mac; or
> maybe things work more or less fine.
what I propose might be too simple, especially in the light of John's
message, but one way to determine if the libc implementation is
libSystem.dylib could be: otool -L $(which printf)
otool(1) is macOS's equivalent of ldd(1) and with the -L option it
"display[s] the names and version numbers of the shared libraries that
the object file uses, as well as the shared library ID if the file is
a shared library." — otool(1)
for macOS (run in bash):
otool -L $(which printf)
/usr/bin/printf:
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current
version 1356.0.0)
for groff's build environment in nixpkgs on macOS (run in bash):
otool -L $(which printf)
/nix/store/sqv8nbx301w2xg2iqzim7hraid6ki1la-coreutils-9.8/bin/printf:
/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
(compatibility version 150.0.0, current version 2420.0.0)
/System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices
(compatibility version 1.0.0, current version 1226.0.0)
/nix/store/rxfgl0ph6lk1h0py159gc74w6282q224-gmp-with-cxx-6.3.0/lib/libgmp.10.dylib
(compatibility version 16.0.0, current version 16.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current
version 1345.100.2)
Note that $(which printf) will not work reliably as printf can be
a shell built-in as is the case for macOS' default shell, i.e. zsh.
Best
Alexis