Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
Re: Problem with "make makefiles dynamicmaps=yes"

From: Viktor Dukhovni (postfix-usersdukhovni.org)
Date: Wed Jul 09 2014 - 19:56:30 CDT

On Wed, Jul 09, 2014 at 08:24:18PM -0400, Wietse Venema wrote:

> I want to be able to specify "AUXLIBS=/some/where/libwhatever.a".
> Here is a patch that creates a SYSLIBS subset without *.a, specifically
> for building Postfix shared libraries.

Thanks. What do you want to do about "-Wl,--enable-new-dtags"? I
am not sure how far back in the history of Linux "binutils" this
goes. The Solaris RPATH always defers to LD_LIBRARY_PATH, but on
Linux the initial implementation was a non-preemptable RPATH, and
RUNPATH was added to augment RPATH which remains for backwards
compatibility. On Gentoo it seems some linkers enable the new
dtags by default, and some do not, thus Ralf's observations with
different linker versions.

The key question is how to detect "-Wl,--enable-new-dtags" support.
Perhaps the simplest thing is to just try to link an executable
with this flag, and if it appears to work, use the flag on all
Linux systems. Don't know whether any of the BSD toolchains have
similar issues. On NetBSD the ld.elf_so(1) manpage states:

     The linker will search for libraries in three lists of paths:

     1. A user defined list of paths as specified in LD_LIBRARY_PATH and

          The use of ld.so.conf should be avoided as the setting of a global
          search path can present a security risk.

     2. A list of paths specified within a shared object using a DT_RPATH
          entry in the dynamic section. This is defined at shared object link

     3. The list of default paths which is set to /usr/lib.

So at least NetBSD seems to not need the Linux hack.