-   Linux From Scratch (
-   -   grep-2.5 static fails (

ca9mbu 06-06-2002 06:15 AM

grep-2.5 static fails
I'm trying to compile the static version of grep-2.5 using the commands from the latest CVS book. It compiles fine, but when running $LFS/static/bin/grep --version it simply segfaults. If I remove the LDFLAGS=-static argument to the configure script then the binary runs fine, but of course I now have a dynamically linked binary, not the static version I need for chapter 6.

My host distro is Gentoo, and according to it's list of packages I'd be compiling with GCC 2.95.3 and Glibc 2.2.5 (I'm away from my home PC at the mo, so can't do a gcc --version, how can I determine what version of Glibc I'm running?). Just in case it matters I've got an AMD Athlon processor (this has meant I've needed to use the patch on fileutils to rectify segfault problems on that package).

If anyone could let me know how I can trace a segfault (i.e. what might be causing it) I'd be grateful.

Thanks for any help


lfslinux 06-09-2002 10:50 AM

Run /lib/ to find out Glibc's version number.

Tracing can be done using the 'strace' program (see freshmeat for the URL). It'll tell you what the program was trying to do (system call wise) and it may give you a clue why it failed.

Also, a debugger can be helpful, like gdb ( if you can understand it's output.

All times are GMT -5. The time now is 01:29 AM.