General linking question

Tony van der Hoff tony at mk-net.demon.co.uk
Wed Aug 28 07:27:39 PDT 2002


On 28 Aug 2002, in message <4b6d18f8aesbellon at sbellon.de>,
Stefan Bellon <sbellon at sbellon.de> wrote:

I've never used the -aof switch, and I'm not entirely sure what it
does/means, but I suspect it would treat the entire contents of the library
as a single object module, and thus cause the entirety of the library to be
dragged in, which would explain your problem.

[snip]
> 
> Ok, but now I have a problem: How do I create a new library from a few
> other libraries? 

To create a new library from existing ones, I would use LibFile to unpack
them as individual object modules, and then rebuild the new library from
those. 

But why would you want to build a new library?

>With (dr)link -aof you could link together files that have already been
>linked with (dr)link -aof. You cannot do the same with libfile or makealf.

No, that seems entirely reasonable to me; ALF files are not linked; they are
simply collections of unlinked object modules.

>You get:
> 
> AOF Librarian:  (Error)  Bad library member oldlib.
> 
> from libfile and:
> 
> ! Warning (makealf): object file oldlib has no header chunk.
> 
> from makealf.
> 
> I have the problem that I hit the command line length (2048 characters
> as it seems) when linking. With (dr)link -aof I could link together
> parts and then link those parts together. With libfile or makealf this
> doesn't work.
> 
> What am I missing?
> 
Well, link allows you to specify a VIA file, which can contain all the object
file names, so command line length should never be a problem. With a
little effort you can even generate the VIA file from make.

However, I'm finding it hard to understand what you're trying to do. It
sounds like you're abusing the ALF library system in order to work round your
command line problem. Perhaps you shouldn't be using libraries at all?

-- 
Tony van der Hoff         | MailTo:tony at mk-net.demon.co.uk
                          | MailTo:avanderhoff at iee.org
Buckinghamshire, England  | http:www.mk-net.demon.co.uk



More information about the gcc mailing list