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

p5pRT opened this issue Sep 7, 1999 · 1 comment

Incorrect order of libraries during compilation.. #491

p5pRT opened this issue Sep 7, 1999 · 1 comment


Copy link

p5pRT commented Sep 7, 1999

Migrated from (status was 'resolved')

Searchable as RT1333$

Copy link

p5pRT commented Sep 7, 1999


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 \
-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 \

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:
    osname=bsdos, osvers=3.1, archname=i386-bsdos
    uname='bsdos 3.1 bsdi bsdos 3.1 kernel #2: wed mar 31 11:53:32 cest 1999 i386 '
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=undef useperlio=undef d_sfio=undef
    use64bits=undef usemultiplicity=undef
    cc='shlicc2', optimize='-O2', gccversion=
    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:

Environment for perl 5.00561:
    LANG (unset)
    LANGUAGE (unset)
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PERL_BADLANG (unset)

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

No branches or pull requests

1 participant