未知类型名称 __locale_(在为 powerpc 构建 gcc 时)
unknown type name __locale_ ( while building gcc for powerpc)
我正在尝试使用交叉编译为 powerpc 构建 gcc 4.3-74。我使用以下配置命令来配置生成文件。
./configure --build=i686-pc-linux-gnu --target=powerpc-linux
--host=powerpc-linux --with-gmp=/xxx/include --with-gmp-include=/xxx/include --with-gmp-lib=/xxx/lib
配置已成功完成,但是当我进行 make 时,它失败并显示以下消息
In file included from ../.././libiberty/floatformat.c:31:0:
/usr/include/string.h:548:5: error: unknown type name ‘__locale_t’
__locale_t __loc)
^
/usr/include/string.h:552:18: error: unknown type name ‘__locale_t’
它似乎没有为 powerpc 获取正确的头文件。
当我在没有选项 --host=powerpc-linux 的情况下进行配置时,我在构建 binutils 时遇到了类似的问题。一旦我在配置中使用选项 --host=powerpc-linux ,同样的错误在 binutils 的情况下就消失了。
在我的例子中,它使用了一些非常旧的编译器进行编译。这个旧的编译器在我的用户配置文件中被设置为 PATH 变量。因此,当我执行 gcc 时,它正在执行旧的,导致了这个错误。
我删除了用户配置文件中的 PATH 设置。现在我运行 gcc时,它正在执行最新的gcc。现在问题已经解决了。
我正在尝试使用交叉编译为 powerpc 构建 gcc 4.3-74。我使用以下配置命令来配置生成文件。
./configure --build=i686-pc-linux-gnu --target=powerpc-linux --host=powerpc-linux --with-gmp=/xxx/include --with-gmp-include=/xxx/include --with-gmp-lib=/xxx/lib
配置已成功完成,但是当我进行 make 时,它失败并显示以下消息
In file included from ../.././libiberty/floatformat.c:31:0:
/usr/include/string.h:548:5: error: unknown type name ‘__locale_t’
__locale_t __loc)
^
/usr/include/string.h:552:18: error: unknown type name ‘__locale_t’
它似乎没有为 powerpc 获取正确的头文件。
当我在没有选项 --host=powerpc-linux 的情况下进行配置时,我在构建 binutils 时遇到了类似的问题。一旦我在配置中使用选项 --host=powerpc-linux ,同样的错误在 binutils 的情况下就消失了。
在我的例子中,它使用了一些非常旧的编译器进行编译。这个旧的编译器在我的用户配置文件中被设置为 PATH 变量。因此,当我执行 gcc 时,它正在执行旧的,导致了这个错误。
我删除了用户配置文件中的 PATH 设置。现在我运行 gcc时,它正在执行最新的gcc。现在问题已经解决了。