On 06/01/2012 10:16 PM, Bruce Dubbs wrote:
> Matt,
>
>     Trying a fresh build, perl 5.16.0 fails to configure.
>
> As user lfs:
>
> $ sh Configure -des -Dprefix=/tools
>
> Directories to use for library searches?
> [/lib/../lib64 /usr/lib/../lib64 /lib /usr/lib /tools/lib]
> ...
>
> What libraries to use?
> [-lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc -lgdbm_compat]
> ...
>
>    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
>            ./try
>
> and I got the following output:
>
> /mnt/lfs/tools/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.7.0/../../../../x86_64-unknown-linux-gnu/bin/ld:
> cannot find -lgdbm
> /mnt/lfs/tools/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.7.0/../../../../x86_64-unknown-linux-gnu/bin/ld:
> cannot find -ldb
> collect2: error: ld returned 1 exit status
> ===========
>
> On my system, I have
> /usr/lib/libdb.so
> /usr/lib/libgdbm.so
> /usr/lib/libgdbm_compat.so
>
> But we really don't want to use any of those because they won't be
> available in chroot.  It is curious Configure finds them at first and
> then the link command doesn't as the lfs user.
>
> ==========
>
> If I run Configure manually and leave off -lgdbm -ldb -lgdbm_compat, it
> builds OK.
>
> ==========
>
> Finally, I found if I edit Configure (chmod 775 first), and add the line:
>
> libswanted=''
>
> to line 3577, then it works!
>
> chmod 0744 Configure
> sed -i -e '/Restore computed paths/i libswanted=""' Configure
>
> sh Configure -des -Dprefix=/tools
> make CLDFLAGS='-lm'
>
> and continue seems to work.
>
>     -- Bruce
>
> P.S.  This took WAY too long to figure out.
While I am having other issues with perl ATM, maybe it would be better 
to use the new compiler to determine the library search path instead of 
the brute force method above (or the one in hints/linux.sh). 
hints/linux.sh temporarily redefines gcc to /usr/bin/gcc (if it exists) 
which is what is used to determine the library search path. "sed 
's@\$gcc@gcc' -i hints/linux.sh" may be sufficient, not sure if $gcc is 
used elsewhere. While I'm working on my other issues, Gentoo u32 host 
and NPTL linking error (which may also be related), I'm going to undo 
this change locally and omit the gcc override and see if I get any 
further. On a side note, it may have been sufficient to make libswanted="m".

-- DJ Lucas


-- 
This message has been scanned for viruses and
dangerous content, and is believed to be clean.

-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-dev
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page

Reply via email to