develooper Front page | perl.perl5.porters | Postings from February 2003

[perl #20758] DynaLoader not compiled PI on Solaris/GCC

Thread Next
From:
Jean-Marc Tanzi
Date:
February 6, 2003 10:03
Subject:
[perl #20758] DynaLoader not compiled PI on Solaris/GCC
Message ID:
rt-20758-50460.9.08637005350968@bugs6.perl.org
# New Ticket Created by  Jean-Marc Tanzi 
# Please include the string:  [perl #20758]
# in the subject line of all future correspondence about this issue. 
# <URL: http://rt.perl.org/rt2/Ticket/Display.html?id=20758 >


Hi,

this problem appears on the following configuration (at least):

Perl:                         5.6.1 and 5.8.0
System:                       Solaris 2.8
Compilers:              gcc 2.95.3
Specific Configure option:    --Duseshrplib

Symptom:

  trying to link the shared library libperl.so (in my case, to enable
PL/Perl support in PostgreSQL database) results in the following messages:

   Text relocation remains                       referenced
       against symbol                  offset      in file
   Perl_free_tmps                      0x104
   /export/home/jtanzi/System/local/lib/perl5/5.6.1/sun4-solaris/
   auto/DynaLoader/DynaLoader.a(DynaLoader.o)
   ......<lots of similar lines removed>....
   ld: fatal: relocations remain against allocatable but non-writable
   sections
   collect2: ld returned 1 exit status
   make: *** [libplperl.so.0.0] Error 1

Cause:

    The .../perl-5.8.0/ext/DynaLoaderDynaLoader.c file is not compiled with
   the -fPIC option, and so the DynaLoader.a lib contains some position
   dependent code that the linker refuses to include in another shared
   object.

Possible fix (let's say bad hack, was actually too lazy to track the
generation of the Makefile in ext/DynaLoader, sorry):

      - rename .../perl-5.8.0/ext/DynaLoader/dl_dlopen.xs to
   dl_dlopen.xs.xxx
      - start make
      - when compil. stops with error (dl_dlopen.xs not found):
      - rename dl_dlopen.xs back
      - modify .../perl-5.8.0/ext/DynaLoader/Makefile so CCFLAGS includes
   -fPIC
      - restart make

It worked for me at least...

 Best regards,

     Jean-Marc Tanzi

===========================================
Amadeus ADP - Erding         Tel: +49 8122 43 5095
jtanzi@amadeus.net               Fax: +49 8122 43 3470







Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About