LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch
User Name
Password
Linux From Scratch This Forum is for the discussion of LFS.
LFS is a project that provides you with the steps necessary to build your own custom Linux system.

Notices


Reply
  Search this Thread
Old 01-20-2007, 08:39 PM   #1
Weedman
Member
 
Registered: Oct 2005
Location: Tasmania, Australia.
Distribution: Gentoo, Debian, Ubuntu
Posts: 30

Rep: Reputation: 15
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

Last edited by Weedman; 01-25-2007 at 05:55 AM.
 
Old 01-21-2007, 05:36 AM   #2
wjevans_7d1@yahoo.co
Member
 
Registered: Jun 2006
Location: Mariposa
Distribution: Slackware 9.1
Posts: 938

Rep: Reputation: 31
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.
 
Old 01-23-2007, 06:00 AM   #3
Weedman
Member
 
Registered: Oct 2005
Location: Tasmania, Australia.
Distribution: Gentoo, Debian, Ubuntu
Posts: 30

Original Poster
Rep: Reputation: 15
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

Last edited by Weedman; 01-23-2007 at 06:04 AM.
 
Old 01-23-2007, 06:59 AM   #4
Daws
Member
 
Registered: May 2006
Location: UK
Distribution: Debian
Posts: 447

Rep: Reputation: 39
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.
 
Old 01-24-2007, 05:31 AM   #5
Weedman
Member
 
Registered: Oct 2005
Location: Tasmania, Australia.
Distribution: Gentoo, Debian, Ubuntu
Posts: 30

Original Poster
Rep: Reputation: 15
Thumbs up

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
 
Old 01-25-2007, 06:03 AM   #6
Weedman
Member
 
Registered: Oct 2005
Location: Tasmania, Australia.
Distribution: Gentoo, Debian, Ubuntu
Posts: 30

Original Poster
Rep: Reputation: 15
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
 
Old 01-25-2007, 11:04 AM   #7
Angeliqe
LQ Newbie
 
Registered: Jan 2007
Posts: 22

Rep: Reputation: 15
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.

Last edited by Angeliqe; 01-25-2007 at 01:00 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LFS 6-1: Glibc Test Suite Fails at end with 2 errors in Chapter 6 TGWDNGHN Linux From Scratch 1 07-26-2005 12:23 PM
glibc-2.3.3 in chapter 6 error znif Linux From Scratch 11 06-28-2004 07:15 AM
glibc problem in chapter 6 alaios Linux From Scratch 5 04-04-2004 04:27 AM
Chapter 6 glibc-2.3.1 install gabebster Linux From Scratch 14 09-24-2003 10:38 PM
Chapter 6, Glibc: configure fails while testing CPP Electrode Linux From Scratch 9 08-31-2003 02:38 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch

All times are GMT -5. The time now is 01:58 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration