LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux From Scratch (https://www.linuxquestions.org/questions/linux-from-scratch-13/)
-   -   Glibc compile fails in chapter 5 (https://www.linuxquestions.org/questions/linux-from-scratch-13/glibc-compile-fails-in-chapter-5-a-521299/)

Weedman 01-20-2007 08:39 PM

Glibc compile fails in chapter 5 (solved, or maybe not)
 
Hello, this is my first attempt at LFS.

I have been tinkering with Gentoo for about a year now, and thought I would give LFS a shot. However, glibc (version 2.5) fails to build with this error:
Code:

gcc -B/tools/bin/ check_fds.c -c -std=gnu99 -O2 -Wall -Winline -Wwrite-strings -fmerge-all-constants -g -Wstrict-prototypes -mpreferred-stack-boundary=4    -I../include -I/mnt/lfs/build/glibc-build/csu -I/mnt/lfs/build/glibc-build -I../sysdeps/i386/elf -I../nptl/sysdeps/unix/sysv/linux/i386/i686 -I../nptl/sysdeps/unix/sysv/linux/i386 -I../sysdeps/unix/sysv/linux/i386 -I../nptl/sysdeps/unix/sysv/linux -I../nptl/sysdeps/pthread -I../sysdeps/pthread -I../sysdeps/unix/sysv/linux -I../sysdeps/gnu -I../sysdeps/unix/common -I../sysdeps/unix/mman -I../sysdeps/unix/inet -I../sysdeps/unix/sysv/i386 -I../nptl/sysdeps/unix/sysv -I../sysdeps/unix/sysv -I../sysdeps/unix/i386 -I../nptl/sysdeps/unix -I../sysdeps/unix -I../sysdeps/posix -I../sysdeps/i386/i686/fpu -I../nptl/sysdeps/i386/i686 -I../sysdeps/i386/i686 -I../sysdeps/i386/i486 -I../nptl/sysdeps/i386/i486 -I../sysdeps/i386/fpu -I../nptl/sysdeps/i386 -I../sysdeps/i386 -I../sysdeps/wordsize-32 -I../sysdeps/ieee754/ldbl-96 -I../sysdeps/ieee754/dbl-64 -I../sysdeps/ieee754/flt-32 -I../sysdeps/ieee754 -I../sysdeps/generic/elf -I../sysdeps/generic -I../nptl  -I.. -I../libio -I. -nostdinc -isystem /mnt/lfs/tools/bin/../lib/gcc/i686-pc-linux-gnu/4.1.1/include -isystem /tools/include -D_LIBC_REENTRANT -include ../include/libc-symbols.h      -DHAVE_INITFINI -o /mnt/lfs/build/glibc-build/csu/check_fds.o -MD -MP -MF /mnt/lfs/build/glibc-build/csu/check_fds.o.dt -MT /mnt/lfs/build/glibc-build/csu/check_fds.o
check_fds.c: In function 'check_one_fd':
check_fds.c:45: error: 'EBADF' undeclared (first use in this function)
check_fds.c:45: error: (Each undeclared identifier is reported only once
check_fds.c:45: error: for each function it appears in.)
make[2]: *** [/mnt/lfs/build/glibc-build/csu/check_fds.o] Error 1
make[2]: Leaving directory `/mnt/lfs/build/glibc-build/glibc-2.5/csu'
make[1]: *** [csu/subdir_lib] Error 2
make[1]: Leaving directory `/mnt/lfs/build/glibc-build/glibc-2.5'
make: *** [all] Error 2

I am lost to why this is happening. Google wasn't much help in finding out what the issue is. The host system is Gentoo, with glibc 2.5 and gcc 4.1.1, which ironically are exactly what I am using for my LFS system.

Any help will be greatly appreciated.

Thanks,
weed

wjevans_7d1@yahoo.co 01-21-2007 05:36 AM

I'm not sure how much help this will be, but, EBADF is one of those symbols defined (directly or indirectly) by /usr/include/errno.h

That's available, right? Does it directly define EBADF? If not, it probably includes some other .h file which does, either directly or indirectly. Check out the "directly or indirectly" question. If /usr/include/errno.h doesn't define EBADF, but includes some other file, does that other file define EBADF (either directly or indirectly)?

It could, be, though, that LFS is using its own version of errno.h, one that's provided with LFS. If that's the case, my answer above won't do you much good.

If you can't find some other more useful answer, go to:

http://www.linuxfromscratch.org/support.html

You'll find a whole array of support resources, including mailing lists where you can pose this question.

Hope this helps.

Weedman 01-23-2007 06:00 AM

Thank you very much, wjevans!

For some reason, the patch to install the kernel headers mustn't of worked, because I don't have errno.h in the temporary tools directory under the folder include.

Considering that failed miserably (and the old sources were only 2.6.18), I might as well install some later kernel sources (ie: 2.6.19). In order to install the kernel headers, is it a mere copy of the include directory in the top level directory of the kernel source or is it a bit more than that?

Thanks again for your help,

weed

Daws 01-23-2007 06:59 AM

Quote:

In order to install the kernel headers, is it a mere copy of the include directory in the top level directory of the kernel source or is it a bit more than that?
Aha something I can answer. If you are using .19.x you don't have to worry about unifdef because it is incorporated into the kernel.
Basically follow the instructions as in the svn lfs:

Chapter 5
and Chapter 6

But ignore the patching instructions.

Weedman 01-24-2007 05:31 AM

Thanks Daws, I wasn't actually using the .19.x sources, I was using the .18.x sources as specified in the svn version of the LFS install guide.

Nevertheless, I was going to try the .19.x sources next, so you've given me instructions on how to get through the next step. Thank you again!

I have my reasons for using the SVN install guide. The stable guide doesn't cover gcc 4.1.1 or glibc 2.5.

So, thank you very much Daws and wjevans for your help.

I think my problem is now solved.

weed

Weedman 01-25-2007 06:03 AM

Fantastic, here we go again.

Glibc fails again with another error:
Code:

gcc -B/tools/bin/ ../sysdeps/unix/sysv/linux/ifaddrs.c -c -std=gnu99 -O2 -Wall -Winline -Wwrite-strings -fmerge-all-constants -g -Wstrict-prototypes -mpreferred-stack-boundary=2    -I../include -I/mnt/lfs/build/glibc-build/inet -I/mnt/lfs/build/glibc-build -I../sysdeps/i386/elf -I../nptl/sysdeps/unix/sysv/linux/i386/i686 -I../nptl/sysdeps/unix/sysv/linux/i386 -I../sysdeps/unix/sysv/linux/i386 -I../nptl/sysdeps/unix/sysv/linux -I../nptl/sysdeps/pthread -I../sysdeps/pthread -I../sysdeps/unix/sysv/linux -I../sysdeps/gnu -I../sysdeps/unix/common -I../sysdeps/unix/mman -I../sysdeps/unix/inet -I../sysdeps/unix/sysv/i386 -I../nptl/sysdeps/unix/sysv -I../sysdeps/unix/sysv -I../sysdeps/unix/i386 -I../nptl/sysdeps/unix -I../sysdeps/unix -I../sysdeps/posix -I../sysdeps/i386/i686/fpu -I../nptl/sysdeps/i386/i686 -I../sysdeps/i386/i686 -I../sysdeps/i386/i486 -I../nptl/sysdeps/i386/i486 -I../sysdeps/i386/fpu -I../nptl/sysdeps/i386 -I../sysdeps/i386 -I../sysdeps/wordsize-32 -I../sysdeps/ieee754/ldbl-96 -I../sysdeps/ieee754/dbl-64 -I../sysdeps/ieee754/flt-32 -I../sysdeps/ieee754 -I../sysdeps/generic/elf -I../sysdeps/generic -I../nptl  -I.. -I../libio -I. -nostdinc -isystem /mnt/lfs/tools/bin/../lib/gcc/i686-pc-linux-gnu/4.1.1/include -isystem /tools/include -D_LIBC_REENTRANT -include ../include/libc-symbols.h      -o /mnt/lfs/build/glibc-build/inet/ifaddrs.o -MD -MP -MF /mnt/lfs/build/glibc-build/inet/ifaddrs.o.dt -MT /mnt/lfs/build/glibc-build/inet/ifaddrs.o
../sysdeps/unix/sysv/linux/ifaddrs.c: In function 'getifaddrs':
../sysdeps/unix/sysv/linux/ifaddrs.c:426: warning: implicit declaration of function 'IFLA_RTA'
../sysdeps/unix/sysv/linux/ifaddrs.c:426: warning: initialization makes pointer from integer without a cast
../sysdeps/unix/sysv/linux/ifaddrs.c:427: warning: implicit declaration of function 'IFLA_PAYLOAD'
../sysdeps/unix/sysv/linux/ifaddrs.c:500: warning: initialization makes pointer from integer without a cast
../sysdeps/unix/sysv/linux/ifaddrs.c:584: warning: implicit declaration of function 'IFA_RTA'
../sysdeps/unix/sysv/linux/ifaddrs.c:584: warning: initialization makes pointer from integer without a cast
../sysdeps/unix/sysv/linux/ifaddrs.c:585: warning: implicit declaration of function 'IFA_PAYLOAD'
../sysdeps/unix/sysv/linux/ifaddrs.c:593: error: dereferencing pointer to incomplete type
../sysdeps/unix/sysv/linux/ifaddrs.c:606: error: 'IFA_ADDRESS' undeclared (first use in this function)
../sysdeps/unix/sysv/linux/ifaddrs.c:606: error: (Each undeclared identifier is reported only once
../sysdeps/unix/sysv/linux/ifaddrs.c:606: error: for each function it appears in.)
../sysdeps/unix/sysv/linux/ifaddrs.c:629: error: dereferencing pointer to incomplete type
../sysdeps/unix/sysv/linux/ifaddrs.c:631: error: dereferencing pointer to incomplete type
../sysdeps/unix/sysv/linux/ifaddrs.c:649: error: dereferencing pointer to incomplete type
../sysdeps/unix/sysv/linux/ifaddrs.c:661: error: 'IFA_LOCAL' undeclared (first use in this function)
../sysdeps/unix/sysv/linux/ifaddrs.c:676: error: dereferencing pointer to incomplete type
../sysdeps/unix/sysv/linux/ifaddrs.c:678: error: dereferencing pointer to incomplete type
../sysdeps/unix/sysv/linux/ifaddrs.c:696: error: dereferencing pointer to incomplete type
../sysdeps/unix/sysv/linux/ifaddrs.c:708: error: 'IFA_BROADCAST' undeclared (first use in this function)
../sysdeps/unix/sysv/linux/ifaddrs.c:717: error: dereferencing pointer to incomplete type
../sysdeps/unix/sysv/linux/ifaddrs.c:719: error: dereferencing pointer to incomplete type
../sysdeps/unix/sysv/linux/ifaddrs.c:737: error: dereferencing pointer to incomplete type
../sysdeps/unix/sysv/linux/ifaddrs.c:749: error: 'IFA_LABEL' undeclared (first use in this function)
../sysdeps/unix/sysv/linux/ifaddrs.c:760: error: 'IFA_UNSPEC' undeclared (first use in this function)
../sysdeps/unix/sysv/linux/ifaddrs.c:762: error: 'IFA_CACHEINFO' undeclared (first use in this function)
../sysdeps/unix/sysv/linux/ifaddrs.c:775: error: dereferencing pointer to incomplete type
../sysdeps/unix/sysv/linux/ifaddrs.c:811: error: dereferencing pointer to incomplete type
../sysdeps/unix/sysv/linux/ifaddrs.c:814: error: dereferencing pointer to incomplete type
make[2]: *** [/mnt/lfs/build/glibc-build/inet/ifaddrs.o] Error 1
make[2]: Leaving directory `/mnt/lfs/build/glibc-build/glibc-2.5/inet'
make[1]: *** [inet/subdir_lib] Error 2
make[1]: Leaving directory `/mnt/lfs/build/glibc-build/glibc-2.5'
make: *** [all] Error 2

This is with the 2.6.19 kernel headers, following this procedure (on the headers):
Code:

make mrproper
make oldconfig
make prepare
make prepare-all
cp -av include/* /tools/include

I must be doing something wrong with the headers. The LFS manual doesn't delve into the exact steps of installing the kernel headers, so I had to scour the kernel-headers ebuilds on my gentoo system to find the make steps. It wouldn't surprise me if I missed a step or the above commands are wrong.

Any help would be appreciated, as this is starting to be a major pita.

weed

Angeliqe 01-25-2007 11:04 AM

HLFS SVN instructions for building the headers. They should be similar to LFS.

mkdir /tools/tmp
make mrproper
make headers_check
make INSTALL_HDR_PATH=/tools/tmp headers_install
cp -R /tools/tmp/include/* /tools/include
rm -r /tools/tmp

Expect to do a lot of digging on glibc-2.5 and gcc-4.1.1 I haven't been able to get the toolchain working either. If this is your first attempt at LFS, you're really better off with the stable book as the SVN's are usually very difficult to get going on, at least in my experience. Also, builds according to SVN would work better with the LFS live-cd. It even states in HLFS SVN that you MUST use the live-cd or a previously compiled version of LFS.


All times are GMT -5. The time now is 08:28 PM.