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

lib/ExtUtils/t/Embed failure when shared libperl-5.8.0.so built #5756

Closed
p5pRT opened this issue Jul 19, 2002 · 8 comments
Closed

lib/ExtUtils/t/Embed failure when shared libperl-5.8.0.so built #5756

p5pRT opened this issue Jul 19, 2002 · 8 comments

Comments

@p5pRT
Copy link

p5pRT commented Jul 19, 2002

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

Searchable as RT15184$

@p5pRT
Copy link
Author

p5pRT commented Jul 19, 2002

From [email protected]

Created by [email protected]

I compiled Perl 5.8.0 when libperl.so support and told Configure
to name libperl.so libperl-5.8.0.so. When I run make test this
message comes up

lib/ExtUtils/t/Embed.................ld​: fatal​: library -lperl​: not found
ld​: fatal​: File processing errors. No output written to embed_test
collect2​: ld returned 1 exit status
FAILED at test 1

By hand​:

% cd t
env LD_LIBRARY_PATH=/tmp/perl-5.8.0 ./perl -I.. -I../lib ../lib/ExtUtils/t/Embed.t
1..9
# gcc -o embed_test -I.. -fno-strict-aliasing -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/opt/sparc-solaris/installed/perl-5.8.0/lib/5.8.0/sun4-solaris/CORE embed_test.c -L.. -lperl -R /opt/sparc-solaris/installed/perl-5.8.0/lib/5.8.0/sun4-solaris/CORE ../lib/auto/DynaLoader/DynaLoader.a -L/opt/sparc-solaris/installed/perl-5.8.0/lib/5.8.0/sun4-solaris/CORE -lsocket -lnsl -ldl -lm -lc
ld​: fatal​: library -lperl​: not found
ld​: fatal​: File processing errors. No output written to embed_test
collect2​: ld returned 1 exit status
not ok 1
# embed_test = ./embed_test
not ok 9 # system returned -1

I'm guessing that line 229 of lib/ExtUtils/Embed.pm needs to be fixed.

Best,
Blair

Perl Info

Flags:
    category=library
    severity=medium

Site configuration information for perl v5.8.0:

Configured by bzajac at Fri Jul 19 12:19:55 PDT 2002.

Summary of my perl5 (revision 5.0 version 8 subversion 0) configuration:
  Platform:
    osname=solaris, osvers=2.8, archname=sun4-solaris
    uname='sunos zepto 5.8 generic_108528-13 sun4u sparc '
    config_args=''
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef
    useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
    use64bitint=undef use64bitall=undef uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
  Compiler:
    cc='gcc', ccflags ='-fno-strict-aliasing -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
    optimize='-O3',
    cppflags='-fno-strict-aliasing'
    ccversion='', gccversion='3.1', gccosandvers='solaris2.8'
    intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=4321
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
    ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
    alignbytes=8, prototype=define
  Linker and Libraries:
    ld='gcc', ldflags =' '
    libpth=/usr/lib /usr/ccs/lib
    libs=-lsocket -lnsl -ldl -lm -lc
    perllibs=-lsocket -lnsl -ldl -lm -lc
    libc=/lib/libc.so, so=so, useshrplib=true, libperl=libperl-5.8.0.so
    gnulibc_version=''
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='  -R /opt/sparc-solaris/installed/perl-5.8.0/lib/5.8.0/sun4-solaris/CORE'
    cccdlflags='-fPIC', lddlflags='-G'

Locally applied patches:
    


@INC for perl v5.8.0:
    /opt/sparc-solaris/installed/perl-5.8.0/lib/5.8.0/sun4-solaris
    /opt/sparc-solaris/installed/perl-5.8.0/lib/5.8.0
    /opt/sparc-solaris/installed/perl-5.8.0/lib/site_perl/5.8.0/sun4-solaris
    /opt/sparc-solaris/installed/perl-5.8.0/lib/site_perl/5.8.0
    /opt/sparc-solaris/installed/perl-5.8.0/lib/site_perl
    .


Environment for perl v5.8.0:
    HOME=/space/users/bzajac
    LANG (unset)
    LANGUAGE (unset)
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PATH=/space/users/bzajac/bin:/opt/any-platform/util/bin:/opt/sparc-solaris/autoconf/bin:/opt/sparc-solaris/cvs/bin:/opt/sparc-solaris/db-4/bin:/opt/sparc-solaris/gcc/bin:/opt/sparc-solaris/mysql/bin:/opt/sparc-solaris/netscape/bin:/opt/sparc-solaris/openssh/bin:/opt/sparc-solaris/openssl/bin:/opt/sparc-solaris/perl/bin:/opt/sparc-solaris/python/bin:/opt/sparc-solaris/subversion/bin:/opt/sparc-solaris/tcl/bin:/opt/sparc-solaris/util/bin:/opt/Acrobat4/bin:/opt/JMF/bin:/opt/JMF2.0/bin:/opt/JMF2.1/bin:/opt/RICHPse/bin:/opt/SUNWconn/bin:/opt/SUNWdat/bin:/opt/SUNWdtpcv/bin:/opt/SUNWrtvc/bin:/opt/SUNWsmtv/bin:/opt/SUNWspci2/bin:/opt/SUNWsymon/bin:/opt/SUNWvts/bin:/opt/cameleo/bin:/usr/local/bin:/usr/ccs/lib:/usr/SUNWale/bin:/usr/X/bin:/usr/apache/bin:/usr/ccs/bin:/usr/dt/bin:/usr/java/bin:/usr/java1.1/bin:/usr/java1.2/bin:/usr/local/bin:/usr/mercury/bin:/usr/oasys/bin:/usr/openwin/bin:/usr/perl5/bin:/usr/proc/bin:/usr/sadm/bin:/usr/snadm/bin:/usr/vmsys/bin:/usr/xpg4/bin:/usr/bi!
n:/bin:/usr/sbin:/sbin:/etc
    PERL_BADLANG (unset)
    SHELL=/usr/bin/tcsh

