错误编译uClibc(__ NR_or1k_atomic未声明)

时间:2014-07-07 04:56:30

标签: gcc

我正在关注http://openrisc.net/toolchain-build.html为openrisc或32构建gcc工具链。 我正在手工制作'流了,过去了 binutils的
第1阶段gcc
安装linux标头
并且要做的是编译uClibc'它由以下命令组成。

$ git clone git://openrisc.net/jonas/uClibc  
$ cd uClibc  
$ make ARCH=or32 defconfig  
$ make PREFIX=${SYSROOT}  
$ make PREFIX=${SYSROOT} install  <br>

当我运行ARCH = or32 defconfig&#39;时,我收到此错误。

CC libpthread/linuxthreads.old/attr.o  
In file included from libpthread/linuxthreads.old/internals.h:30:0,  
             from libpthread/linuxthreads.old/attr.c:26:  
./libpthread/linuxthreads.old/sysdeps/or32/pt-machine.h: In function 'testandset':  
./libpthread/linuxthreads.old/sysdeps/or32/pt-machine.h:41:8: error: '__NR_or1k_atomic' undeclared (first use in this function)  
./libpthread/linuxthreads.old/sysdeps/or32/pt-machine.h:41:8: note: each undeclared identifier is reported only once for each function it appears in  
In file included from libpthread/linuxthreads.old/../linuxthreads.old_db/proc_service.h:20:0,  
                 from libpthread/linuxthreads.old/../linuxthreads.old_db/thread_dbP.h:9,  
                 from libpthread/linuxthreads.old/internals.h:32,  
                 from libpthread/linuxthreads.old/attr.c:26:  
./include/sys/procfs.h: At top level:  
./include/sys/procfs.h:32:21: fatal error: asm/elf.h: No such file or directory  
compilation terminated.  
make: *** [libpthread/linuxthreads.old/attr.o] Error 1  

有没有人有同样的问题?我使用的是CentOS 6.4。

1 个答案:

答案 0 :(得分:0)

gcc按顺序

搜索系统中的头文件
/usr/local/include  
libdir/gcc/target/version/include    (libdir was /usr/lib in my case)  
/usr/target/include  
/usr/include

我的系统在/ usr / include下有sys / syscall.h,以便在使用uClib / include下的sys / syscall时使用该文件。所以我添加了-nostdinc,以便gcc不搜索标准的include路径。现在变成了 make PREFIX = $ {SYSROOT} -nostdinc
它有效!
以下命令也被修改了
make PREFIX = $ {SYSROOT} -nostdinc install

干杯!