Perl / perl5

🐪 The Perl programming language
https://dev.perl.org/perl5/
Other
1.9k stars 538 forks source link

Building in 64bit mode on solaris/amd64 fails #9669

Open p5pRT opened 15 years ago

p5pRT commented 15 years ago

Migrated from rt.perl.org#63604 (status was 'open')

Searchable as RT63604$

p5pRT commented 15 years ago

From dima@orion.ifmo.ru

This is a bug report for perl from KOT@​MATPOCKuH.Ru generated with the help of perlbug 1.39 running under perl v5.8.9.

----------------------------------------------------------------- I'm tring to build perl in 64bits mode on Solaris10/amd64 with this params​: ./Configure -de -Dprefix=/var/perl -Dcc=gcc -Dccflags="-m64 -fPIC -fpic"

and​: # make work's fine\, but "make test" and "make install" fails with messages like this​: ./perl installperl --destdir=
Can't load 'lib/auto/File/Glob/Glob.so' for module File​::Glob​: ld.so.1​: perl​: fatal​: relocation error​: R_AMD64_PC32​: file lib/auto/File/Glob/Glob.so​: symbol main​: value 0x280013eed4c does not fit at lib/XSLoader.pm line 70. at lib/File/Glob.pm line 96

# file lib/auto/File/Glob/Glob.so lib/auto/File/Glob/Glob.so​: ELF 64-bit LSB dynamic lib AMD64 Version 1\, dynamically linked\, not stripped\, no debugging information available

# export LD_PRELOAD=`pwd`/lib/auto/File/Glob/Glob.so # openssl ld.so.1​: openssl​: fatal​: relocation error​: R_AMD64_PC32​: file /home/dima/src/perl-5.8.9/lib/auto/File/Glob/Glob.so​: symbol main​: value 0x28001095394 does not fit

But if LD_PRELOAD have another builded library (f.e. lib/auto/ByteLoader/ByteLoader.so) - I have no error.

Perl Info ``` Flags: category=core severity=high Site configuration information for perl v5.8.9: Configured by dima at Sat Jan 17 00:14:36 MSK 2009. ```
p5pRT commented 15 years ago

From @doughera88

On Mon\, 2 Mar 2009\, dima@​orion.ifmo.ru (via RT) wrote​:

# New Ticket Created by dima@​orion.ifmo.ru # Please include the string​: [perl #63604] # in the subject line of all future correspondence about this issue. # \<URL​: http​://rt.perl.org/rt3/Ticket/Display.html?id=63604 >

This is a bug report for perl from KOT@​MATPOCKuH.Ru generated with the help of perlbug 1.39 running under perl v5.8.9.

----------------------------------------------------------------- I'm tring to build perl in 64bits mode on Solaris10/amd64 with this params​: ./Configure -de -Dprefix=/var/perl -Dcc=gcc -Dccflags="-m64 -fPIC -fpic"

Just a quick observation​: Why the "-fPIC -fpic" combination? Doesn't the second one just override the first? This may be your problem. Can you try again with just -fPIC?

and​: # make work's fine\, but "make test" and "make install" fails with messages like this​: ./perl installperl --destdir=
Can't load 'lib/auto/File/Glob/Glob.so' for module File​::Glob​: ld.so.1​: perl​: fatal​: relocation error​: R_AMD64_PC32​: file lib/auto/File/Glob/Glob.so​: symbol main​: value 0x280013eed4c does not fit at lib/XSLoader.pm line 70. at lib/File/Glob.pm line 96

--   Andy Dougherty doughera@​lafayette.edu

p5pRT commented 15 years ago

The RT System itself - Status changed from 'new' to 'open'

p5pRT commented 15 years ago

From guorong.koh@gmail.com

On Mon Mar 02 12​:07​:00 2009\, doughera wrote​:

On Mon\, 2 Mar 2009\, dima@​orion.ifmo.ru (via RT) wrote​:

# New Ticket Created by dima@​orion.ifmo.ru # Please include the string​: [perl #63604] # in the subject line of all future correspondence about this issue. # \<URL​: http​://rt.perl.org/rt3/Ticket/Display.html?id=63604 >

This is a bug report for perl from KOT@​MATPOCKuH.Ru generated with the help of perlbug 1.39 running under perl v5.8.9.

----------------------------------------------------------------- I'm tring to build perl in 64bits mode on Solaris10/amd64 with this params​: ./Configure -de -Dprefix=/var/perl -Dcc=gcc -Dccflags="-m64 -fPIC -fpic"

