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

Can't build Perl 5.005_60 on SPARC/Linux with -Duseshrplib #378

Closed
p5pRT opened this issue Aug 13, 1999 · 5 comments
Closed

Can't build Perl 5.005_60 on SPARC/Linux with -Duseshrplib #378

p5pRT opened this issue Aug 13, 1999 · 5 comments

Comments

@p5pRT
Copy link

p5pRT commented Aug 13, 1999

Migrated from rt.perl.org#1213 (status was 'resolved')

Searchable as RT1213$

@p5pRT
Copy link
Author

p5pRT commented Aug 13, 1999

From bjepson@home.com

When I compile Perl 5.005_60 on SPARC/Linux, I get many error messages
about relocations​:

cc -shared -L/usr/local/lib -o libperl.so perl.o gv.o toke.o perly.o op.o
regcomp.o dump.o util.o mg.o hv.o av.o run.o pp_hot.o sv.o pp.o scope.o
pp_ctl.o pp_sys.o doop.o doio.o regexec.o utf8.o taint.o deb.o
universal.o globals.o perlio.o

sv.o​: In function `Perl_sv_2pv'​:
/home/bjepson/src/perl5.005_60/sv.c​:1804​: relocation truncated to fit​:
R_SPARC_G
OT13 LLC43
/home/bjepson/src/perl5.005_60/sv.c​:1810​: relocation truncated to fit​:
R_SPARC_G
OT13 LLC44
/home/bjepson/src/perl5.005_60/sv.c​:1892​: relocation truncated to fit​:
R_SPARC_G
OT13 LLC45

Similar messages appear for Perl_sv_2bool, Perl_sv_setsv, Perl_sv_magic,
Perl_sv_rvweaken, S_sv_del_backref, Perl_sv_insert, Perl_sv_replace,
Perl_sv_clear, Perl_sv_free, Perl_sv_pos_b2u, Perl_sv_gets, Perl_sv_inc,
and many other symbols. The message finally ends with​:

make​: *** [libperl.so] Error 1

Configuration


I configured it with​:

sh Configure -Dprefix=/opt/perl -Duseshrplib -Doptimize='-g' -Uusemymalloc

and I removed POSIX from the list of extensions, because I have had
trouble building it on SPARC/Linux in the past (or I thought I had).

Other information​:

  The Linux distribution is Debian 2.1.

  $ uname -a
  Linux cx384756-a 2.0.35 #5 Wed Jul 14 09​:15​:34 EST 1999 sparc unknown

  libc='/lib/libc-2.0.105.so'

  $ cc -v
  Reading specs from /usr/lib/gcc-lib/sparc-linux/2.7.2.3/specs
  gcc version 2.7.2.3

This error also occurs if I use egcc as my compiler​:

  $ egcc -v
  Reading specs from /usr/lib/gcc-lib/sparc-linux/egcs-2.91.60/specs
  gcc version egcs-2.91.60 Debian 2.1 (egcs-1.1.1 release)

========================
Without -Doptimize='-g'​:

When I run Configure without -Doptimize='-g', I get an error when make
compiles util.c​:

`sh cflags libperl.so util.o` -fpic util.c
  CCCMD = cc -DPERL_CORE -c -Dbool=char -DHAS_BOOL
  -I/usr/local/include -O2
cc​: Internal compiler error​: program cc1 got fatal signal 6

When I use egcc in this fashion, I do not receive the fatal signal, but I
receive the relocation errors described above.

====================
Without -Duseshrplib

It seems like -Duseshrplib was the source of my troubles. Here is a
combination that works and passes most tests (POSIX works, so my fear
that it was broken, mentioned above, was unfounded)​:

  sh Configure -Dprefix=/opt/perl -Doptimize='-g' -Uusemymalloc \
  -Dcc=egcc -des

Here are the failure messages from 'make test'​:

op/grent............FAILED at test 1
pragma/warning......PROG​:
# op.c
$ENV{PERL_DESTRUCT_LEVEL} = 0 unless $ENV{PERL_DESTRUCT_LEVEL} > 3; #
known scal
ar leak
use warning 'unsafe' ;
my $a ; my @​a = () ; my %a = () ; my $b = \@​a ; my $c = \%a ;
@​a =~ /abc/ ;
@​a =~ s/a/b/ ;
@​a =~ tr/a/b/ ;
@​$b =~ /abc/ ;
@​$b =~ s/a/b/ ;
@​$b =~ tr/a/b/ ;
%a =~ /abc/ ;
%a =~ s/a/b/ ;
%a =~ tr/a/b/ ;
%$c =~ /abc/ ;
%$c =~ s/a/b/ ;
%$c =~ tr/a/b/ ;
{
no warning 'unsafe' ;
my $a ; my @​a = () ; my %a = () ; my $b = \@​a ; my $c = \%a ;
@​a =~ /abc/ ;
@​a =~ s/a/b/ ;
@​a =~ tr/a/b/ ;
@​$b =~ /abc/ ;
@​$b =~ s/a/b/ ;
@​$b =~ tr/a/b/ ;
%a =~ /abc/ ;
%a =~ s/a/b/ ;
%a =~ tr/a/b/ ;
%$c =~ /abc/ ;
%$c =~ s/a/b/ ;
%$c =~ tr/a/b/ ;
}
EXPECTED​:
Applying pattern match to @​array will act on scalar(@​array) at - line 5.
Applying substitution to @​array will act on scalar(@​array) at - line 6.
Can't modify private array in substitution at - line 6, near "s/a/b/ ;"
Applying character translation to @​array will act on scalar(@​array) at -
line 7.
Applying pattern match to @​array will act on scalar(@​array) at - line 8.
Applying substitution to @​array will act on scalar(@​array) at - line 9.
Applying character translation to @​array will act on scalar(@​array) at -
line 10
.
Applying pattern match to %hash will act on scalar(%hash) at - line 11.
Applying substitution to %hash will act on scalar(%hash) at - line 12.
Applying character translation to %hash will act on scalar(%hash) at -
line 13.
Applying pattern match to %hash will act on scalar(%hash) at - line 14.
Applying substitution to %hash will act on scalar(%hash) at - line 15.
Applying character translation to %hash will act on scalar(%hash) at -
line 16.
BEGIN not safe after errors--compilation aborted at - line 18.
GOT​:
Applying pattern match to @​array will act on scalar(@​array) at - line 5.
Applying substitution to @​array will act on scalar(@​array) at - line 6.
Can't modify private array in substitution at - line 6, near "s/a/b/ ;"
Applying character translation to @​array will act on scalar(@​array) at -
line 7.
Applying pattern match to @​array will act on scalar(@​array) at - line 8.
Applying substitution to @​array will act on scalar(@​array) at - line 9.
Applying character translation to @​array will act on scalar(@​array) at -
line 10
.
Applying pattern match to %hash will act on scalar(%hash) at - line 11.
Applying substitution to %hash will act on scalar(%hash) at - line 12.
Applying character translation to %hash will act on scalar(%hash) at -
line 13.
Applying pattern match to %hash will act on scalar(%hash) at - line 14.
Applying substitution to %hash will act on scalar(%hash) at - line 15.
Applying character translation to %hash will act on scalar(%hash) at -
line 16.
BEGIN not safe after errors--compilation aborted at - line 18.
Scalars leaked​: 1
FAILED at test 137
lib/anydbm..........FAILED at test 12
lib/db-btree........FAILED at test 36
lib/db-hash.........FAILED at test 31

Brian Jepson * (bjepson@​home.com) * http​://users.ids.net/~bjepson

@p5pRT
Copy link
Author

p5pRT commented Aug 13, 1999

From [Unknown Contact. See original ticket]

I forgot to add that my Linux kernel was built with SMP support.

On Fri, 13 Aug 1999, Brian Jepson wrote​:

Your e-mail has been received by the Perl Bug Squashing Team.

Ticket ID '[ID 19990813.002]' has been assigned. Please include this ticket ID in the
subject line of any followup messages related to this issue.

This is an automatic confirmation message.
--
Perl Bug Squashing Team
perlbug@​perl.org

Brian Jepson * (bjepson@​home.com) * http​://users.ids.net/~bjepson

@p5pRT
Copy link
Author

p5pRT commented Aug 13, 1999

From [Unknown Contact. See original ticket]

Brian Jepson <bjepson@​home.com> writes​:

====================
With -Doptimize='-g'

When I compile Perl 5.005_60 on SPARC/Linux, I get many error messages
about relocations​:

cc -shared -L/usr/local/lib -o libperl.so perl.o gv.o toke.o perly.o op.o
regcomp.o dump.o util.o mg.o hv.o av.o run.o pp_hot.o sv.o pp.o scope.o
pp_ctl.o pp_sys.o doop.o doio.o regexec.o utf8.o taint.o deb.o
universal.o globals.o perlio.o

sv.o​: In function `Perl_sv_2pv'​:
/home/bjepson/src/perl5.005_60/sv.c​:1804​: relocation truncated to fit​:
R_SPARC_G
OT13 LLC43

