LFS-6.1-testing binutils failure

Bryan Kadzban bryan at kadzban.is-a-geek.net
Mon Apr 4 03:58:44 PDT 2005

Bruce Dubbs wrote:
> gcc -DHAVE_CONFIG_H -I. -I../../binutils- -I. 
> -D_GNU_SOURCE -DTRAD_CORE -I. -I../../binutils- 
> -I../../binutils- 
> -I../../binutils- -I../intl -W -Wall 
> -Wstrict-prototypes -Wmissing-prototypes -g -O2 -c 
> ../../binutils- -o bfdio.o 
> ../../binutils- In function `bfd_seek': 
> ../../binutils- error: `EINVAL' undeclared (first use in this function) 
> ../../binutils- error: (Each undeclared identifier is reported only once 
> ../../binutils- error: for each function it appears in.)
> make[3]: *** [bfdio.lo] Error 1
> The boot CD has /usr/include/linux/errno.h:#define      EINVAL 22      /* Invalid argument */

I didn't see it, but I didn't build from the boot CD either (it was from
an LFS-5-more-or-less system).

Does the bfdio.c function #include <errno.h>?  Does the boot CD's
/usr/include/errno.h #include <linux/errno.h>?

On my system (the LFS-5-more-or-less one), /usr/include/errno.h pulls in
/usr/include/bits/errno.h, which pulls in /usr/include/linux/errno.h,
which does nothing but include /usr/include/asm/errno.h, which is where
most of the actual definitions are.  Those were Fedora headers, though
(the LLH project didn't exist at the time).  I also used the NPTL hint.

On the newly built 6.1-testing system, however, with LLH headers, it
looks more like the CD -- /usr/include/errno.h pulls in <bits/errno.h>,
which pulls in <linux/errno.h> (and <asm/errno.h> just pulls in
<linux/errno.h>, which is probably done for backwards compatibility).

The compiler should never see an EINVAL symbol -- that should be removed
by the preprocessor when it runs through the files, pulls in all the
headers, and replaces all the #defines with their values.  My thinking
is that this didn't happen because either <errno.h> wasn't included, or
<linux/errno.h> wasn't included (so the preprocessor didn't have a
definition for EINVAL).
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 256 bytes
Desc: OpenPGP digital signature
URL: <http://lists.linuxfromscratch.org/pipermail/lfs-dev/attachments/20050404/d332fbd1/attachment.sig>

More information about the lfs-dev mailing list