newsGNU Scientific Library - News: GNU Scientific Library dependencies and linking with --as-needed

Latest News
GNU Scientific Library 1.15 released posted by bjg, Sat 07 May 2011 09:46:23 PM UTC - 0 replies
GNU Scientific Library repository migrated to Bazaar posted by bjg, Tue 04 May 2010 11:56:08 AM UTC - 0 replies
GNU Scientific Library 1.14 released posted by bjg, Fri 12 Mar 2010 12:46:37 PM UTC - 0 replies
GNU Scientific Library 1.13 released posted by bjg, Wed 09 Sep 2009 03:40:05 PM UTC - 0 replies
Libre Planet meeting posted by bjg, Fri 20 Feb 2009 11:58:35 AM UTC - 0 replies
[Submit News]
[12 news in archive]

GNU Scientific Library dependencies and linking with --as-needed

Item posted by -Deleted Account- <bjg> on Mon 09 Feb 2009 05:57:54 PM UTC.

Many distributions are starting to link every application with the GNU Linker's --as-needed flag, to avoid loading libraries that are specified on the command-line but not actually used.

While this is a good thing, it caused a problem for applications using GSL because the main library needs to call an external library for vector operations (BLAS). These BLAS functions are typically not called from the user's object file directly, and they were being discarded by --as-needed causing numerous "unresolved reference" errors. The problem arises because --as-needed does not follow references recursively, except for direct shared library dependencies specified by the ELF DT_NEEDED field (i.e libraries explicitly defined as a dependency in libtool).

In the case of GSL we are not able to specify the dependency on the external library explicitly--we do not know which BLAS library will be used. We want people to be able to choose different BLAS libraries when they link their applications.

Now thanks to Alan Modra there is a enhancement to binutils [1,2] which allows --as-needed to search recursively, ensuring that libraries which are used both directly and indirectly will be linked, and only those with no references at all will be discarded. The next release of binutils should resolve the problems encountered using GSL with --as-needed.



No messages in GNU Scientific Library dependencies and linking with --as-needed


Back to the top

Powered by Savane 3.1-cleanup