LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 3269|回复: 12

求助:编译glibc-2.6.1出错

[复制链接]
发表于 2007-9-14 19:22:19 | 显示全部楼层 |阅读模式
在FC6上创建交叉编译环境,binutils-2.17.50.0.18    gcc-4.2.1   linux-2.6.22.6  glibc-2.6.1
前面都没出现什么问题,就是到glibc ,出错了,网上搜了一整天也没找到答案,恳请各位指教阿

[root@localhost build-glibc]# CC=arm-linux-gcc AS=arm-linux-as LD=arm-linux-ld
[root@localhost build-glibc]# ../glibc-2.6.1/configure --host=arm-linux  --enable-add-ons --enable-shared --with-headers=$TARGET_PREFIX/include --prefix=$PREFIX/arm-linux
configure: WARNING: If you wanted to set the --build type, don't use --host.
    If a cross compiler is detected then cross compile mode will be used.
checking build system type... i686-pc-linux-gnu
checking host system type... arm-unknown-linux-gnu
checking add-on glibc-ports-2.6.1 for preconfigure fragments... am33 arm hppa m68k mips
configure: running configure fragment for add-on nptl
checking sysdep dirs... glibc-ports-2.6.1/sysdeps/arm/elf glibc-ports-2.6.1/sysdeps/unix/sysv/linux/arm/nptl glibc-ports-2.6.1/sysdeps/unix/sysv/linux/arm glibc-ports-2.6.1/sysdeps/unix/sysv/linux nptl/sysdeps/unix/sysv/linux nptl/sysdeps/pthread sysdeps/pthread sysdeps/unix/sysv/linux sysdeps/gnu sysdeps/unix/common sysdeps/unix/mman sysdeps/unix/inet glibc-ports-2.6.1/sysdeps/unix/sysv nptl/sysdeps/unix/sysv sysdeps/unix/sysv glibc-ports-2.6.1/sysdeps/unix/arm glibc-ports-2.6.1/sysdeps/unix nptl/sysdeps/unix sysdeps/unix sysdeps/posix glibc-ports-2.6.1/sysdeps/arm/fpu glibc-ports-2.6.1/sysdeps/arm/nptl glibc-ports-2.6.1/sysdeps/arm sysdeps/wordsize-32 sysdeps/ieee754/flt-32 sysdeps/ieee754/dbl-64 sysdeps/ieee754 sysdeps/generic/elf sysdeps/generic
checking for a BSD-compatible install... /usr/bin/install -c
checking whether ln -s works... yes
checking for arm-linux-gcc... arm-linux-gcc
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether arm-linux-gcc accepts -g... yes
checking for arm-linux-gcc option to accept ANSI C... none needed
checking for gcc... gcc
checking how to run the C preprocessor... arm-linux-gcc -E
checking for arm-linux-g++... no
checking for arm-linux-c++... no
checking for arm-linux-gpp... no
checking for arm-linux-aCC... no
checking for arm-linux-CC... no
checking for arm-linux-cxx... no
checking for arm-linux-cc++... no
checking for arm-linux-cl... no
checking for arm-linux-FCC... no
checking for arm-linux-KCC... no
checking for arm-linux-RCC... no
checking for arm-linux-xlC_r... no
checking for arm-linux-xlC... no
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking whether /home/wh/embedded/tools/lib/gcc/arm-linux/4.2.1/../../../../arm-linux/bin/as is GNU as... yes
checking whether /home/wh/embedded/tools/lib/gcc/arm-linux/4.2.1/../../../../arm-linux/bin/ld is GNU ld... yes
checking for /home/wh/embedded/tools/lib/gcc/arm-linux/4.2.1/../../../../arm-linux/bin/as... /home/wh/embedded/tools/lib/gcc/arm-linux/4.2.1/../../../../arm-linux/bin/as
checking version of /home/wh/embedded/tools/lib/gcc/arm-linux/4.2.1/../../../../arm-linux/bin/as... 2.17.50.0.18.20070731, ok
checking for /home/wh/embedded/tools/lib/gcc/arm-linux/4.2.1/../../../../arm-linux/bin/ld... /home/wh/embedded/tools/lib/gcc/arm-linux/4.2.1/../../../../arm-linux/bin/ld
checking version of /home/wh/embedded/tools/lib/gcc/arm-linux/4.2.1/../../../../arm-linux/bin/ld... 2.17.50.0.18.20070731, ok
checking for pwd... /bin/pwd
checking for arm-linux-gcc... (cached) arm-linux-gcc
checking version of arm-linux-gcc... 4.2.1, ok
checking for gnumake... no
checking for gmake... gmake
checking version of gmake... 3.81, ok
checking for gnumsgfmt... no
checking for gmsgfmt... no
checking for msgfmt... msgfmt
checking version of msgfmt... 0.14.6, ok
checking for makeinfo... makeinfo
checking version of makeinfo... 4.9, ok
checking for sed... sed
checking version of sed... 4.1.5, ok
checking for autoconf... autoconf
checking whether autoconf works... yes
checking whether ranlib is necessary... no
checking LD_LIBRARY_PATH variable... ok
checking whether GCC supports -static-libgcc... -static-libgcc
checking for bash... /bin/sh
checking for gawk... gawk
checking for perl... /usr/bin/perl
checking for install-info... /home/wh/embedded/tools/bin/install-info
checking for bison... /usr/bin/bison
checking for signed size_t type... no
checking for libc-friendly stddef.h... yes
checking whether we need to use -P to assemble .S files... no
checking whether .text pseudo-op must be used... yes
checking for assembler global-symbol directive... .globl
checking for .set assembler directive... yes
checking for assembler .type directive prefix... %
checking for .symver assembler directive... yes
checking for ld --version-script... yes
checking for .previous assembler directive... yes
checking for .protected and .hidden assembler directive... yes
checking whether __attribute__((visibility())) is supported... yes
checking for broken __attribute__((visibility()))... no
checking for broken __attribute__((alias()))... no
checking whether to put _rtld_local into .sdata section... no
checking for .preinit_array/.init_array/.fini_array support... yes
checking for libunwind-support in compiler... no
checking whether to link against libgcc_eh... no
checking for -z nodelete option... yes
checking for -z nodlopen option... yes
checking for -z initfirst option... yes
checking for -Bgroup option... yes
checking for libgcc_s suffix...
checking for --as-needed option... no
checking whether --noexecstack is desirable for .S files... no
checking for -z combreloc... yes
checking for -z execstack... yes
checking for -fpie... no
checking for --hash-style option... yes
checking for -fno-toplevel-reorder... yes
checking for -fstack-protector... no
checking for -fgnu89-inline... yes
checking whether cc puts quotes around section names... no
checking for assembler .weak directive... yes
checking whether CFI directives are supported... yes
checking for ld --no-whole-archive... yes
checking for gcc -fexceptions... yes
checking for __builtin_expect... yes
checking for __builtin_memset... no
checking for redirection of built-in functions... yes
checking for __thread... yes
checking for tls_model attribute... yes
checking for libgd... no
checking for is_selinux_enabled in -lselinux... no
checking for egrep... grep -E
checking for ANSI C header files... no
checking for sys/types.h... no
checking for sys/stat.h... no
checking for stdlib.h... no
checking for string.h... no
checking for memory.h... no
checking for strings.h... no
checking for inttypes.h... no
checking for stdint.h... no
checking for unistd.h... no
checking for long double... no
checking size of long double... 0
running configure fragment for glibc-ports-2.6.1/sysdeps/arm/elf
checking for ARM TLS support... yes
running configure fragment for nptl/sysdeps/pthread
checking for forced unwind support... no
configure: error: forced unwind support is required
 楼主| 发表于 2007-9-15 20:15:51 | 显示全部楼层
已解决,谢谢,原因是要 echo "libc_cv_forced_unwind=yes" > config.cache
                                                 echo "libc_cv_c_cleanup=yes" >> config.cache
                                                   echo "libc_cv_arm_tls=yes" >> config.cache
configure的问题是解决了,可是 make 又出问题了

../glibc-ports-2.6.1/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h: 在函数‘__lll_mutex_unlock_force’中:
../glibc-ports-2.6.1/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h:251: 错误:‘__NR_futex’未声明 (在此函数内第一次使用)
In file included from ../socket/sys/socket.h:35,
                 from ../include/sys/socket.h:2,
                 from ../inet/netinet/in.h:24,
                 from ../include/netinet/in.h:3,
                 from ../resolv/resolv.h:57,
                 from ../include/resolv.h:12,
                 from ../nptl/descr.h:39,
                 from ../glibc-ports-2.6.1/sysdeps/arm/nptl/tls.h:63,
                 from ../include/tls.h:6,
                 from <stdin>:2:
../sysdeps/unix/sysv/linux/bits/socket.h:311:24: error: asm/socket.h: 没有那个文件或目录
make[2]: *** [/home/wh/embedded/build-tools/build-glibc/tcb-offsets.h] 错误 1
make[2]: Leaving directory `/home/wh/embedded/build-tools/glibc-2.6.1/csu'
make[1]: *** [csu/subdir_lib] 错误 2
make[1]: Leaving directory `/home/wh/embedded/build-tools/glibc-2.6.1'
make: *** [all] 错误 2

