I have libA.so, libB.so, and an executable 'foo'. 'foo' needs libB.so which itself needs libA.so. During linking foo explicitly links with libB because it directly uses symbols from it. 'foo' does not directly use symbols from libA. When linking 'foo', ld wants to check it can resolve symbols references from libB in libA but it can't find libA. I can make it find libA by using -Wl,rpath-link=, or I can have the linker ignore libA using -Wl,--allow-shlib-undefined.
The problem is I shouldn't have to set either of these options because libB.so contains an rpath that tells the linker where to find libA.so and the linker uses this rpath at runtime to successfully find libA. So why doesn't it use it at link time? Forcing foo's build configuration to know where libA is seems completely unnecessary in this case?