Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
p5pRT opened this issue Mar 2, 2009 · 7 comments
Open

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

p5pRT opened this issue Mar 2, 2009 · 7 comments

Comments

@p5pRT
Copy link

p5pRT commented Mar 2, 2009

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

Searchable as RT63604$

@p5pRT
Copy link
Author

p5pRT commented Mar 2, 2009

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
Copy link
Author

p5pRT commented Mar 2, 2009

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
Copy link
Author

p5pRT commented Mar 2, 2009

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

@p5pRT
Copy link
Author

p5pRT commented Aug 11, 2009

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
Copy link
Author

p5pRT commented Mar 24, 2010

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
Copy link
Author

p5pRT commented Mar 24, 2010

From KOT@MATPOCKuH.Ru

solaris2.patch
--- 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
Copy link
Author

p5pRT commented Apr 27, 2012

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants