The specification is now simple
- On linux, use
-Xlinker -rpath -Xlinkerto set the rpath of the executable
- On darwin, never use
-Xlinker -rpath -Xlinker, always inject the rpath afterwards, see
-fno-use-rpathsis passed then never inject anything into the rpath.
Fixes #20004 (closed)
cc @angerman for review as the architect of the current logic.