4 ms·
> That something is rpath (also known as RUNPATH) Pretty sure that runpath and rpath are distinct and have slightly distinct behavior. Can't fault you much for
by wyldfire 5y ago
> That something is rpath (also known as RUNPATH)
Pretty sure that runpath and rpath are distinct and have slightly distinct behavior. Can't fault you much for making the mistake, though. The two are not given names to be easily distinguished.
- nemetroid 5y agoRPATH and RUNPATH are indeed different. However, I believe the -rpath flag is used to set either (--enable/disable-new-dtags determines which one is used), so the confusion is understandable.
- skainswoo 5y agoWhat is the distinction between them? I always thought they were the same thing.
- wyldfire 5y agoThe difference IIRC is the order they're used by the dynamic loader. One is prior to searching LD_LIBRARY_PATH, the other after.
- nemetroid 5y agoThere's also a difference for transitive dependencies. From the Linux manpage for ld.so, about RUNPATH: > Such directories are searched only to find those objects required by DT_NEEDED (direct dependencies) entries and do not apply to those objects' children, which must themselves have their own DT_RUNPATH entries. This is unlike DT_RPATH, which is applied to searches for all children in the dependency tree.
- stabbles 5y agoDepends on your libc. Search order: glibc: rpath > LD_LIBRARY_PATH > runpath > ld.so.cache > default paths. musl: LD_LIBRARY_PATH > rpath=runpath > default paths. Search path inheritance: glibc: rpaths are inherited: When exe depends on libx depends on liby, then liby first considers its own rpaths, then libx's rpaths, then exe's rpaths. HOWEVER if liby specifies runpath, it will not consider rpaths from parents. musl: rpaths and runpaths are the same and always inherited. I verified the glibc/musl sources when writing https://github.com/haampie/libtree https://github.com/haampie/libtree
- deleted 5y ago[deleted]