Article View: gnu.misc.discuss
Article #2250attempting to make a shared libg++
From: Jerry Frain
Date: Sun, 14 Nov 1993 18:19
Date: Sun, 14 Nov 1993 18:19
38 lines
2224 bytes
2224 bytes
We're strongly considering using g++ for C++ development on several
platforms, but statically linking libg++ to each executable is going
make our product rather bloated, I fear.
I've compiled the libg++ objects with -fPIC and linked them into a
shared library on Solaris (to start with, but I have a few other
platforms that will follow if I get one running). I then linked it
with the traditional
#include <iostream.h>
main()
{
cout << "Hello, world.\n";
}
BTW, the above program compiled with `g++ -g -O' comes to about 100K,
while the executable compiled with Sun's `CC -g' is 40K. The stripped
g++ executable is 64K, and the stripped CC executable is about 11K
(oddly enough, compiling with CC and no debugging, the resulting
executable is only about 6K, and strips down to 4K). Hence my
motivation for making a shared libg++.
The above program (compiled with g++ and linked with my shared libg++)
promptly core-dumped with a SIGSEGV in ostream::operator<<. Line 612
in iostream.cc, to be exact. This is a bit distressing, since it is
such a small, simple example.
I'm planning on continuing to try to build a working a shared libg++,
but before I spend too much time on it, has anyone else attempted
this? Any ideas on how difficult this task might be?
Thanks in advance,
--
Jerry Frain | TIVOLI Systems, Inc. | Phone: (512) 502-4694
| 6034 W. Courtyard Dr. #210 | FAX: (512) 794-0623
Jerry.Frain@Tivoli.COM | Austin, TX 78730, USA |
Technical Details
Message-ID:
<jerry.753301158@kenya>Path:
arc1-ca.pugleaf.net!gmd.de!Germany.EU.net!mcsun!howland.reston.ans.net!cs.utexas.edu!geraldo.cc.utexas.edu!tivoli.tivoli.com!jerryShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10ba33,bf0ed279ad02f2c,start X-Google-Attributes: gid10ba33,public X-Google-Thread: 1025b4,bf0ed279ad02f2c,start X-Google-Attributes: gid1025b4,public X-Google-ArrivalTime: 1993-11-14 11:07:50 PST Path: arc1-ca.pugleaf.net!gmd.de!Germany.EU.net!mcsun!howland.reston.ans.net!cs.utexas.edu!geraldo.cc.utexas.edu!tivoli.tivoli.com!jerry From: jerry@tivoli.com (Jerry Frain) Newsgroups: gnu.misc.discuss,gnu.g++.help Subject: attempting to make a shared libg++ Date: 14 Nov 93 18:19:18 GMT Organization: Tivoli Systems, Inc. Lines: 40 Message-ID: <jerry.753301158@kenya> NNTP-Posting-Host: kenya.tivoli.com