我正试图在Windows上的Cygwin下构建一个跨编译器工具链,这样我(或者说是我正在帮助的人--我会使用Linux,但Windows对许多人来说要容易得多)可以编译针对MIPS体系结构的源代码。
我有一个脚本,它使用以下代码成功地在Linux上x86_64下为MIPS构建了一个跨编译器工具链:
https://github.com/UoMCS/mips-cross-compile/tree/glibc
但是,当我在Cygwin下运行脚本时,它在glibc install-headers阶段失败,有以下错误:
gcc -D_RPC_THREAD_SAFE_ -D_GNU_SOURCE -DIS_IN_build -include /home/Cygwin/xc/mips-linux/tmp/build-glibc/config.h rpc_main.c \
-o /home/Cygwin/xc/mips-linux/tmp/build-glibc/sunrpc/cross-rpc_main.o -MMD -MP -MF /home/Cygwin/xc/mips-linux/tmp/build-glibc/sunrpc/cross-rpc_main.o.dt -MT /home/Cygwin/xc/mips-linux/tmp/build-glibc/sunrpc/cross-rpc_main.o -c
rpc_main.c: In function ‘find_cpp’:
rpc_main.c:329:17: error: storage size of ‘buf’ isn’t known
struct stat64 buf;
^
rpc_main.c: In function ‘checkfiles’:
rpc_main.c:1117:17: error: storage size of ‘buf’ isn’t known
struct stat64 buf;
^
Makefile:163: recipe for target '/home/Cygwin/xc/mips-linux/tmp/build-glibc/sunrpc/cross-rpc_main.o' failed
make[2]: *** [/home/Cygwin/xc/mips-linux/tmp/build-glibc/sunrpc/cross-rpc_main.o] Error 1
make[2]: Leaving directory '/home/Cygwin/xc/mips-linux/tmp/glibc-2.21/sunrpc'
Makefile:213: recipe for target 'sunrpc/install-headers' failed
make[1]: *** [sunrpc/install-headers] Error 2
make[1]: Leaving directory '/home/Cygwin/xc/mips-linux/tmp/glibc-2.21'
Makefile:9: recipe for target 'install-headers' failed
make: *** [install-headers] Error 2我不知道为什么在Cygwin而不是Linux下会出现这个错误,因为binutils、GCC、glibc和内核的源文件是相同的(都是由构建脚本自动下载的)。通过搜索相同的错误消息,我找不到任何有用的提示。有人能提出什么可能的问题吗?
我在主机环境中使用了以下软件:
发布于 2015-05-27 13:30:18
正如在Cygwin's 常见问题上解释的那样。Cygwin不使用stat64。可以尝试用stat64手动替换stat,也可以用定义代替。
https://stackoverflow.com/questions/30482702
复制相似问题