This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: problem creating a static library
- From: Danilo José <danilo dot guerrero at deimos-space dot com>
- To: "Mike Stump" <mrs at apple dot com>
- Cc: <gcc at gcc dot gnu dot org>
- Date: Fri, 1 Oct 2004 02:12:02 +0200
- Subject: Re: problem creating a static library
- References: <009f01c4a64e$1e562b00$420216ac@deimosspace.com> <3DAC1DD3-124D-11D9-9765-000393941EE6@apple.com> <007201c4a6dc$183726a0$420216ac@deimosspace.com> <ACAEB5CE-1317-11D9-9765-000393941EE6@apple.com> <017601c4a72d$8e092f30$420216ac@deimosspace.com> <300B34F6-132C-11D9-9765-000393941EE6@apple.com>
Hi!
I have tested to do the thing you recommended me to
do the ld -r *.o -o new.o
Then I have done the library libgol.a using the new.o.
And what happens is that I get still 4 undefined symbols:
___Q23golt13ObjAppendList1ZPQ23gol14CalcBinderDatalPCPB1
___Q23golt13ObjAppendList1ZblPCb
___ls__Q23golt13ObjAppendList1ZPQ23gol14CalcBinderDataRCPB1
___ls__Q23golt13ObjAppendList1ZbRCb
When I apply the c++filt to them, it gets me the next output.
0005169c s gol::ObjAppendList<gol::CalcBinderData *>::ObjAppendList(long,
gol *const *)
0005177c s gol::ObjAppendList<bool>::ObjAppendList(long, bool const *)
00051484 s gol::ObjAppendList<gol::CalcBinderData *>::operator<<(gol
*const &)
000515b4 s gol::ObjAppendList<bool>::operator<<(bool const &)
But the others undefined symbols have disappeared.
But I can't still do the executable.
The .s files I do not think it will be a good approach, because I need to
deliver this makefile to build the libgol.a, so others could use it.
As far as I know the problem with this is that it has the flag 's' if it
were 'S' it would work. So is there any way to get the 'S' flag, with a
makefile.
----- Original Message -----
From: "Mike Stump" <mrs@apple.com>
To: "Danilo José" <danilo.guerrero@deimos-space.com>
Cc: <gcc@gcc.gnu.org>
Sent: Friday, October 01, 2004 12:00 AM
Subject: Re: problem creating a static library
> On Sep 30, 2004, at 1:39 PM, Danilo José wrote:
> > I suppose that .s file is the .a file
>
> .s is the assembly version of the file. See man gcc under -save-temps.
>
> > The thing is that I need to use the .a file, because it is a
> > requirement
> > of the migration to Mac Os X.
>
> Ok, another solution would be ld -r *.o -o new.o and put new.o in the
> .a file. This might be the easiest to get working for you, now that I
> think of it.
>
> > 2) I think the problems come because StdError.o does has undefined
> > that
> > method. Because if I include in the code of the StdError.c the template
> > instantiation that is not found, it does not have any problem to
> > compile.
> > But I can not do this because I can not duplicate the code, because
> > that
> > file is already compiled in another object.
>
> I don't know what you mean by cannot duplicate code. template
> instantiation doesn't duplicate code[1].
>
> > What is the other way that you told me of doing a workaround, I
> > did not
> > understand it very well.
>
> Remove the string notoc (or no_toc) and the extra , from the .s files
> before assembling.
>
>
> 1 - size a.out numbers remain the same, the summation of all the .o
> files appears larger than the a.out numbers.
>