This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Explicitly build the shared Perl library in Solaris and variants.
authorJarkko Hietaniemi <jhi@iki.fi>
Wed, 16 Dec 2015 21:35:44 +0000 (16:35 -0500)
committerJarkko Hietaniemi <jhi@iki.fi>
Wed, 16 Dec 2015 23:07:13 +0000 (18:07 -0500)
Symptom of failure: in openindiana "make" fails:

...
./perl -Ilib -f pod/buildtoc -q
Can't load 'lib/auto/re/re.so' for module re: ld.so.1: perl: fatal:
relocation error: file lib/auto/re/re.so: symbol PL_localizing:
referenced symbol not found at lib/XSLoader.pm line 71.
  at lib/re.pm line 88.
...

Running the above command with 'env LD_DEBUG=files ...' shows that
there are many other symbol lookup failures, the one above is just
the last one before bailing.

If configured explicitly with -Duseshrplib, openindiana build succeeds.

Curiously, while the hints/solaris_2.sh (which openindiana uses) does
not specify useshrplib, Oracle/Sun builds/has been building their perl
with useshrplib since Perl 5.6.1 or thereabouts (source: Alan Burlison).
Using shared libraries is strongly recommended in Solaris in general
(source: the same).

Tested in:
- Solaris 5.10/i386 with solstudio 12.2 and gcc 4.8.0
- Solaris 5.10/sparc with solarisstudio 12.3 and gcc 4.9.2
- OpenIndiana 5.11/i386 with solarisstudio 12.3 and gcc 4.5.0

hints/solaris_2.sh

index 2f700d5..ba368e6 100644 (file)
@@ -723,3 +723,9 @@ case "$cc" in
   ;;
 esac
 
+# Oracle/Sun builds their Perl shared since 5.6.1, and they also
+# strongly recommend using shared libraries in general.
+#
+# Furthermore, OpenIndiana seems to effectively require building perl
+# shared, or otherwise perl scripts won't even find the Perl library.
+useshrplib='true'