ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> perl5-porters
perl5-porters
Building a shared libperl should be the default for 5.12
by Tim Bunce other posts by this author
Nov 4 2009 5:01AM messages near this date
Re: [PATCH] Add assertions about there being no leftover scopes when enter perl_destruct. | Re: Building a shared libperl should be the default for 5.12
INSTALL says:

    =head3 Building a shared Perl library

    Currently, for most systems, the main perl executable is built by
    linking the "perl library" libperl.a with perlmain.o, your static
    extensions, and various extra libraries, such as -lm.

    On systems that support dynamic loading, it may be possible to
    replace libperl.a with a shared libperl.so.  If you anticipate building
    several different perl binaries (e.g. by embedding libperl into
    different programs, or by using the optional compiler extension), then
    you might wish to build a shared libperl.so so that all your binaries
    can share the same library.

    The disadvantages are that there may be a significant performance
    penalty associated with the shared libperl.so, and that the overall
    mechanism is still rather fragile with respect to different versions
    and upgrades.

    In terms of performance, on my test system (Solaris 2.5_x86) the perl
    test suite took roughly 15% longer to run with the shared libperl.so.
    [...]

    You can elect to build a shared libperl by

        sh Configure -Duseshrplib


I think it's strategically important for there to be a libperl shared
library available on all systems that support it.

One current example use-case is plperl embedded in PostgreSQL. That
doesn't get enabled when postgres is built unless there's a shared
libperl available.

One future use-case is that perl5 support in perl6, especially for
compiled extensions, may involve embedding the perl5 libperl into
whatever's executing perl6, e.g., parrot.

Building of a shared libperl isn't the default on all platforms that
support it. I suspect because of performance issue noted in INSTALL.

For example:
hints/darwin.sh:# useshrplib=true results in much slower startup times.
hints/darwin.sh:# 'false' is the default value. Configure -Duseshrplib to override.

It seems to me that -Duseshrplib conflates two things that should be
separate: a) the building and installing of a shared libperl, and
b) linking the perl executable against it instead of the libperl.a.

I'd like to see a separate -Dmakeshrplib (eg) option to enable building
and installing of a shared libperl. -Duseshrplib would then also imply
-Dmakeshrplib.

The -Dmakeshrplib option should be enabled by default where possible,
so the availability of a shared libperl becomes much more common.

There would be no change to how the perl executable itself is linked.

Tim.
Thread:
Tim Bunce
Nicholas Clark
Tony Cook
Nicholas Clark
Tony Cook
Tim Bunce
Andy Dougherty
Tim Bunce
Andy Dougherty
Nicholas Clark
Andy Dougherty
H.Merijn Brand
H.Merijn Brand
Craig A. Berry
H.Merijn Brand
Tim Bunce
H.Merijn Brand
H.Merijn Brand
H.Merijn Brand

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved