Linux From ScratchThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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:
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.
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:
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?
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:
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.