[Buildroot] Problems building lsof

Andy Gibbs andyg1001 at hotmail.co.uk
Mon Oct 25 14:00:00 UTC 2010


Hi,

I'm using buildroot-2010.08 with an external toolchain generated by 
crosstool-ng.  When using buildroot-2010.05, I had no problems, but now I 
get the error:

/test/source/buildroot-2010.08/../../crosstool-ng/x-tools/bin/ppc_603e-gcc --sysroot=/test/build/buildroot-2010.08/staging 
 -O2 -pipe -O2  -mtune=603e -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 
   -c -o dsock.o dsock.c
dsock.c: In function 'build_IPstates':
dsock.c:472:49: error: 'TCP_ESTABLISHED' undeclared (first use in this 
function)
dsock.c:472:49: note: each undeclared identifier is reported only once for 
each function it appears in
dsock.c:473:46: error: 'TCP_SYN_SENT' undeclared (first use in this 
function)
dsock.c:474:46: error: 'TCP_SYN_RECV' undeclared (first use in this 
function)
dsock.c:475:47: error: 'TCP_FIN_WAIT1' undeclared (first use in this 
function)
dsock.c:476:47: error: 'TCP_FIN_WAIT2' undeclared (first use in this 
function)
dsock.c:477:47: error: 'TCP_TIME_WAIT' undeclared (first use in this 
function)
dsock.c:478:43: error: 'TCP_CLOSE' undeclared (first use in this function)
dsock.c:479:48: error: 'TCP_CLOSE_WAIT' undeclared (first use in this 
function)
dsock.c:480:46: error: 'TCP_LAST_ACK' undeclared (first use in this 
function)
dsock.c:481:44: error: 'TCP_LISTEN' undeclared (first use in this function)
dsock.c:482:45: error: 'TCP_CLOSING' undeclared (first use in this function)
make[1]: *** [dsock.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: Leaving directory 
`/test/build/buildroot-2010.08/build/lsof_4.81/lsof_4.81_src'
make: *** [/test/build/buildroot-2010.08/build/lsof_4.81/lsof_4.81_src/lsof] 
Error 2


I've done some digging around, and here is what I've found so far...

I found a similar report at 
http://bugs.gentoo.org/show_bug.cgi?id=195110#c5, where configure seems not 
to be able to determine the correct C library type.  In my case, this seems 
not to be the problem, since further up the log file, during 'configure', I 
am getting:

Testing C library type with cc ... done
The C library type is glibc, version "-DGLIBCV=210".


However, when it comes to 'make', I am getting:

make[1]: Entering directory 
`/test/build/buildroot-2010.08/build/lsof_4.81/lsof_4.81_src'
(cd lib; /usr/bin/make 
DEBUG="-O2 -pipe -O2  -mtune=603e -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE  
-D_FILE_OFFSET_BITS=64 " 
CFGF="-DLINUXV=26032 -DGLIBCV=210 -DHASIPv6 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE 
 -DHAS_STRFTIME -DLSOF_VSTR=\"2.6.32-5-686\"")
/test/source/buildroot-2010.08/../../crosstool-ng/x-tools/bin/ppc_603e-gcc --sysroot=/test/build/buildroot-2010.08/staging 
 -O2 -pipe -O2  -mtune=603e -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 
   -c -o dfile.o dfile.c
make[2]: Entering directory 
`/test/build/buildroot-2010.08/build/lsof_4.81/lsof_4.81_src/lib'
/test/source/buildroot-2010.08/../../crosstool-ng/x-tools/bin/ppc_603e-gcc --sysroot=/test/build/buildroot-2010.08/staging 
 -O2 -pipe -O2  -mtune=603e -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 
   -c -o ckkv.o ckkv.c
[... etc ...]


If I contrast this with my saved log from buildroot-2010.05:

make[1]: Entering directory 
`/test/build/buildroot-2010.05/build/lsof_4.81/lsof_4.81_src'
(cd lib; /usr/bin/make 
DEBUG="-O2 -pipe -O2  -mtune=603e -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE  
-D_FILE_OFFSET_BITS=64 --sysroot /test/build/buildroot-2010.05/staging/ " 
CFGF="-DLINUXV=26026 -DGLIBCV=210 -DHASIPv6 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE 
 -DHAS_STRFTIME -DLSOF_VSTR=\"2.6.26.3\"")
/test/source/buildroot-2010.05/../../crosstool-ng/x-tools/bin/ppc_603e-gcc -O2 
 -pipe -O2  -mtune=603e -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 
 --sysroot 
/test/build/buildroot-2010.05/staging/  -DLINUXV=26026 -DGLIBCV=210 -DHASIPv6 
 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -DHAS_STRFTIME -DLSOF_VSTR=\"2.6.26.3\" 
 -I/test/build/buildroot-2010.05/staging/usr/include   -O2 -pipe -O2  -mtune=603e 
 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 --sysroot 
/test/build/buildroot-2010.05/staging/    -c -o dfile.o dfile.c
make[2]: Entering directory 
`/test/build/buildroot-2010.05/build/lsof_4.81/lsof_4.81_src/lib'
/test/source/buildroot-2010.05/../../crosstool-ng/x-tools/bin/ppc_603e-gcc -O2 
 -pipe -O2  -mtune=603e -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 
 --sysroot 
/test/build/buildroot-2010.05/staging/  -DLINUXV=26026 -DGLIBCV=210 -DHASIPv6 
 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -DHAS_STRFTIME -DLSOF_VSTR="2.6.26.3" 
 -I/test/build/buildroot-2010.05/staging/usr/include -O2 -pipe -O2  -mtune=603e 
 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 --sysroot 
/test/buildroot-2010.05/staging/    -c -o ckkv.o ckkv.c
[... etc ...]


Looking at the git log at 
http://git.buildroot.net/buildroot/log/package/lsof?id=2010.08, it seems 
that the configuration for lsof in buildroot has not changed between 2010.05 
and 2010.08.  Additionally, my toolchain from crosstool is identical and my 
buildroot config file has also not been changed.  I have simply upgraded 
buildroot.

Any ideas what might be causing the problem here?

Looking at the differences between the output from 2010.05 and 2010.08, it 
seems that two things are happening:

1) LSOF_VSTR in some way seems to be linked to the Linux kernel version of 
my PC (it was 2.6.26.3 when I originally used 2010.05; it is now 2.6.32-5), 
but I am compiling for an embedded version of Linux -- 2.6.29.1.  Likewise, 
I should expect the LINUXV define to be 26029 not 26026 or 26032.

2) In 2010.08, all the additional defines 
(e.g. -DLINUXV=????? -DGLIBCV=210 -DHASIPv6) and include path are not being 
passed along to gcc.

If anyone has any ideas, I will be very grateful to accept them!

Thanks
Andy




More information about the buildroot mailing list