The man page of dyld
(the dynamic link editor) says:
DYLD_FALLBACK_LIBRARY_PATH ... is a colon separated list of directories that contain libraries. It is used as the default location for libraries not found in their install path. By default, it is set to $(HOME)/lib:/usr/local/lib:/lib:/usr/lib.
However, contrary to the man page, DYLD_FALLBACK_LIBRARY_PATH is empty or undefined by default on Mac OS X, as shown by the following bash commands.
printenv DYLD_FALLBACK_LIBRARY_PATH
# OR
echo $DYLD_FALLBACK_LIBRARY_PATH
In fact, all the environment variables listed and explained on the man page of dyld
are empty or undefined, as revealed by the following bash script.
#!/bin/bash
while IFS=$'\n' read -r; do
printf %b "$REPLY = "
printenv "$REPLY"
echo
done < <(cat << EOF
DYLD_FRAMEWORK_PATH
DYLD_FALLBACK_FRAMEWORK_PATH
DYLD_LIBRARY_PATH
DYLD_FALLBACK_LIBRARY_PATH
DYLD_ROOT_PATH
DYLD_SHARED_REGION
DYLD_INSERT_LIBRARIES
DYLD_FORCE_FLAT_NAMESPACE
DYLD_IMAGE_SUFFIX
DYLD_PRINT_OPTS
DYLD_PRINT_ENV
DYLD_PRINT_LIBRARIES
DYLD_PRINT_LIBRARIES_POST_LAUNCH
DYLD_BIND_AT_LAUNCH
DYLD_NO_FIX_PREBINDING
DYLD_DISABLE_DOFS
DYLD_PRINT_APIS
DYLD_PRINT_BINDINGS
DYLD_PRINT_INITIALIZERS
DYLD_PRINT_REBASINGS
DYLD_PRINT_SEGMENTS
DYLD_PRINT_STATISTICS
DYLD_PRINT_DOFS
DYLD_NO_PIE
DYLD_SHARED_CACHE_DIR
DYLD_SHARED_CACHE_DONT_VALIDATE
EOF
)
Furthermore, while /etc/ld.so.conf
is where Linux stores all the directories that are searched by the loader in order to find the libraries, Mac OSX lacks /etc/ld.so.conf
.
Then, where does Mac OS X store the default search path for libraries?