It is for the dynamic linking case. Previously I thought it's determined at link time (especially seeing 'ldd' return a full path), but now I see that it's determined as a filename and RPATH. so I suppose I need to always include an RPATH for the newer libstdc++. Thanks for your answer.