Ticket #87 (closed defect: fixed)

Opened 12 years ago

Last modified 12 years ago

Perl and -fPIC

Reported by: jciccone Owned by: clfs-commits@…
Priority: critical Milestone: CLFS Standard 1.0.0
Component: BOOK Version: CLFS Standard 1.0.0
Keywords: perl fPIC DynaLoader Cc:


Programs like xchat and gaim can't build their perl plugins (as shared libraries) because the DynaLoader?.a library provided by perl is not linked with -fPIC.

This patch makes it so that the objects in DynaLoader?.a are built with -fPIC.  http://cross-lfs.org/~jciccone/perl-5.8.8-fPIC-1.patch

I'd like to see this go into the book before RC4.

Change History

comment:1 Changed 12 years ago by jciccone

  • Status changed from new to closed
  • Resolution set to fixed

Added in r2368.

comment:2 Changed 12 years ago by ryan@…

  • Status changed from closed to reopened
  • Resolution fixed deleted

From backscrolling through IRC, saw issues...

This fix was in the cross-lfs scripts for getting perl to build properly with -fPIC

# if not creating a shared libperl (ie useshrplib not true), still use pic
sed -i -e "s@pldlflags=''@pldlflags=\"\$cccdlflags\"@g" \
       -e "s@static_target='static'@static_target='static_pic'@g" \

Should properly fix the issue (at least it did between perl 5.8.5, 5.8.6 ...)

comment:3 Changed 12 years ago by jciccone

Adding -Duseshrplib will do the same as you thought and build a libperl.so. I'd rather use -Duseshrplib instead of the sed.

comment:4 Changed 12 years ago by ryan@…

sed works regardless of shared or static build, always. Note perl advisories concerning use of shared perl.

comment:5 Changed 12 years ago by jim

  • Status changed from reopened to closed
  • Resolution set to fixed

Fixed with Ryan's sed.

Note: See TracTickets for help on using tickets.