[lldb-dev] Heads-up: FreeBSD LLDB CMake build broken by, relative rpath change

John Wolfe jlw at xinuos.com
Thu Feb 27 15:44:24 PST 2014

On Feb 27 10:12:21 CST 2014, Ed Maste <emaste at freebsd.org wrote:

> Aha, I think I've finally found a reference that makes sense of
> DF_ORIGIN, in this decade-old SCO documentation:
> http://www.sco.com/developers/gabi/2003-12-17/ch5.dynamic.html
> Based on this I think that FreeBSD's rtld is actually in the wrong
> here, and an executable's rpath that contains $ORIGIN should undergo
> substitution, regardless of the state of the DF_ORIGIN flag.  If I
> understand correctly DF_ORIGIN should be necessary only in the case of
> an executable that does not use $ORIGIN in an rpath, but later
> dlopen()s a library that does.
> That said, it still seems safe to just set the flag always.

Ed is correct.   The handling of ${ORIGIN} was introduced the Generic 
Application Binary Interface by July of 2000.

The DF_ORIGIN is only necessary if the a.out does not use ${ORIGIN} in a 
DT_NEEDED or DT_RUNPATH tag. and expects or anticipates that a $ORIGIN 
may be encountered later in the execution such as a dlopen() call.   
DF_ORIGIN was provided as a means of insuring correct results in these 
delayed pathname resolutions without requiring every a.out to incur the 
cost of a realpath() for its true location when started.

More information about the lldb-dev mailing list