Re: Handling of runpaths

2020-07-22 Thread Jeffrey Walton
On Fri, Jul 17, 2020 at 4:16 PM Bruno Haible  wrote:
>
> Hi Jeffrey,
>
> > I noticed my runpaths are re-ordered in libraries like
> > libgettextsrc.so, libtextstyle.so, libgettextpo.so, libgettextlib.so,
> > libgettextlib.so, libintl.so and libunistring.so. For example, I use
> > LDFLAGS of:
> >
> > -Wl,-runpath,'$ORIGIN/../lib' -Wl,-runpath,$(prefix)/lib
> > -Wl,--enable-new-dtags
> >
> > Later, when I audit the runpaths, I see the following (when building
> > OpenSSH and dependencies for /opt/ssh):
> >
> > RUNPATH: /opt/ssh/lib:$ORIGIN/../lib
> >
> > Notice the ordering has been changed.
> >
> > Is the re-ordering of runpaths expected?
>
> I don't know. You would need
>   1) to find the specification(s) of -runpath. It must be recent: a
>  GNU ld from 2015 does not support it,
>   2) to determine (using "gcc -v") whether it's libtool, gcc, or the
>  linker which does the reordering.
>
> The specification of DT_RUNPATH appears to be in [1].

Thanks Bruno.

I was talking to the OpenLDAP folks. Their module has 3 problems, so
it was the one I looked at first.

They knew the reordering problem. They said it was libtool. They said
in the past they used to provide a hacked libtool to work around it.
They said they stopped hacking libtool because it needed to happen too
frequently (each update?).

Jeff



Re: Handling of runpaths

2020-07-17 Thread Bruno Haible
Hi Jeffrey,

> I noticed my runpaths are re-ordered in libraries like
> libgettextsrc.so, libtextstyle.so, libgettextpo.so, libgettextlib.so,
> libgettextlib.so, libintl.so and libunistring.so. For example, I use
> LDFLAGS of:
> 
> -Wl,-runpath,'$ORIGIN/../lib' -Wl,-runpath,$(prefix)/lib
> -Wl,--enable-new-dtags
> 
> Later, when I audit the runpaths, I see the following (when building
> OpenSSH and dependencies for /opt/ssh):
> 
> RUNPATH: /opt/ssh/lib:$ORIGIN/../lib
> 
> Notice the ordering has been changed.
> 
> Is the re-ordering of runpaths expected?

I don't know. You would need
  1) to find the specification(s) of -runpath. It must be recent: a
 GNU ld from 2015 does not support it,
  2) to determine (using "gcc -v") whether it's libtool, gcc, or the
 linker which does the reordering.

The specification of DT_RUNPATH appears to be in [1].

Bruno

[1] 
http://www.sco.com/developers/gabi/latest/ch5.dynamic.html#shobj_dependencies




Handling of runpaths

2020-07-17 Thread Jeffrey Walton
Hi Everyone,

I noticed my runpaths are re-ordered in libraries like
libgettextsrc.so, libtextstyle.so, libgettextpo.so, libgettextlib.so,
libgettextlib.so, libintl.so and libunistring.so. For example, I use
LDFLAGS of:

-Wl,-runpath,'$ORIGIN/../lib' -Wl,-runpath,$(prefix)/lib
-Wl,--enable-new-dtags

Later, when I audit the runpaths, I see the following (when building
OpenSSH and dependencies for /opt/ssh):

RUNPATH: /opt/ssh/lib:$ORIGIN/../lib

Notice the ordering has been changed.

Is the re-ordering of runpaths expected?

Jeff