小编Kri*_*zyS的帖子

GCC:为 ARM 构建交叉编译器 - 未找到 pthread.h

使用 Ubuntu 12.04 主机,我仔细遵循此处的 SO 答案(Recipe for Compiling Binutils and GCC Together),在一棵树中构建 GCC 和 binutils 及其所有依赖项。

这是我在构建目录中执行的配置行:

    ../gcc-4.9.0/configure --target=arm-linux-gnueabi --prefix=/home/mint/cross-arm --disable-werror
Run Code Online (Sandbox Code Playgroud)

Makefile 配置正确,然后我运行:

    sudo make -j8
Run Code Online (Sandbox Code Playgroud)

我进入编译过程一段时间,最终出现错误:

    In file included from ../../../gcc-4.9.0/libgcc/gthr.h:148:0,
             from ../../../gcc-4.9.0/libgcc/libgcov-interface.c:27:
./gthr-default.h:35:21: fatal error: pthread.h: No such file or directory
#include <pthread.h>
                 ^
compilation terminated.
make[2]: *** [_gcov_flush.o] Error 1
make[2]: *** Waiting for unfinished jobs....
In file included from ../../../gcc-4.9.0/libgcc/gthr.h:148:0,
             from ../../../gcc-4.9.0/libgcc/libgcov-interface.c:27:
./gthr-default.h:35:21: fatal error: pthread.h: No such file or directory
#include <pthread.h>
                 ^ …
Run Code Online (Sandbox Code Playgroud)

gcc gnu pthreads cross-compiling

5
推荐指数
1
解决办法
1万
查看次数

标签 统计

cross-compiling ×1

gcc ×1

gnu ×1

pthreads ×1