我跟随http://openrisc.net/toolchain-build.html为openrisc or32构建gcc工具链。我正在做“人工建筑”流程,并通过了二进制文件
第一阶段gcc
安装linux报头
并执行“编译uClibc”,该命令由以下命令组成。
$ git clone git://openrisc.net/jonas/uClibc
$ cd uClibc
$ make ARCH=or32 defconfig
$ make PREFIX=${SYSROOT}
$ make PREFIX=${SYSROOT} install <br>当我运行'make ARCH=or32 defconfig‘时,我会得到这个错误。
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。
发布于 2014-07-08 01:03:27
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就不会搜索标准的包含路径。现在它变成了
使PREFIX=${SYSROOT} -nostdinc
而且起作用了!
还修改了以下命令
使PREFIX=${SYSROOT} -nostdinc安装
干杯!
https://stackoverflow.com/questions/24603275
复制相似问题