binutil first pass fail due to undeclared LONG_MIN

Jean-Marc Ranger jmranger at iquebec.com
Fri Mar 26 20:43:54 PST 2004


Hi everyone,

This is not really a support request, since I think I know what happened, 
but I'm looking for simpler fixes than the one I see...

Let's start with the error itself:
---------------------------------------------------------
-W -Wall -Wtraditional -pedantic  ../../binutils-2.14/libiberty/fdmatch.c 
-o pic/fdmatch.o; \
else true; fi
gcc -c -DHAVE_CONFIG_H -g -O2 -I. 
-I../../binutils-2.14/libiberty/../include  -W -Wall -Wtraditional 
-pedantic ../../binutils-2.14/libiberty/fdmatch.c -o fdmatch.o
if [ x"" != x ]; then \
   gcc -c -DHAVE_CONFIG_H -g -O2 -I. -I../../binutils-2.14/libiberty/../include
-W -Wall -Wtraditional -pedantic  ../../binutils-2.14/libiberty/fibheap.c 
-o pic/fibheap.o; \
else true; fi
gcc -c -DHAVE_CONFIG_H -g -O2 -I. 
-I../../binutils-2.14/libiberty/../include  -W -Wall -Wtraditional 
-pedantic ../../binutils-2.14/libiberty/fibheap.c -o fibheap.o
../../binutils-2.14/libiberty/fibheap.c: In function `fibheap_delete_node':
../../binutils-2.14/libiberty/fibheap.c:285: `LONG_MIN' undeclared (first 
use in this function)
../../binutils-2.14/libiberty/fibheap.c:285: (Each undeclared identifier is 
reported only once
../../binutils-2.14/libiberty/fibheap.c:285: for each function it appears in.)
make[1]: *** [fibheap.o] Error 1
make[1]: Leaving directory `/mnt/lfs/lfs-packages/bu_make/libiberty'
make: *** [all-libiberty] Error 2
Fri Mar 26 23:10:24 PST 2004
lfs at darkstar:/mnt/lfs/lfs-packages/bu_make$
---------------------------------------------------------

Looking at the code, I found that LONG_MIN is defined in limits.h.  I also 
found that in fibheap.c, limits.h is only included in HAVE_LIMITS_H is 
defined.  A quick test proved that it isn't in my settup.  Oh well.  Time 
for a little test:

---------------------------------------------------------
root at darkstar:~# gcc test.c
In file included from /usr/include/bits/posix1_lim.h:126,
                  from /usr/include/limits.h:30,
                  from 
/usr/lib/gcc-lib/i386-slackware-linux/egcs-2.91.66/include/limits.h:117,
                  from 
/usr/lib/gcc-lib/i386-slackware-linux/egcs-2.91.66/include/syslimits.h:7,
                  from 
/usr/lib/gcc-lib/i386-slackware-linux/egcs-2.91.66/include/limits.h:11,
                  from test.c:2:
/usr/include/bits/local_lim.h:27: linux/limits.h: No such file or directory
root at darkstar:~# cat test.c

#include <limits.h>

int main()
{
         return 0;
}

root at darkstar:~#
---------------------------------------------------------

So I guess I'm missing the package usually referred as "kernel-headers" or 
something like that.  This computer is running an outdated version of 
ZipSlack, which readme begins with:

---------------------------------------------------------
Tue Jun 20 19:59:43 PDT 2000
Rebuilt ZipSlack from Slackware 7.1, Linux 2.2.16, and glibc-2.1.3.
Unfortunately, things keep growing, but the size of a 100MB Zip Disk
doesn't (they sort of remind me of floppy disks in that regard ;), so
there are somewhat less features this time around.  In particular,
there's no longer room for a subset of the kernel sources, which will
limit what can be compiled unless kernel sources are added.
---------------------------------------------------------

  So various possible fixes are:
- find a way to add a cd-rom to the computer, and boot from a modern 
cd-based distribution
- install kernel headers
- use a patch similar to the one in strtol.c, where LONG_MIN is redefined 
if needed

But a more basic question is:  is it expected that kernel-headers are 
required to compile binutils ?

Thanks,

Jean-Marc Ranger 


More information about the lfs-support mailing list