[Techtalk] Problems on FreeBSD

Leslie leslie at freakybutt.net
Thu Feb 21 17:25:39 EST 2002


I am running FreeBSD 4.5 and I am trying to install Perl 5.6.1. However
I keep coming across problems with /usr/libexec/elf/ld . For some reason
it isn’t recognizing any of my installed libraries.  When running the
configure script to install perl this is what some of the output says...


<snip>

Checking for optional libraries...
No -lsfio.
No -lsocket.
No -lbind.
No -linet.
Found -lnsl (shared).
No -lnm.
No -lndbm.
No -lgdbm.
No -ldbm.
Found -ldb (shared).
Found -ldl (shared).
No -ldld.
No -lld.
No -lsun.
Found -lm (shared).
Found -lc (shared).
No -lcposix.
No -lposix.
No -lndir.
No -ldir.
Found -lcrypt (shared).
No -lsec.
No -lucb.
No -lbsd.
No -lBSD.
No -lPW.
No -lx.
No -liconv.
Found -lutil (shared).

In order to compile perl5 on your machine, a number of libraries
are usually needed.  Include any other special libraries here as well.
Say "none" for none.  The default list is almost always right.

What libraries to use? [-lnsl -ldb -ldl -lm -lc -lcrypt -lutil]

By default, perl5 compiles with the -O flag to use the optimizer.
Alternately, you might want to use the symbolic debugger, which uses
the -g flag (on traditional Unix systems).  Either flag can be
specified here.  To use neither flag, specify the word "none".

What optimizer/debugger flag should be used? [-O]

Checking if your compiler accepts -fno-strict-aliasing
Yes, it does.

Your C compiler may want other flags.  For this question you should
include
-I/whatever and -DWHATEVER flags and any other flags used by the C
compiler,
but you should NOT include libraries or ld flags like -lwhatever.  If
you
want perl5 to honor its debug switch, you should include -DDEBUGGING
here.
Your C compiler might also need additional flags, such as
-D_POSIX_SOURCE.

To use no flags, specify the word "none".

Any additional cc flags? [-fno-strict-aliasing -I/usr/local/include]

Let me guess what the preprocessor flags are...
They appear to be: -fno-strict-aliasing -I/usr/local/include

Your C linker may need flags.  For this question you should
include -L/whatever and any other flags used by the C linker, but you
should NOT include libraries like -lwhatever.

Make sure you include the appropriate -L/path flags if your C linker
does not normally search all of the directories you specified above,
namely
        /usr/lib /usr/local/lib
To use no flags, specify the word "none".

Any additional ld flags (NOT including libraries)?
[-Wl,-E  -L/usr/local/lib]

Checking your choice of C compiler and flags for coherency...
I've tried to compile and run the following simple program:

#include <stdio.h>
int main() { printf("Ok\n"); exit(0); }

I used the command:

        cc -o try -O -fno-strict-aliasing -I/usr/local/include -Wl,-E
-L/usr/local/lib try.c -lnsl -ldb -ldl -lm -lc -lcrypt -lutil
        ./try

and I got the following output:

/usr/libexec/elf/ld: cannot find -lnsl
I can't compile the test program.
(The supplied flags or libraries might be incorrect.)

You have a BIG problem.  Shall I abort Configure [y]

</snip>


As you can see it detects the libraries at first... but then ld reports
that it cannot find a library. It is doing this with all of the
libraries. If I remove -lnsl it will do the same with -ldb and so on. If
I run the command "/usr/libexec/elf/ld -lnsl" it will report
"/usr/libexec/elf/ld: cannot find -lnsl" . I also tried updating my
ports collection with FreeBSD and installing Perl 5.6.1 from the ports
collection but it reports the same error. I am pretty positive this is a
problem with ld but I have no idea how to fix it... Does anyone have any
ideas???

- Leslie




More information about the Techtalk mailing list