恳请各位指教阿
回复 支持 反对

使用道具 举报

发表于 2007-9-15 23:16:01 | 显示全部楼层
如果楼主是用直接拷贝的方法安装的kernel headers,确信拷贝了全部所需的文件己目录?
回复 支持 反对

使用道具 举报

发表于 2007-9-16 10:33:01 | 显示全部楼层
那你就找一找整个源代码目录里有没有,有的话做个链接过去.
回复 支持 反对

使用道具 举报

 楼主| 发表于 2007-9-17 08:36:30 | 显示全部楼层
谢谢楼上的两位,呵呵,应该是这个原因,我试试看
回复 支持 反对

使用道具 举报

 楼主| 发表于 2007-9-18 10:51:04 | 显示全部楼层
把 asm下的 链接过去了,不会出现找不到文件或目录的 问题了,不过make 时,又出现了下面的问题,我 查找了../csu/libc-tls.c:191里面就没有__ARM_NR_set_tls函数的出现
网上查也查不出来,步步艰难阿
./libio -I. -nostdinc -isystem /home/wh/embedded/tools/lib/gcc/arm-linux/4.2.1/include -isystem /home/wh/embedded/tools/arm-linux/include -D_LIBC_REENTRANT -include ../include/libc-symbols.h -DHAVE_INITFINI -o /home/wh/embedded/build-tools/build-glibc/csu/libc-tls.o -MD -MP -MF /home/wh/embedded/build-tools/build-glibc/csu/libc-tls.o.dt -MT /home/wh/embedded/build-tools/build-glibc/csu/libc-tls.o
In file included from ../glibc-ports-2.6.1/sysdeps/arm/libc-tls.c:20:
../csu/libc-tls.c: 在函数‘__libc_setup_tls’中:
../csu/libc-tls.c:191: 错误:‘__ARM_NR_set_tls’未声明 (在此函数内第一次使用)
../csu/libc-tls.c:191: 错误:(即使在一个函数内多次出现,每个未声明的标识符在其
../csu/libc-tls.c:191: 错误:所在的函数内也只报告一次。)
make[2]: *** [/home/wh/embedded/build-tools/build-glibc/csu/libc-tls.o] 错误 1
make[2]: Leaving directory `/home/wh/embedded/build-tools/glibc-2.6.1/csu'
make[1]: *** [csu/subdir_lib] 错误 2
make[1]: Leaving directory `/home/wh/embedded/build-tools/glibc-2.6.1'
make: *** [all] 错误 2
回复 支持 反对

使用道具 举报

发表于 2007-9-18 12:58:54 | 显示全部楼层
楼主拷的 asm 目录是 asm-arm 么?另外把它放到哪个位置了
回复 支持 反对

使用道具 举报

 楼主| 发表于 2007-9-18 15:20:09 | 显示全部楼层
是的 ,把它放到../tools/arm-linux/include下 了 ,链接的是asm-generic,同样也在这个目录下
回复 支持 反对

使用道具 举报

发表于 2007-9-18 21:56:05 | 显示全部楼层
还是帖具体的操作命令吧,这样有点说不清。
楼主把下面命令的结果帖出来

  1. cd ../tools/arm-linux/include
  2. ls
  3. grep -R __ARM_NR_set_tls *
复制代码
回复 支持 反对

使用道具 举报

 楼主| 发表于 2007-9-19 10:36:05 | 显示全部楼层
谢谢 fish ,问题已解决,还是连接问题。呵呵,还是谢谢大家的帮助与支持
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表