linux - Glibc编译错误

标签 linux compilation compiler-errors makefile glibc

我正在 Ubuntu 10.10(VirtualBox 中的 32 位)中编译 glibc-2.12.1。 步骤如下:

  1. 配置 --prefix=/usr --disable-asm
  2. 制作

[我正在从新目录构建它]

我在运行 make 时遇到以下错误:

gcc ../sysdeps/i386/fpu/s_frexp.S -c -D__NO_MATH_INLINES -D__LIBC_INTERNAL_MATH_INLINES -I../include -I/home/l33thckr/Installations/glibc-build/math -I/home/l33thckr/Installations/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.  -D_LIBC_REENTRANT -include ../include/libc-symbols.h  -DPIC -DSHARED     -DASSEMBLER  -DGAS_SYNTAX  -Wa,--noexecstack  -Wa,-mtune=i686 -o /home/l33thckr/Installations/glibc-build/math/s_frexp.os -MD -MP -MF /home/l33thckr/Installations/glibc-build/math/s_frexp.os.dt -MT /home/l33thckr/Installations/glibc-build/math/s_frexp.os 
../sysdeps/i386/fpu/s_frexp.S: 
Assembler messages:
../sysdeps/i386/fpu/s_frexp.S:66: Error: invalid identifier for ".ifdef"
../sysdeps/i386/fpu/s_frexp.S:66: Error: junk at end of line, first unrecognized character is `1'
../sysdeps/i386/fpu/s_frexp.S:66: Error: junk at end of line, first unrecognized character is `1'
../sysdeps/i386/fpu/s_frexp.S:66: Error: Missing symbol name in directive
../sysdeps/i386/fpu/s_frexp.S:66: Error: junk at end of line, first unrecognized character is `1'
../sysdeps/i386/fpu/s_frexp.S:66: Error: Missing symbol name in directive
../sysdeps/i386/fpu/s_frexp.S:66: Error: junk at end of line, first unrecognized character is `.'
../sysdeps/i386/fpu/s_frexp.S:66: Error: junk at end of line, first unrecognized character is `1'
../sysdeps/i386/fpu/s_frexp.S:66: Error: expected comma after name `' in .size directive
../sysdeps/i386/fpu/s_frexp.S:66: Error: ".endif" without ".if"
../sysdeps/i386/fpu/s_frexp.S:66: Error: junk `.get_pc_thunk.dx' after expression
make[2]: *** [/home/l33thckr/Installations/glibc-build/math/s_frexp.os] Error 1
make[2]: Leaving directory `/home/l33thckr/Installations/glibc-2.12.1/math'
make[1]: *** [math/subdir_lib] Error 2
make[1]: Leaving directory `/home/l33thckr/Installations/glibc-2.12.1'
make: *** [all] Error 2

我尝试使用 --disable-asm (在configure --prefix=/usr --disable-asm 中),但它仍然给出相同的错误。

Google搜索发现这个问题已经存在很长时间了[引用:http://comments.gmane.org/gmane.comp.lib.glibc.user/758 ].

导致此错误的原因以及如何解决?

最佳答案

该问题是由 GCC 定义 __i686 引起的。您可以使用以下命令确认它实际上是这样做的:

gcc -dD -E -xc /dev/null | grep __i686

如果这个命令产生输出,那么这就是问题所在。要修复它,请使用:

configure --prefix=/usr CC='gcc -U__i686'

或者构建更新版本的 glibc。

================================================== ========================= 编辑:

其他一些有用的链接:

Awk Issue

Gawk Installation

Update software on Ubuntu

关于linux - Glibc编译错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30144210/

相关文章:

c++ - Allgro 5 'multiple definition of … first defines here …'中的定义错误

linux - rpmbuild 使用 .spec 文件删除构建目录

c++ - 套接字很少返回 -1 (errno 97)

linux - 如何在终端中搜索以某个字母结尾/开始/包含某个字母的文件?

谁能检查程序并告诉我如何获得正确的输出?

linux - 运行 make 时显示 make ** no target.stop

c++ - 将 NULL 指针访问转换为 Linux/GCC 下的 C++ 异常

c - C 中的函数指针 - 性质和用法

c++ - Microsoft Visual C++ 2010 Express - 编译错误

java - 在PHP中获取Java编译错误