[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: DESTDIR install and OpenBSD

From: Ralf Wildenhues
Subject: Re: DESTDIR install and OpenBSD
Date: Thu, 26 Jan 2006 16:20:56 +0100
User-agent: Mutt/1.5.11

* Ralf Wildenhues wrote on Thu, Jan 26, 2006 at 02:27:42PM CET:
> I believe the logic should correctly be somehow like this:

Second version.

>    if test "$hardcode_direct" = yes && test -z "$inst_prefix_dir"; then

Not quite correct.  We may be doing a non-cross compile, and only part
of the libraries we need may actually already reside below DESTDIR, and
the rest below $libdir.  So let's try this instead:

     if test "$hardcode_direct" = yes &&
        { test -z "$inst_prefix_dir" || test ! -f 
"$inst_prefix_dir$libdir/$linklib"; }; then

which is already much closer to the workaround Jacob posted.

>      add="$libdir/$linklib"
>    elif ...
>    #..
>    else
>      # We cannot seem to hardcode it;  try libdir_flag_spec
>      if test -n "$hardcode_libdir_flag_spec"; then
>         ... utilize that
          ... but only if we can override it from the command line.[1]

>      fi
>      ... (add_dir calculation)
>    fi


[1] I believe this is possible for all systems, when you link against
all dependent libraries.  However, when trying to make indirect deplibs
work, we'd also need linker support for finding them in the DESTDIR
case.  To elaborate: when we _don't_ add all deplibs _explicitly_ on the
command line, this algorithm (from GNU binutils ld info pages) will kick

| The linker uses the following search paths to locate required
| shared libraries.
|   1. Any directories specified by `-rpath-link' options.
|   2. Any directories specified by `-rpath' options.  The difference
|      between `-rpath' and `-rpath-link' is that directories
|      specified by `-rpath' options are included in the executable
|      and used at runtime, whereas the `-rpath-link' option is only
|      effective at link time. It is for the native linker only.
|   3. On an ELF system, if the `-rpath' and `rpath-link' options
|      were not used, search the contents of the environment variable
|      `LD_RUN_PATH'. It is for the native linker only.
|   4. On SunOS, if the `-rpath' option was not used, search any
|      directories specified using `-L' options.
|   5. For a native linker, the contents of the environment variable
|   6. For a native ELF linker, the directories in `DT_RUNPATH' or
|      `DT_RPATH' of a shared library are searched for shared
|      libraries needed by it. The `DT_RPATH' entries are ignored if
|      `DT_RUNPATH' entries exist.
|   7. The default directories, normally `/lib' and `/usr/lib'.
|   8. For a native linker on an ELF system, if the file
|      `/etc/' exists, the list of directories found in
|      that file.

So either we need to utilize `-rpath-link' (we need to walk the deplib
set in order to find out), or some other mechanism that will allow to
prepend $inst_prefix_dir in ld search paths.  I don't know of a suitable
mechanism in the Solaris linker.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]