编译器可以通过-Wl将选项传递给链接器ld

例如指定动态库搜索路径,see also ^0d5d11

gcc -Wl,-rpath=./
 
# 等价于
gcc -Wl,rpath,./
 
# 传多个path
gcc -Wl,-rpath=/path1,-rpath=/path2
gcc -Wl,-rpath=/path1 -Wl,-rpath=/path2