Great catch!!
Agree with the fix or "workaround."
Actually, that's no longer the case with the latest Entware updates, which caused the problem to come up now.
Starting with the most recent updates, the Entware developers modified the embedded library search path mechanism used by their latest ELF binaries. Now, the newest versions are using '
RUNPATH' (newer mechanism) instead of '
RPATH' (old/legacy method), which changed the
order of precedence when searching for and loading dynamically linked shared libraries.
The library paths defined with
RPATH have higher search priority than those defined via the
LD_LIBRARY_PATH environment variable, which means that shared libraries found via
RPATH always took precedence over the ones from
LD_LIBRARY_PATH.
OTOH, the library paths now defined via
RUNPATH are searched
*AFTER* those defined via the
LD_LIBRARY_PATH variable.
The end result is that once you have upgraded to the latest Entware binaries, users run the risk of loading the "wrong" libraries via
LD_LIBRARY_PATH (when defined/inherited by the runtime environment) because the binaries now use the
RUNPATH mechanism. And that's essentially the root cause that brought the problem to the forefront.
Sample screenshot showing previous "
/opt/bin/jq" binary version using
RPATH:
View attachment 71150
And now the latest "
/opt/bin/jq" binary version using
RUNPATH:
View attachment 71151
FYI.