Looks like shared lib hints for Linux/SPARC need to set -fPIC rather
than -fpic.

--
Nick Ing-Simmons

@p5pRT
Copy link
Author

p5pRT commented Aug 20, 1999

From [Unknown Contact. See original ticket]

On Fri, 13 Aug 1999, Nick Ing-Simmons wrote​:
[...]

Looks like shared lib hints for Linux/SPARC need to set -fPIC rather
than -fpic.

Thanks - here is what I fed to Configure​:

-Dprefix=/opt/perl -Duseshrplib -Doptimize=-g -Uusemymalloc -Dcccdlflags=-fPIC -des

It built OK, but failed a few tests​:

op/grent............FAILED at test 1
pragma/warning......PROG​:
# op.c
$ENV{PERL_DESTRUCT_LEVEL} = 0 unless $ENV{PERL_DESTRUCT_LEVEL} > 3; # known scalar leak
use warning 'unsafe' ;
my $a ; my @​a = () ; my %a = () ; my $b = \@​a ; my $c = \%a ;
@​a =~ /abc/ ;
@​a =~ s/a/b/ ;
@​a =~ tr/a/b/ ;
@​$b =~ /abc/ ;
@​$b =~ s/a/b/ ;
@​$b =~ tr/a/b/ ;
%a =~ /abc/ ;
%a =~ s/a/b/ ;
%a =~ tr/a/b/ ;
%$c =~ /abc/ ;
%$c =~ s/a/b/ ;
%$c =~ tr/a/b/ ;
{
no warning 'unsafe' ;
my $a ; my @​a = () ; my %a = () ; my $b = \@​a ; my $c = \%a ;
@​a =~ /abc/ ;
@​a =~ s/a/b/ ;
@​a =~ tr/a/b/ ;
@​$b =~ /abc/ ;
@​$b =~ s/a/b/ ;
@​$b =~ tr/a/b/ ;
%a =~ /abc/ ;
%a =~ s/a/b/ ;
%a =~ tr/a/b/ ;
%$c =~ /abc/ ;
%$c =~ s/a/b/ ;
%$c =~ tr/a/b/ ;
}
EXPECTED​:
Applying pattern match to @​array will act on scalar(@​array) at - line 5.
Applying substitution to @​array will act on scalar(@​array) at - line 6.
Can't modify private array in substitution at - line 6, near "s/a/b/ ;"
Applying character translation to @​array will act on scalar(@​array) at - line 7.
Applying pattern match to @​array will act on scalar(@​array) at - line 8.
Applying substitution to @​array will act on scalar(@​array) at - line 9.
Applying character translation to @​array will act on scalar(@​array) at - line 10.
Applying pattern match to %hash will act on scalar(%hash) at - line 11.
Applying substitution to %hash will act on scalar(%hash) at - line 12.
Applying character translation to %hash will act on scalar(%hash) at - line 13.
Applying pattern match to %hash will act on scalar(%hash) at - line 14.
Applying substitution to %hash will act on scalar(%hash) at - line 15.
Applying character translation to %hash will act on scalar(%hash) at - line 16.
BEGIN not safe after errors--compilation aborted at - line 18.
GOT​:
Applying pattern match to @​array will act on scalar(@​array) at - line 5.
Applying substitution to @​array will act on scalar(@​array) at - line 6.
Can't modify private array in substitution at - line 6, near "s/a/b/ ;"
Applying character translation to @​array will act on scalar(@​array) at - line 7.
Applying pattern match to @​array will act on scalar(@​array) at - line 8.
Applying substitution to @​array will act on scalar(@​array) at - line 9.
Applying character translation to @​array will act on scalar(@​array) at - line 10.
Applying pattern match to %hash will act on scalar(%hash) at - line 11.
Applying substitution to %hash will act on scalar(%hash) at - line 12.
Applying character translation to %hash will act on scalar(%hash) at - line 13.
Applying pattern match to %hash will act on scalar(%hash) at - line 14.
Applying substitution to %hash will act on scalar(%hash) at - line 15.
Applying character translation to %hash will act on scalar(%hash) at - line 16.
BEGIN not safe after errors--compilation aborted at - line 18.
Scalars leaked​: 1
FAILED at test 137
lib/anydbm..........FAILED at test 12
lib/db-btree........FAILED at test 36
lib/db-hash.........FAILED at test 31

