From: David Greene <greened@eecs.umich.edu>
To: Joe Buck <jbuck@synopsys.com>
Cc: egcs@cygnus.com
Subject: Re: Template Instantiation
Date: Mon, 09 Feb 1998 09:08:00 -0000 [thread overview]
Message-ID: <Pine.LNX.3.96.980209102754.1030E-100000@drakh.eecs.umich.edu> (raw)
In-Reply-To: <199802090242.SAA05477@atrus.synopsys.com>
On Sun, 8 Feb 1998, Joe Buck wrote:
> > Can someone clarify exactly how template instantiation
> > works in egcs? I'm using x86/Linux/ELF and SPARC/Solaris
> > systems.
>
> On both of these systems, it works pretty much like it does with Borland
> C++. All needed templates are instantiated in each object file, but
> weak symbols are used. At link time, one weak symbol is used as the
> definition. If you have a recent GNU ld, the duplicate definitions, if
> any, get stripped out and are not included in the binary. If you have
> an older linker or are using the Solaris linker, everything works, but
> your executable may contain extra copies of some functions.
This just does not work at all:
CXXFLAGS = -DDEBUG=0 -DLINUX_LIBC6 -pipe -frtti -Wno-reorder \
-Wno-unused
I get lots and lots of undefined symbols, all of them from
templates. I create a library with
ar -r libblah <lots of .o files here>
ranlib libblah
I know that ranlib is not realy necessary, but it shouldn't hurt
anything. Perhaps the template code does not get generated, though
from your passage above, I gather that it should have been generated
when the .o files were created. Is this true?
My system stats:
>>-drakh-> uname -a
Linux drakh.eecs.umich.edu 2.0.33 #1 Mon Feb 2 17:39:49 EST 1998 i686
unknown
>>-drakh-> g++ -v
Reading specs from
/nfs/srvrdsk1.eecs.umich.edu/t/Install/i686/Linux/lib/gcc-lib/i686-pc-linux-gnu/egcs-2.90.23/specs
gcc version egcs-2.90.23 980102 (egcs-1.0.1 release)
>>-drakh-> ar --version
GNU ar 980114
Copyright 1997 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License. This program has absolutely no warranty.
>>-drakh-> ld --version
GNU ld 2.8.2
Copyright 1997 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License. This program has absolutely no warranty.
Supported emulations:
elf_i386
i386linux
What am I doing wrong?
-Dave
next prev parent reply other threads:[~1998-02-09 9:08 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
1998-02-08 11:38 David Greene
1998-02-08 18:44 ` Joe Buck
1998-02-09 9:08 ` David Greene [this message]
1998-02-09 11:54 ` Joe Buck
1998-02-09 11:54 ` David Greene
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Pine.LNX.3.96.980209102754.1030E-100000@drakh.eecs.umich.edu \
--to=greened@eecs.umich.edu \
--cc=egcs@cygnus.com \
--cc=jbuck@synopsys.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).