使用 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)