perl build problems, chapter 5

Nathan Coulson conathan at
Sat Jul 2 19:26:34 PDT 2011

Checking for optional libraries...
What libraries to use?
[-lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc -lgdbm_compat -lpthread]
What optimizer/debugger flag should be used? [-O2]
Any additional cc flags? [-fno-strict-aliasing -pipe -fstack-protector]
Let me guess what the preprocessor flags are...
Any additional ld flags (NOT including libraries)? [ -fstack-protector]
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"); return(0); }

I used the command:

	cc -o try -O2 -fno-strict-aliasing -pipe -fstack-protector
-fstack-protector try.c -lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc
-lgdbm_compat -lpthread

and I got the following output:

cannot find -lgdbm
cannot find -ldb
collect2: ld returned 1 exit status
I can't compile the test program.
You have a BIG problem.  Shall I abort Configure [y]
Ok.  Stopping Configure.

must have picked up that I had gdbm and db on the host somehow,

noted a thread mention some workarounds
(from 2009 though)

going to play with it further, find out why it chose those two test
programs.  If it's pkg-config, perhaps setting PKG_CONFIG_PATH is all
we need.  (of course if this is my fault, then that doesn't matter).

My instructions worked fine until the last update (when we moved to
make [which I voted for])
Nathan Coulson (conathan)
Location: British Columbia, Canada
Timezone: PST (-8)

More information about the lfs-dev mailing list