On 06/01/2017 11:09 AM, Vincent Lefevre wrote:
On 2017-06-01 09:56:29 +0200, Thomas Jahns wrote:
GCC doesn't generate binaries or shared libraries, ld does. Passing

-Wl,-rpath,/path/to/dependency/lib

But this is not automatic. When typing

  $CC program.c -o program -lmpfr -lgmp

(where $CC can be gcc, tcc or icc, for instance), things should just
work, i.e. the correct options should be passed to ld *by default*.

That would be nice, on AIX directories passed with -L are also added to the run-time library search path. But since some people don't want that either for places that only contain static archives, -L and -Wl,-rpath both need to be accounted for by the person/automaton invoking the link editor.

Perhaps defining the LD_RUN_PATH environment variable instead of
LD_LIBRARY_PATH could be a workaround, but gold does not support
it, so that this cannot be a general solution.

Linking is very platform- and tool-dependant. LD_LIBRARY_PATH is also not general (read what it does on BSD or Solaris to find out more, it does not do anything on e.g. AIX, macOS, Windows...).

Moreover, what path should be given when the library is on NFS, where
the mount point (e.g. $HOME directory) depends on the machine?

That's just an accident waiting to happen and shows more about bad system management than tooling. But as I wrote, library paths that are invariant relative to the binary can still work.

Note that it is important that several machines can be used at the
same time, e.g. for parallel computing on a network of machines.

I don't know of any site with such a setup, seems like to little thought went into planning somewhere.

will do just what's needed (for most people on this list libtool
does so for them).

libtool is used to compile libraries, but in general, the user does
not use it to build an executable.

On the contrary, in autotools projects, libtool is automatically used for linking both, libraries and executables.

Thomas

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

_______________________________________________
https://lists.gnu.org/mailman/listinfo/libtool

Reply via email to