Subject: Re: Perl package modification
To: Emmanuel Dreyfus <p99dreyf@criens.u-psud.fr>
From: Todd Vierling <tv@wasabisystems.com>
List: tech-pkg
Date: 04/13/2001 13:57:05
On Fri, 13 Apr 2001, Emmanuel Dreyfus wrote:

: > If you change "c++" back to "cc" here, I'm happy with it.  The use of "c++"
: > will include libstdc++, which /usr/pkg/bin/perl should *not* depend on.  Use
: > shlib dependencies for that.
:
: Sorry, I need the c++ here. Xerces-P is a Perl API for Xerces-C, which
: is written in C++. At link time, some C++ specific stuff (such as
: __pure_virtual) is requiered for it to run. This stuff can be find in
: libgcc.a, which is non PIC, and hence we need this to be in the perl
: executable.
:
: If I replace c++ by cc, this stuff is missing, and it won't link.

With --whole-archive, you should get it; if that's not working, something
else is wrong.  Perhaps the following option would be better?

cc ... -Wl,--whole-archive,-lgcc,--no-whole-archive

This will pass the options in proper order directly to the linker.

The c++ command has nothing to do with this--you just want to link in all of
libgcc, which is already in the modified command you gave.  The only
difference between using cc and c++ is that c++ will link in libstdc++.so,
which perl should not have.

: What is the problem with perl depending on libstdc++?

Startup overhead.  There are global constructors in libstdc++, as well as
pages to track in the memory map--something completely unnecessary for most
Perl uses.

-- 
-- Todd Vierling <tv@wasabisystems.com>  *  Wasabi NetBSD:  Run with it.
-- NetBSD 1.5 now available on CD-ROM  --  http://www.wasabisystems.com/