【发布时间】:2017-11-09 05:12:12
【问题描述】:
提出问题的基本步骤:
cd linux-2.6.35.9/
make ARCH=x86 INSTALL_HDR_PATH=${PREFIX}/${TARGET} headers_install
cd ../
cd build-binutils/
sh ../binutils-2.28/configure --prefix=${PREFIX} --target=${TARGET}
make
make install
cd ../
cd build-gcc/
sh ../gcc-4.9.4/configure --prefix=${PREFIX} --target=${TARGET} --enable-languages=c,c++ --disable-multilib
make all-gcc
make install-gcc
cd ../
我遇到的问题是最终安装到 ${PREFIX}/lib/gcc/${TARGET}/4.9.4/include-fixed/limits.h 的东西似乎不正确.具体来说,构建和安装 GCC 中的“fixincludes”位需要一些名为“sys-include”的目录,该目录从未到位,如果不是,上述limits.h 不会引用相关的syslimits.h(在同一目录)。
如果我查看构建/安装序列的输出,则可以参考从组件 limitx.h、limity.h 和其他一些位构建此文件。此测试失败,它只安装 GCC 附带的“通用”limits.h(不包括对 syslimits.h 的引用,它使用 GCC 的 #include_next 指令来包含 ${PREFIX}/${TARGET}/include/ limits.h 里面有 actual 的东西,我需要像 NAME_MAX 和 PATH_MAX)。
文件中缺少的位是:
/* This administrivia gets added to the beginning of limits.h
if the system has its own version of limits.h. */
/* We use _GCC_LIMITS_H_ because we want this not to match
any macros that the system's limits.h uses for its own purposes. */
#ifndef _GCC_LIMITS_H_ /* Terminated in limity.h. */
#define _GCC_LIMITS_H_
#ifndef _LIBC_LIMITS_H_
/* Use "..." so that we find syslimits.h only in this same directory. */
#include "syslimits.h"
#endif
那么是否有一个选项我没有传递给 GCC 的配置脚本,或者我没有传递给在此步骤之前可以正确创建 sys-include 目录的东西?
[编辑]
TARGET=i686-redhat-linux(来自我们用于项目的构建服务器上的“gcc -dumpmachine”的目标三元组)
可能更有用的信息(?):这些包只是从各自的档案中提取的“wget”。我正在构建一个最新的 Ubuntu 16.04 安装,我安装了 libgmp-dev 和 libmpfr-dev 以避免必须使用编译器源代码编译它们。
【问题讨论】:
-
${TARGET}的值是多少?请编辑问题以改进它。 -
用一些附加信息更新了问题。希望有帮助!
标签: gcc cross-compiling toolchain