summaryrefslogtreecommitdiff
path: root/packages/perl/perl-5.8.7
diff options
context:
space:
mode:
authorJamie Lenehan <lenehan@twibble.org>2006-09-25 08:53:24 +0000
committerJamie Lenehan <lenehan@twibble.org>2006-09-25 08:53:24 +0000
commit24f8add82d160dc484dbdf00e58044c3890246a5 (patch)
tree2c5a98d08a2083f6b87a215ee5ba452ecf87b873 /packages/perl/perl-5.8.7
parentaa36784ca33f26e61215d5dc6cba5acd5515b0d8 (diff)
perl 5.8.7: Fix the perl shared library generation for sh3/sh4
targets: - You cannot link using LD on sh3/sh4, since ld fails to link in the hidden library of weak symbols that is needed. Ccc knows about this library and correctly links it in. The generate_config_sh script was replacing the configred linker with LD from the environment and the soname patch was passing parameters directly to LD which need to be passed differently when linking with gcc. - Any code to go in shared libraries must be compiled with -fPIC, which while present in the config file was again being replaced from the environment by the generate_config_sh script. Both these patches probably should be ok for all targets, but they would definately need run-time testing. So they are just patched in for sh3 and sh4 for now. Also removed the old code I added not to install the shared library if its not configured since its configured for all targets after this change.
Diffstat (limited to 'packages/perl/perl-5.8.7')
-rw-r--r--packages/perl/perl-5.8.7/config.sh-sh3-linux2
-rw-r--r--packages/perl/perl-5.8.7/config.sh-sh4-linux2
-rw-r--r--packages/perl/perl-5.8.7/makefile-usegcc-to-link.patch27
-rw-r--r--packages/perl/perl-5.8.7/override-generate-sh.patch16
4 files changed, 45 insertions, 2 deletions
diff --git a/packages/perl/perl-5.8.7/config.sh-sh3-linux b/packages/perl/perl-5.8.7/config.sh-sh3-linux
index d3bee1e4ed..fbdff37045 100644
--- a/packages/perl/perl-5.8.7/config.sh-sh3-linux
+++ b/packages/perl/perl-5.8.7/config.sh-sh3-linux
@@ -971,7 +971,7 @@ useperlio='define'
useposix='true'
usereentrant='undef'
usesfio='false'
-useshrplib='false'
+useshrplib='true'
usesitecustomize='undef'
usesocks='undef'
usethreads='undef'
diff --git a/packages/perl/perl-5.8.7/config.sh-sh4-linux b/packages/perl/perl-5.8.7/config.sh-sh4-linux
index bbbb12360b..ddf0ae8fcd 100644
--- a/packages/perl/perl-5.8.7/config.sh-sh4-linux
+++ b/packages/perl/perl-5.8.7/config.sh-sh4-linux
@@ -971,7 +971,7 @@ useperlio='define'
useposix='true'
usereentrant='undef'
usesfio='false'
-useshrplib='false'
+useshrplib='true'
usesitecustomize='undef'
usesocks='undef'
usethreads='undef'
diff --git a/packages/perl/perl-5.8.7/makefile-usegcc-to-link.patch b/packages/perl/perl-5.8.7/makefile-usegcc-to-link.patch
new file mode 100644
index 0000000000..d6be0be153
--- /dev/null
+++ b/packages/perl/perl-5.8.7/makefile-usegcc-to-link.patch
@@ -0,0 +1,27 @@
+You cannot use LD to link on sh, you must use gcc otherwise shared
+libraries will not work since ld doesn't know about the hidden gcc
+shared libary requirements.
+
+--- perl-5.8.7/Cross/Makefile 2006/09/25 05:52:56 1.1
++++ perl-5.8.7/Cross/Makefile 2006/09/25 05:57:34
+@@ -12,7 +12,7 @@
+
+ export CC = $(CROSS)gcc
+ export CXX = $(CROSS)g++
+-export LD = $(CROSS)ld
++export LD = $(CC)
+ export STRIP = $(CROSS)strip
+ export AR = $(CROSS)ar
+ export RANLIB = $(CROSS)ranlib
+
+--- perl-5.8.7/Makefile.SH.orig 2003-07-10 14:59:04.000000000 -0700
++++ perl-5.8.7/Makefile.SH 2003-07-10 15:14:08.000000000 -0700
+@@ -494,7 +494,7 @@
+ case "$useshrplib" in
+ true)
+ $spitshell >>Makefile <<'!NO!SUBS!'
+- $(LD) -o $@ $(SHRPLDFLAGS) perl$(OBJ_EXT) $(obj) $(libs) -soname libperl.so.5
++ $(CC) -o $@ $(SHRPLDFLAGS) perl$(OBJ_EXT) $(obj) $(libs) -Wl,-soname,libperl.so.5
+ !NO!SUBS!
+ case "$osname" in
+ aix)
diff --git a/packages/perl/perl-5.8.7/override-generate-sh.patch b/packages/perl/perl-5.8.7/override-generate-sh.patch
new file mode 100644
index 0000000000..4c2b0bd752
--- /dev/null
+++ b/packages/perl/perl-5.8.7/override-generate-sh.patch
@@ -0,0 +1,16 @@
+Use the ld flags from the supplied configuration file. For sh we need the
+flags that specify to build PIC code so that the shared libraries work.
+
+--- perl-5.8.7/Cross/generate_config_sh~ 2006-09-25 16:34:09.000000000 +1000
++++ perl-5.8.7/Cross/generate_config_sh 2006-09-25 16:34:09.000000000 +1000
+@@ -19,8 +19,8 @@
+ $callbacks->{'ar'} = [\&simple_process, ["AR", "arm-linux-ar"]];
+ $callbacks->{'archname'} = [\&simple_process, ["SYS", "armv4l-linux"]];
+ $callbacks->{'cc'} = [\&simple_process, ["CC", "arm-linux-gcc"]];
+-$callbacks->{'cccdlflags'} = [\&simple_process, ["CFLAGS", ""]];
+-$callbacks->{'ccdlflags'} = [\&simple_process, ["CFLAGS", ""]];
++#$callbacks->{'cccdlflags'} = [\&simple_process, ["CFLAGS", ""]];
++#$callbacks->{'ccdlflags'} = [\&simple_process, ["CFLAGS", ""]];
+ $callbacks->{'ccflags'} = [\&simple_process, ["CFLAGS", "-fno-strict-aliasing -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"]];
+ $callbacks->{'ccflags_uselargefiles'} = [\&simple_process, ["CFLAGS", "-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"]];
+ $callbacks->{'ccname'} = [\&simple_process, ["CC", "arm-linux-gcc"]];