问题前的基本步骤:
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,其中包含了我需要的实际内容,如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}
的值是多少?请编辑问题以改进它。 - Basile Starynkevitch