Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

glibc error while building linux from scratch

The following error came up when i did 'make' of glibc-2.14.1 for LFS 7.1. I am using ubuntu as the host OS.

gcc ../sysdeps/unix/sysv/linux/syslog.c -c -std=gnu99 -fgnu89-inline -O2 -Wall -Winline 
-Wwrite-strings -fmerge-all-constants -g -Wstrict-prototypes -mpreferred-stack-
boundary=2  -Wa,-mtune=i686 -fexceptions   -I../include -I/mnt/lfs/sources/glibc-
build/misc -I/mnt/lfs/sources/glibc-build -I../sysdeps/i386/elf -
I../nptl/sysdeps/unix/sysv/linux/i386/i686 -I../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../sysdeps/i386/i686/multiarch -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 /usr/lib/gcc/i686-linux-gnu/4.6/include -isystem 
/usr/lib/gcc/i686-linux-gnu/4.6/include-fixed -isystem /tools/include -D_LIBC_REENTRANT 
-include ../include/libc-symbols.h       -o /mnt/lfs/sources/glibc-build/misc/syslog.o 
-MD -MP -MF /mnt/lfs/sources/glibc-build/misc/syslog.o.dt -MT /mnt/lfs/sources/glibc-
build/misc/syslog.o 
In file included from ../sysdeps/unix/sysv/linux/syslog.c:10:0:
../misc/syslog.c: In function '__vsyslog_chk':
../misc/syslog.c:144:9: warning: variable 'prioff' set but not used [-Wunused-but-set-  
variable]
../misc/syslog.c:123:1: sorry, unimplemented: inlining failed in call to 'syslog':   
 function body not available
../misc/syslog.c:155:9: sorry, unimplemented: called from here
make[2]: *** [/mnt/lfs/sources/glibc-build/misc/syslog.o] Error 1
make[2]: Leaving directory `/mnt/lfs/sources/glibc-2.14.1/misc'
make[1]: *** [misc/subdir_lib] Error 2
make[1]: Leaving directory `/mnt/lfs/sources/glibc-2.14.1'
make: *** [all] Error 2

Can anyone tell me what to do?

like image 737
AvinashK Avatar asked Aug 07 '12 18:08

AvinashK


People also ask

What is glibc in C?

The Glibc package contains the main C library. This library provides the basic routines for allocating memory, searching directories, opening and closing files, reading and writing files, string handling, pattern matching, arithmetic, and so on. 6.9.1. Installation of Glibc

Why won't glibc install on my host system?

If LFS is not properly set, and despite the recommendations, you are building as root, the next command will install the newly built glibc to your host system, which most likely will render it unusable. So double check that the environment is correctly set, before running the following command.

What is glibc 6 9?

6.9. Glibc-2.19 The Glibc package contains the main C library. This library provides the basic routines for allocating memory, searching directories, opening and closing files, reading and writing files, string handling, pattern matching, arithmetic, and so on. 6.9.1.

How do I install locales not listed in the glibc-2 file?

Then use the localedef command to create and install locales not listed in the glibc-2.31/localedata/SUPPORTED file in the unlikely case you need them. Glibc now uses libidn2 when resolving internationalized domain names. This is a run time dependency.


2 Answers

For glibc 2.15, I had to do like ks1322:

$ ../glibc2.15/configure CFLAGS="-O2 -U_FORTIFY_SOURCE -fno-stack-protector" $ make

The -O2 is required to recover the default optimisation, required to avoid a number of failures.

The -U_FORTIFY_SOURCE is required to avoid failure of gcc ../sysdeps/unix/sysv/linux/syslog.c (In function ‘__vsyslog_chk’: [...] inlining failed in call to ‘syslog’)

The -fno-stack-protector is required to avoid failure of gcc [...] elf/dl-allobjs.os libc_pic.a ((init-first.os):(.data+0x0): multiple definition of '__libc_multiple_libcs').

With these CFLAGS, I get just a warning (errlist.c count 133 inflated to GLIBC_2.12 count 134 (old errno.h?)).

P.S. It is also very important to not use the gold linker (ld.gold, from the binutils-gold package), because libc's config will reject it. This is easily done by changing the /usr/bin/ld symbolic link from ld.gold to ld.bfd.

like image 134
Urhixidur Avatar answered Sep 28 '22 10:09

Urhixidur


After make failed, the following worked for me:

make clean
make -j2 CFLAGS="-U_FORTIFY_SOURCE -O2 -fno-stack-protector"

See details in this blog http://www.yonch.com/tech/78-compiling-glibc.

like image 39
ks1322 Avatar answered Sep 28 '22 09:09

ks1322