Just a quick observation​: Why the "-fPIC -fpic" combination? Doesn't the second one just override the first? This may be your problem. Can you try again with just -fPIC?

and​: # make work's fine\, but "make test" and "make install" fails with messages like this​: ./perl installperl --destdir= Can't load 'lib/auto/File/Glob/Glob.so' for module File​::Glob​: ld.so.1​: perl​: fatal​: relocation error​: R_AMD64_PC32​: file lib/auto/File/Glob/Glob.so​: symbol main​: value 0x280013eed4c does not fit at lib/XSLoader.pm line 70. at lib/File/Glob.pm line 96

After much searching\, I found an answer here​: http​://paulbeachsblog.blogspot.com/2008/04/64bit-firebird-for-

Modifying hints/solaris_2.sh to change instances of '-G' to '-shared' fixed it for me.

p5pRT commented 14 years ago

From KOT@MATPOCKuH.Ru

I confirm that replacing "-G" to "-shared" in hints/solaris_2.sh solves the problem. But in perl 5.10.1 the file hints/solaris_2.sh is still incorrect. Please apply attached patch.

PS. Build environment​: # uname -a SunOS sunweb 5.10 Generic_137138-09 i86pc i386 i86pc # gcc -v Reading specs from /usr/sfw/lib/gcc/i386-pc-solaris2.10/3.4.3/specs Configured with​: /builds/sfw10-gate/usr/src/cmd/gcc/gcc-3.4.3/configure --prefix=/usr/sfw --with-as=/usr/sfw/bin/gas --with-gnu-as --with-ld=/usr/ccs/bin/ld --without-gnu-ld --enable-languages=c\,c++ --enable-shared Thread model​: posix gcc version 3.4.3 (csl-sol210-3_4-branch+sol_rpath) /usr/ccs/bin/ld -V ld​: Software Generation Utilities - Solaris Link Editors​: 5.10-1.490

p5pRT commented 14 years ago

From KOT@MATPOCKuH.Ru

solaris2.patch ```diff --- hints/solaris_2.sh.orig Fri Feb 13 01:58:12 2009 +++ hints/solaris_2.sh Wed Mar 24 17:50:08 2010 @@ -300,7 +300,7 @@ END ccdlflags="$ccdlflags -Wl,-E" - lddlflags="$lddlflags -Wl,-E -G" + lddlflags="$lddlflags -Wl,-E -shared" fi fi @@ -568,12 +568,12 @@ # ccflags="$ccflags -Wa,`getconf XBS5_LP64_OFF64_CFLAGS 2>/dev/null`" # fi ldflags="$ldflags -m64" - lddlflags="$lddlflags -G -m64" + lddlflags="$lddlflags -shared -m64" ;; *) ccflags="$ccflags `getconf XBS5_LP64_OFF64_CFLAGS 2>/dev/null`" ldflags="$ldflags `getconf XBS5_LP64_OFF64_LDFLAGS 2>/dev/null`" - lddlflags="$lddlflags -G `getconf XBS5_LP64_OFF64_LDFLAGS 2>/dev/null`" + lddlflags="$lddlflags -shared `getconf XBS5_LP64_OFF64_LDFLAGS 2>/dev/null`" echo "int main() { return(0); } " > try.c tryworkshopcc="${cc:-cc} try.c -o try $ccflags" if test "$processor" = sparc; then ```
p5pRT commented 12 years ago

From @Hugmeir

On Wed Mar 24 08​:14​:56 2010\, KOT@​MATPOCKuH.Ru wrote​:

I confirm that replacing "-G" to "-shared" in hints/solaris_2.sh solves the problem. But in perl 5.10.1 the file hints/solaris_2.sh is still incorrect. Please apply attached patch.

PS. Build environment​: # uname -a SunOS sunweb 5.10 Generic_137138-09 i86pc i386 i86pc # gcc -v Reading specs from /usr/sfw/lib/gcc/i386-pc-solaris2.10/3.4.3/specs Configured with​: /builds/sfw10-gate/usr/src/cmd/gcc/gcc-3.4.3/configure --prefix=/usr/sfw --with-as=/usr/sfw/bin/gas --with-gnu-as --with-ld=/usr/ccs/bin/ld --without-gnu-ld --enable-languages=c\,c++ --enable-shared Thread model​: posix gcc version 3.4.3 (csl-sol210-3_4-branch+sol_rpath) /usr/ccs/bin/ld -V ld​: Software Generation Utilities - Solaris Link Editors​: 5.10-1.490

Looks like this patch was never applied. Should it be?