@p5pRT
Copy link
Author

p5pRT commented Jul 19, 2002

From @rgs

Blair Zajac (via RT) wrote​:

I compiled Perl 5.8.0 when libperl.so support and told Configure
to name libperl.so libperl-5.8.0.so. When I run make test this
message comes up

lib/ExtUtils/t/Embed.................ld​: fatal​: library -lperl​: not found
ld​: fatal​: File processing errors. No output written to embed_test
collect2​: ld returned 1 exit status
FAILED at test 1

<shot in the dark>
I'm under the impression that the regexp on line #105 of Embed.t
doesn't catch properly your case. What says the test output if you
uncomment line #112 ?

@p5pRT
Copy link
Author

p5pRT commented Jul 20, 2002

From [email protected]

"Rafael Garcia-Suarez (via RT)" wrote​:

Blair Zajac (via RT) wrote​:

I compiled Perl 5.8.0 when libperl.so support and told Configure
to name libperl.so libperl-5.8.0.so. When I run make test this
message comes up

lib/ExtUtils/t/Embed.................ld​: fatal​: library -lperl​: not found
ld​: fatal​: File processing errors. No output written to embed_test
collect2​: ld returned 1 exit status
FAILED at test 1

<shot in the dark>
I'm under the impression that the regexp on line #105 of Embed.t
doesn't catch properly your case. What says the test output if you
uncomment line #112 ?

I'm guessing you're right.

I get this​:

# ln ../libperl-5.8.0.so ../libperl.8.0.so

Best,
Blair

--
Blair Zajac <blair@​orcaware.com>
Web and OS performance plots - http​://www.orcaware.com/orca/

@p5pRT
Copy link
Author

p5pRT commented Dec 12, 2002

From @rgs

Well, to summarize the original bug report, when libperl.so is
built under a name like libperl-5.8.0.so, (useshrplib=true)
lib/ExtUtils/t/Embed.t fails. This is due to a regular expression
to transform the name of the shared lib file into something that
"ld -lperl" will understand. Thus, the test performs a
"ln libmynameforperl.so libperl.so" or equivalent.

This patch appears to fix this, on linux at least, but as I'm not
really familiar with the various portability / naming issues
involved here, I post it for comments.

Index​: lib/ExtUtils/t/Embed.t

--- lib/ExtUtils/t/Embed.t (revision 490)
+++ lib/ExtUtils/t/Embed.t (working copy)
@​@​ -102,7 +102,7 @​@​
  # Everyone needs libperl copied if it's not found by '-lperl'.
  $testlib = $Config{'libperl'};
  my $srclib = $testlib;
- $testlib =~ s/^[^.]+/libperl/;
+ $testlib =~ s/.+(?=\.[^.]*)/libperl/;
  $testlib = File​::Spec​::->catfile($lib, $testlib);
  $srclib = File​::Spec​::->catfile($lib, $srclib);
  if (-f $srclib) {
End of Patch.

@p5pRT
Copy link
Author

p5pRT commented Jan 3, 2003

From @jhi

Nobody came up with objections, so I'm putting the patch into
maint branch (from where it will find its way to blead).
Not marking this as resolved, yet, before we get more
smoke testing on this.

@p5pRT
Copy link
Author

p5pRT commented Jan 4, 2003

From @rgs

I wrote​:

Well, to summarize the original bug report, when libperl.so is
built under a name like libperl-5.8.0.so, (useshrplib=true)
lib/ExtUtils/t/Embed.t fails. This is due to a regular expression
to transform the name of the shared lib file into something that
"ld -lperl" will understand. Thus, the test performs a
"ln libmynameforperl.so libperl.so" or equivalent.

This patch appears to fix this, on linux at least, but as I'm not
really familiar with the various portability / naming issues
involved here, I post it for comments.

Jarkko applied this to maintperl as #18403, and I applied it as
#18439 to bleadperl.

Index​: lib/ExtUtils/t/Embed.t

--- lib/ExtUtils/t/Embed.t (revision 490)
+++ lib/ExtUtils/t/Embed.t (working copy)
@​@​ -102,7 +102,7 @​@​
# Everyone needs libperl copied if it's not found by '-lperl'.
$testlib = $Config{'libperl'};
my $srclib = $testlib;
- $testlib =~ s/^[^.]+/libperl/;
+ $testlib =~ s/.+(?=\.[^.]*)/libperl/;
$testlib = File​::Spec​::->catfile($lib, $testlib);
$srclib = File​::Spec​::->catfile($lib, $srclib);
if (-f $srclib) {
End of Patch.

@p5pRT
Copy link
Author

p5pRT commented Jan 5, 2003

From @jhi

Patch applied, marking the ticket as resolved. (Of course,
if it doesn't work, we can always reopen this ticket...)

@p5pRT
Copy link
Author

p5pRT commented Jan 5, 2003

@jhi - Status changed from 'new' to 'resolved'

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

1 participant