This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

library dependencies and --as-needed


Hello, 

I'd like to ask for advice on library dependencies and the --as-needed
linker flag in the GSL project (GNU Scientific Library).

Our main lib file needs to call an external library (BLAS) for vector
operations.  We want people to be able to choose different BLAS
libraries when they link their applications, e.g.

   $ gcc main.c -lgsl -lcblas -lm  # "cblas" can be ATLAS, Intel, AMD, etc

Thefore we don't specify any dependency on the external BLAS with
libtool, since its location would get hard-coded in the GSL shared
library.

This works fine except when the user links their application
--as-needed, which misses the BLAS functions as they are only used in
libgsl.so and (typically) not in the user's object file.

Is there a recommended way to handle this situation?  

It seems like it would work if the search with --as-needed was
recursive, is there any conceptual reason for it not to do that?

Thanks.

-- 
Brian Gough
(GSL Maintainer)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]