I recently encountered this problem after an upgrade of the system: using the GCC -Wl,-rpath= option works differently than before.
I used it to set the
The project GNU Binutils (containing GNU linker (ld)) is not at the origin of this change of behaviour, but Debian (2016)1, and Gentoo (2013!)2.
According to gentoo commit from Mike Frysinger on Jan 2013 :
"The "new" dtags options have been around for 14+ years now, so for Linux and GNU targets, enable them by default."
This change are not well received 3, 4, 5, as RUNPATH and RPATH have "undocumented behaviour difference"... Surprisingly this changes is now applied on Debian stable.
The problem is that using RUNPATH, leads to unpredictable problems... But mainly just works . From wikipedia :
The ld dynamic linker does not search DT_RUNPATH locations for transitive dependencies, unlike DT_RPATH.