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

ExtUtils::Embed::ldopts produces wrong output for static perl #6856

Open
p5pRT opened this issue Oct 21, 2003 · 2 comments
Open

ExtUtils::Embed::ldopts produces wrong output for static perl #6856

p5pRT opened this issue Oct 21, 2003 · 2 comments

Comments

@p5pRT
Copy link

p5pRT commented Oct 21, 2003

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

Searchable as RT24258$

@p5pRT
Copy link
Author

p5pRT commented Oct 21, 2003

From stas@stason.org

Created by stas@stason.org

This bugreport is talking about 5.8.1, but quite possible it applies to other
versions as well, as I don't have any other static perl builds available at
the moment.

ExtUtils​::Embed says​:

  perl -MExtUtils​::Embed -e ldopts -- DynaLoader

  This will print arguments for linking with just the DynaLoader
  extension and libperl.a.

but it doesn't. I get​:

  perl-5.8.1-ithread-nouseshrplib -MExtUtils​::Embed -e ldopts -- DynaLoader

-rdynamic -L/usr/local/lib
/home/stas/perl/5.8.1-ithread-nouseshrplib/lib/5.8.1/i686-linux-thread-multi/auto/DynaLoader/DynaLoader.a
/home/stas/perl/5.8.1-ithread-nouseshrplib/lib/5.8.1/i686-linux-thread-multi/auto/DynaLoader/DynaLoader.a
-L/home/stas/perl/5.8.1-ithread-nouseshrplib/lib/5.8.1/i686-linux-thread-multi/CORE
-lperl -lnsl -ldl -lm -lcrypt -lutil -lpthread -lc

instead of giving me​:

/home/stas/perl/5.8.1-ithread-nouseshrplib/lib/5.8.1/i686-linux-thread-multi/CORE/libperl.a

it gives​:

-L/home/stas/perl/5.8.1-ithread-nouseshrplib/lib/5.8.1/i686-linux-thread-multi/CORE
-lperl

which is suitable for shared libperl.so, which I don't have (for this
particular build).

not talking about the duplicated Dynaloader.a entry (notice that I
have followed the instructions in the manpage), which is not a bug but
probable something that could be cleaned up ;) but it's unrelated to the topic
of this report.

This bug was reported by Bryn Dyment, running on
freebsd/4.8-release/gcc-2.95.4, as it causes for him a failure to link httpd
with static modperl 1.0 library. Surprisingly linking with -lperl
when there is no shared library works just fine on linux/3.3.1. It
could be an issue with gcc. I don't have 2.95 to verify whether this
is an issue with gcc. But I tend to believe that we have a bug in
ExtUtils​::Embed.

Brian has posted his 'perl -V' here​:
http​://www.bigtrouble.com/perl_minus_V_output.html

Perl Info

Flags:
     category=utilities
     severity=medium

Site configuration information for perl v5.8.1:

Configured by stas at Thu Sep 25 18:41:59 PDT 2003.

Summary of my perl5 (revision 5.0 version 8 subversion 1) configuration:
   Platform:
     osname=linux, osvers=2.4.21-0.18mdkcustom, archname=i686-linux-thread-multi
     uname='linux rabbit.stason.org 2.4.21-0.18mdkcustom #6 mon jun 16 
16:26:34 est 2003 i686 unknown unknown gnulinux '
     config_args='-des -Dprefix=/home/stas/perl/5.8.1-ithread-nouseshrplib 
-Dusethreads -Doptimize=-g -Uuseshrplib -Dusedevel'
     hint=recommended, useposix=true, d_sigaction=define
     usethreads=define use5005threads=undef useithreads=define 
usemultiplicity=define
     useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
     use64bitint=undef use64bitall=undef uselongdouble=undef
     usemymalloc=n, bincompat5005=undef
   Compiler:
     cc='cc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS 
-DDEBUGGING -fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE 
-D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm',
     optimize='-g',
     cppflags='-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -DDEBUGGING 
-fno-strict-aliasing -I/usr/local/include -I/usr/include/gdbm'
     ccversion='', gccversion='3.3.1 (Mandrake Linux 9.2 3.3.1-2mdk)', 
gccosandvers=''
     intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
     d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
     ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', 
