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

Incorrect order of libraries during compilation.. #491

Closed
p5pRT opened this issue Sep 7, 1999 · 1 comment
Closed

Incorrect order of libraries during compilation.. #491

p5pRT opened this issue Sep 7, 1999 · 1 comment

Comments

@p5pRT
Copy link

p5pRT commented Sep 7, 1999

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

Searchable as RT1333$

@p5pRT
Copy link
Author

p5pRT commented Sep 7, 1999

From timur@ripe.net

Hi, hackers!

I've tried to compile program with the perlcc under BSD/OS 3.1. It has
very strange/old "lazy" linker, so, if references to functions in the
library weren't required at the moment of linking of that library, they
will not appear in the scope of of exported functions, and if one of the
next libraries in the list of them will require that additional symbols,
linker will not be able to resolve them.. Uf :)

Ok, shorter and more understandable description - BSD/OS linker depends
from the order of linking.

Here is the problem - below is the line, generated by perlcc to link
executable. Please, note the sequence - -ldl preceeds DynaLoader.a.
But DynaLoader uses set of dl* functions from libdl. But :), according
to the info above, it can't resolve them... Oops..

Quick fix is just to add -ldl one more time after DynaLoader.a, for example
- just at the end of whole command line. A bit cleaner is to swap lines with
DynaLoadaer.a and the set of required libraries, amoung which is also -ldl.

What's the better and acceptable to Perl - is on your own decision :)

shlicc2 -I/usr/local/include -I/spool/timur/lib/perl5/5.00561/i386-bsdos/CORE -o tt tt.pl.c \
-L/usr/X11/lib -L/usr/local/lib -L/spool/timur/lib/perl5/5.00561/i386-bsdos/CORE -lperl -lrpc \
-lcurses -ltermcap -lXpm -lXaw -lXmu -lXt -lSM -lICE -lXext -lX11 -ldb \
-ldl \
^^^^^^^
-lm -lc \
/spool/timur/lib/perl5/5.00561/i386-bsdos/auto/DynaLoader/DynaLoader.a \
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/spool/timur/lib/perl5/5.00561/i386-bsdos/auto/IO/IO.o \
/spool/timur/lib/perl5/5.00561/i386-bsdos/auto/Fcntl/Fcntl.o

Perl Info


Site configuration information for perl 5.00561:

Configured by timur at Tue Sep  7 15:22:52 CEST 1999.

Summary of my perl5 (revision 5.0 version 5 subversion 61) configuration:
  Platform:
    osname=bsdos, osvers=3.1, archname=i386-bsdos
    uname='bsdos x48.ripe.net 3.1 bsdi bsdos 3.1 kernel #2: wed mar 31 11:53:32 cest 1999 monica@spui.ripe.net:exportnccfs81bsdsrc-3.1localsyscompilegeneric_ncc i386 '
    config_args='-Dprefix=/spool/timur -Dhint=bsd_os.sh'
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=undef useperlio=undef d_sfio=undef
    use64bits=undef usemultiplicity=undef
  Compiler:
    cc='shlicc2', optimize='-O2', gccversion=2.7.2.1
    cppflags='-I/usr/local/include'
    ccflags ='-I/usr/local/include'
    stdchar='char', d_stdstdio=undef, usevfork=false
    intsize=4, longsize=4, ptrsize=4, doublesize=8
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
    alignbytes=4, usemymalloc=n, prototype=define
  Linker and Libraries:
    ld='shlicc2', ldflags =' -L/usr/X11/lib -L/usr/local/lib'
    libpth=/usr/local/lib /usr/shlib /shlib /usr/lib /usr/X11/lib
    libs=-lrpc -lcurses -ltermcap -lXpm -lXaw -lXmu -lXt -lSM -lICE -lXext -lX11 -ldb -ldl -lm -lc
    libc=/usr/lib/libc.a, so=o, useshrplib=true, libperl=libperl.o
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=o, d_dlsymun=undef, ccdlflags=' '
    cccdlflags=' ', lddlflags='-r -L/usr/X11/lib -L/usr/local/lib'

Locally applied patches:
    


@INC for perl 5.00561:
    /spool/timur/perllib
    /home/timur/perl5/i386-bsdos
    /home/timur/perl5
    /home/timur/lib/perl5/site_perl/5.005/i386-bsdos
    /home/timur/lib/perl5/site_perl/5.005
    /spool/timur/lib/perl5/5.00561/i386-bsdos
    /spool/timur/lib/perl5/5.00561
    /spool/timur/lib/site_perl/5.00561/i386-bsdos
    /spool/timur/lib/site_perl
    .


Environment for perl 5.00561:
    HOME=/home/timur
    LANG (unset)
    LANGUAGE (unset)
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PATH=/home/timur/bin:/spool/timur/bin:/usr/local/bin:/home/timur/bin:/usr/local/bin:/usr/X11/bin:/usr/bin:/bin:/usr/ucb:/usr/contrib/bin:/usr/contrib/texmf/bin:/usr/local_nfs/bin:
    PERL5LIB=/spool/timur/perllib:/home/timur/perl5:/home/timur/lib/perl5/site_perl/5.005
    PERL_BADLANG (unset)
    SHELL=/bin/bash

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