help-make
[Top][All Lists]
Advanced

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

Re: Automatic dependencies for linked libraries


From: Stephan Beal
Subject: Re: Automatic dependencies for linked libraries
Date: Thu, 25 Mar 2010 16:29:26 +0100

On Thu, Mar 25, 2010 at 3:50 PM, Steve Deiters <address@hidden> wrote:
Is there a method to have gcc or ld automatically generate a list of
dependencies for statically linked libraries?

Neither could be used generate such dependencies because such deps cannot be calculated until after the code is linked (i.e., all external symbols have been resolved). Any change of the client code could change which libs it needs. We cannot know which external symbols it needs until it is compiled, and do not know where they come from until it is linked. Chicken vs. egg.

My fallback plan is to parse through the LDFLAGS for the library names
and paths and add the dependencies programmatically by calling eval, but
I would like to avoid this if possible.

If you do get this working generically, i would like to see the code if you don't mind posting it :).

--
----- stephan beal
http://wanderinghorse.net/home/stephan/

reply via email to

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