@p5pRT
Copy link
Author

p5pRT commented Aug 21, 1999

From [Unknown Contact. See original ticket]

Brian Jepson <bjepson@​home.com> writes​:

On Fri, 13 Aug 1999, Nick Ing-Simmons wrote​:
[...]

Looks like shared lib hints for Linux/SPARC need to set -fPIC rather
than -fpic.

Thanks - here is what I fed to Configure​:

-Dprefix=/opt/perl -Duseshrplib -Doptimize=-g -Uusemymalloc -Dcccdlflags=-fPIC -des

It built OK, but failed a few tests​:

op/grent............FAILED at test 1

I seem to recall that is a known problem with some /etc/group
setups - I can't remember the details.

pragma/warning......PROG​:
# op.c
$ENV{PERL_DESTRUCT_LEVEL} = 0 unless $ENV{PERL_DESTRUCT_LEVEL} > 3; # known scalar leak
use warning 'unsafe' ;
my $a ; my @​a = () ; my %a = () ; my $b = \@​a ; my $c = \%a ;
@​a =~ /abc/ ;
@​a =~ s/a/b/ ;
@​a =~ tr/a/b/ ;
@​$b =~ /abc/ ;
@​$b =~ s/a/b/ ;
@​$b =~ tr/a/b/ ;
%a =~ /abc/ ;
%a =~ s/a/b/ ;
%a =~ tr/a/b/ ;
%$c =~ /abc/ ;
%$c =~ s/a/b/ ;
%$c =~ tr/a/b/ ;
{
no warning 'unsafe' ;
my $a ; my @​a = () ; my %a = () ; my $b = \@​a ; my $c = \%a ;
@​a =~ /abc/ ;
@​a =~ s/a/b/ ;
@​a =~ tr/a/b/ ;
@​$b =~ /abc/ ;
@​$b =~ s/a/b/ ;
@​$b =~ tr/a/b/ ;
%a =~ /abc/ ;
%a =~ s/a/b/ ;
%a =~ tr/a/b/ ;
%$c =~ /abc/ ;
%$c =~ s/a/b/ ;
%$c =~ tr/a/b/ ;
}
EXPECTED​:
Applying pattern match to @​array will act on scalar(@​array) at - line 5.
Applying substitution to @​array will act on scalar(@​array) at - line 6.
Can't modify private array in substitution at - line 6, near "s/a/b/ ;"
Applying character translation to @​array will act on scalar(@​array) at - line 7.
Applying pattern match to @​array will act on scalar(@​array) at - line 8.
Applying substitution to @​array will act on scalar(@​array) at - line 9.
Applying character translation to @​array will act on scalar(@​array) at - line 10.
Applying pattern match to %hash will act on scalar(%hash) at - line 11.
Applying substitution to %hash will act on scalar(%hash) at - line 12.
Applying character translation to %hash will act on scalar(%hash) at - line 13.
Applying pattern match to %hash will act on scalar(%hash) at - line 14.
Applying substitution to %hash will act on scalar(%hash) at - line 15.
Applying character translation to %hash will act on scalar(%hash) at - line 16.
BEGIN not safe after errors--compilation aborted at - line 18.
GOT​:
Applying pattern match to @​array will act on scalar(@​array) at - line 5.
Applying substitution to @​array will act on scalar(@​array) at - line 6.
Can't modify private array in substitution at - line 6, near "s/a/b/ ;"
Applying character translation to @​array will act on scalar(@​array) at - line 7.
Applying pattern match to @​array will act on scalar(@​array) at - line 8.
Applying substitution to @​array will act on scalar(@​array) at - line 9.
Applying character translation to @​array will act on scalar(@​array) at - line 10.
Applying pattern match to %hash will act on scalar(%hash) at - line 11.
Applying substitution to %hash will act on scalar(%hash) at - line 12.
Applying character translation to %hash will act on scalar(%hash) at - line 13.
Applying pattern match to %hash will act on scalar(%hash) at - line 14.
Applying substitution to %hash will act on scalar(%hash) at - line 15.
Applying character translation to %hash will act on scalar(%hash) at - line 16.
BEGIN not safe after errors--compilation aborted at - line 18.
Scalars leaked​: 1
FAILED at test 137

I think that is generic fail on _60.

lib/anydbm..........FAILED at test 12

lib/db-btree........FAILED at test 36
lib/db-hash.........FAILED at test 31

Those two are generic.
--
Nick Ing-Simmons

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
@p5pRT and others