从头开始构建linux时出现glibc错误

前端之家收集整理的这篇文章主要介绍了从头开始构建linux时出现glibc错误前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
当我为LFS 7.1“制作”glibc-2.14.1时出现以下错误.我使用ubuntu作为主机操作系统.
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

谁能告诉我该怎么办?

解决方法

对于glibc 2.15,我不得不像ks1322那样:

$../glibc2.15/configure CFLAGS =“ – O2 -U_FORTIFY_SOURCE -fno-stack-protector”
$make

-O2是恢复默认优化所必需的,这是避免许多故障所必需的.

-U_FORTIFY_SOURCE需要避免gcc ../sysdeps/unix/sysv/linux/syslog.c失败(在函数’__vsyslog_chk’中:[…]内联调用’syslog’失败)

-fno-stack-protector需要避免gcc […] elf / dl-allobjs.os libc_pic.a((init-first.os):(.data 0x0)的失败:’__ libc_multiple_libcs​​’的多重定义).

使用这些CFLAGS,我只得到一个警告(errlist.c计数133膨胀到GLIBC_2.12计数134(旧errno.h?)).

附:不使用黄金链接器(ld.gold,来自binutils-gold包)也非常重要,因为libc的配置会拒绝它.通过将/usr/bin/ld符号链接从ld.gold更改为ld.bfd可以轻松完成此操作.

原文链接:https://www.f2er.com/linux/393088.html

猜你在找的Linux相关文章