Whamcloud - gitweb
Link shared libraries with local libraries instead of system ones
authorOlivier Blin <olivier.blin@softathome.com>
Sun, 29 Jul 2012 16:44:53 +0000 (12:44 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Sun, 29 Jul 2012 16:45:47 +0000 (12:45 -0400)
commita7c17431b9fbf767235d614cfe2e4f22ee0d6771
tree1ac5048914595dc34a4c365a560561c8c88a1ab0
parentd2051f11044290d288a4f03220f07fe9651588c9
Link shared libraries with local libraries instead of system ones

ELF_OTHER_LIBS usually contains local search dirs (-L ../..), but it
was added in link command after system search dirs from LDFLAGS.

Libraries and executables were linked with the system libraries if
present, and possibly using static archives instead of shared
libraries.

It could also make final executable link to fail when shared libraries
are enabled: if libext2fs.so is linked with a static libcom_err.a from
system, build system would attempt to link without -lpthread.

This fixes the issue by moving ELF_OTHER_LIBS before LDFLAGS in the
link command.

Addresses-Sourceforge-Bug: #3542572

Reported-by: Olivier Blin <blino@users.sourceforge.net>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
lib/Makefile.elf-lib
lib/Makefile.solaris-lib