lseeksize=8
     alignbytes=4, prototype=define
   Linker and Libraries:
     ld='cc', ldflags =' -L/usr/local/lib'
     libpth=/usr/local/lib /lib /usr/lib
     libs=-lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lpthread -lc
     perllibs=-lnsl -ldl -lm -lcrypt -lutil -lpthread -lc
     libc=/lib/libc-2.3.2.so, so=so, useshrplib=false, libperl=libperl.a
     gnulibc_version='2.3.2'
   Dynamic Linking:
     dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic'
     cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib'

Locally applied patches:



@INC for perl v5.8.1:
     /home/stas/perl/5.8.1-ithread-nouseshrplib/lib/5.8.1/i686-linux-thread-multi
     /home/stas/perl/5.8.1-ithread-nouseshrplib/lib/5.8.1
 
/home/stas/perl/5.8.1-ithread-nouseshrplib/lib/site_perl/5.8.1/i686-linux-thread-multi
     /home/stas/perl/5.8.1-ithread-nouseshrplib/lib/site_perl/5.8.1
     /home/stas/perl/5.8.1-ithread-nouseshrplib/lib/site_perl
     .


Environment for perl v5.8.1:
     HOME=/home/stas
     LANGUAGE=en_AU:en_US:en
     LC_ADDRESS=en_AU
     LC_COLLATE=en_AU
     LC_CTYPE=en_AU
     LC_IDENTIFICATION=en_AU
     LC_MEASUREMENT=en_AU
     LC_MESSAGES=en_AU
     LC_MONETARY=en_AU
     LC_NAME=en_AU
     LC_NUMERIC=en_AU
     LC_PAPER=en_AU
     LC_TELEPHONE=en_AU
     LC_TIME=en_AU
     LD_LIBRARY_PATH (unset)
     LOGDIR (unset)
 
PATH=/usr//bin:/bin:/usr/bin:.:/usr/local/bin:/usr/X11R6/bin:/usr/games:/home/stas/bin:/home/stas/bin:/usr/local/bin:/usr/X11R6/bin:/usr/java/j2re1.4.0/bin/
     PERLDOC_PAGER=less -R
     PERL_BADLANG (unset)
     SHELL=/bin/tcsh


__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


@p5pRT
Copy link
Author

p5pRT commented Oct 25, 2003

From stas@stason.org

Stas Bekman (via RT) wrote​:

Some more info on this issue​:

This bugreport is talking about 5.8.1, but quite possible it applies to other
versions as well, as I don't have any other static perl builds available at
the moment.

ExtUtils​::Embed says​:

perl -MExtUtils​::Embed -e ldopts -- DynaLoader

This will print arguments for linking with just the DynaLoader
extension and libperl.a.

but it doesn't. I get​:

perl-5.8.1-ithread-nouseshrplib -MExtUtils​::Embed -e ldopts -- DynaLoader

-rdynamic -L/usr/local/lib
/home/stas/perl/5.8.1-ithread-nouseshrplib/lib/5.8.1/i686-linux-thread-multi/auto/DynaLoader/DynaLoader.a
/home/stas/perl/5.8.1-ithread-nouseshrplib/lib/5.8.1/i686-linux-thread-multi/auto/DynaLoader/DynaLoader.a
-L/home/stas/perl/5.8.1-ithread-nouseshrplib/lib/5.8.1/i686-linux-thread-multi/CORE
-lperl -lnsl -ldl -lm -lcrypt -lutil -lpthread -lc

instead of giving me​:

/home/stas/perl/5.8.1-ithread-nouseshrplib/lib/5.8.1/i686-linux-thread-multi/CORE/libperl.a

it gives​:

-L/home/stas/perl/5.8.1-ithread-nouseshrplib/lib/5.8.1/i686-linux-thread-multi/CORE
-lperl

which is suitable for shared libperl.so, which I don't have (for this
particular build).

Eventually we figured out that the user had -L/usr/lib while linking and he
happened to have a different build's libperl.so and libperl.a there. And it
was getting linked instead of the real libperl. Of course moving those libs
temporary to a different location solved the problem as well (couldn't remove
-L/usr/lib as it was needed for other libs to be found). But if
ExtUtils​::Embed gave the right full path to libperl.a it won't be a problem.

So should ExtUtils​::Embed be fixed to give a full path to libperl.a when perl
is statically built?

__________________________________________________________________
Stas Bekman JAm_pH ------> Just Another mod_perl Hacker
http​://stason.org/ mod_perl Guide ---> http​://perl.apache.org
mailto​:stas@​stason.org http​://use.perl.org http​://apacheweek.com
http​://modperlbook.org http​://apache.org http​://ticketmaster.com

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