Score:0

What is overriding shared objects' dynamic library search paths?

br flag
Tim

Building PHP from source on macOS (Ventura) I've installed ICU in a non-standard location and built the intl extension as a shared library.

I can run this by setting my non-standard location with an environment variable DYLD_FALLBACK_LIBRARY_PATH=/usr/local/php80/lib (Same technique as per the documented trick using LD_LIBRARY_PATH). However, I don't want to use environment variables. I won't muddy the waters here with why. I'd like to understand why the shared object intl.so is not looking in the configured location for the ICU library files.

In the Makefile I can see this line, which I assume defines linker flags:
INTL_SHARED_LIBADD = -Wl,-rpath,/usr/local/php80/lib -L/usr/local/php80/lib -licuio -licui18n -licuuc -licudata

This seems correct, but this is not where the extension is looking. Something is overriding it at runtime. It looks in some sensible locations like /usr/lib but also some bizarre places such as under /System/Volumes/Preboot/Cryptexes/OS which is not a path that I can see comes from the PHP build at all.

I also tried modifying the shared object's rpath using tools like install_name_tool but it makes no difference as the problem seems to be external.

I'm inclined to symlink the ICU libs into one of its search paths, but it's not a great solution. I could also just install ICU into /usr/local/lib but I like to keep my play things separate.

Does anyone know how to fix this properly?

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.