What are the recommended GNU linker options to specify $ORIGIN in RPATH?
问题 Assume my platform is vanilla (non-embedded) x86-64 Linux using GNU build toolchain (GCC, etc.). To specify $ORIGIN in RPATH , I know about the linker option: -Wl,-rpath,'\$\$ORIGIN' . Today, I discovered another option: -Wl,-z,origin . Should I always include -Wl,-z,origin when using -Wl,-rpath,'\$\$ORIGIN' ? Official GNU ld docs, say: Marks the object may contain $ORIGIN. Related, but different: https://stackoverflow.com/questions/33853271/what-are-the-recommended-gnu-linker-options-to