bug-libtool
[Top][All Lists]
Advanced

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

picewise linking and MS lib.exe


From: Christopher Hulbert
Subject: picewise linking and MS lib.exe
Date: Sun, 27 Aug 2006 13:21:25 -0400

Piecewise linking with the MS archiver (lib) doesn't work. Every
invocation of the lib clobbers the old one. The solution is to list
the library as the first "object" (really anywhere should be fine) in
the next lib command. I'm not sure how to patch this. It looks like
the piecewise linking code in ltmain.m4sh doesn't depend on what
linker it's using. Any ideas on how best to patch this?

e.g.

address@hidden ~
$ cat test1.c test2.c
#include <stdlib.h>

double add(double x,double y)
{
   return (x+y);
}
#include <stdlib.h>

double sub(double x,double y)
{
   return (x-y);
}

address@hidden ~
$ pgcc -c test1.c test2.c
test1.c:
test2.c:

address@hidden ~
$ lib /out:libtest.lib test.o
Microsoft (R) Library Manager Version 7.10.3077
Copyright (C) Microsoft Corporation.  All rights reserved.


address@hidden ~
$ lib /list libtest.lib
Microsoft (R) Library Manager Version 7.10.3077
Copyright (C) Microsoft Corporation.  All rights reserved.

test.o

address@hidden ~
$ lib /out:libtest.lib test2.o
Microsoft (R) Library Manager Version 7.10.3077
Copyright (C) Microsoft Corporation.  All rights reserved.


address@hidden ~
$ lib /list libtest.lib
Microsoft (R) Library Manager Version 7.10.3077
Copyright (C) Microsoft Corporation.  All rights reserved.

test2.o

address@hidden ~
$ lib /out:libtest.lib libtest.lib test.o
Microsoft (R) Library Manager Version 7.10.3077
Copyright (C) Microsoft Corporation.  All rights reserved.


address@hidden ~
$ lib /list libtest.lib
Microsoft (R) Library Manager Version 7.10.3077
Copyright (C) Microsoft Corporation.  All rights reserved.

test.o
test2.o




reply via email to

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