食物垃圾处理器前景:[原创]自己动手制作交叉编译工具链(6)
第五步 编译GCC(第二次)
需要时间大概为:1小时
配置选项
这次是编译完整的GCC,因此第一次disable的一些选项这次可以enable了。
${SOURCE_DIR}/${PACKAGE_GCC}/configure \
--build=${HOST} \
--host=${HOST} \
--target=${TARGET} \
--prefix=${RESULT_DIR} \
--with-float=soft \
--with-cpu=arm920t \
--with-tune=arm9tdmi \
--enable-languages=c,c++ \
--enable-threads=posix \
--enable-c99 \
--enable-long-long \
--enable-shared \
--enable-__cxa_atexit \
--enable-nls \
--disable-libgomp
make && make install
选项详解
-enable-languages=c,c++
This option ensures that only the C and C++ compilers are built.
--enable-__cxa_atexit
Thisoption allows use of __cxa_atexit, rather than atexit, to register C++destructors for local statics and global objects and is essential forfully standards-compliant handling of destructors. It also affects theC++ ABI and therefore results in C++ shared libraries and C++ programsthat are interoperable with other Linux distributions.
--enable-c99
Enable C99 support for C programs.
--enable-long-long
Enables long long support in the compiler.
--enable-threads=posix
This enables C++ exception handling for multi-threaded code.
--enable-nls \
--disable-libgomp
如果不加这一项会出现如下错误:
configure: error: Pthreads are required to build libgomp
make[1]: *** [configure-target-libgomp] 错误 1
make[1]:正在离开目录 `/home/hongwang/mktoolchain/build/gcc-4.4.0-2'
make: *** [all] 错误 2
没有找到好的解决办法,只能在configure里增加 --disable-libgomp