用于 ubuntu 的 ARM 工具链编译时出错
我正在尝试在 ubuntu 中制作 ARM 工具链。它在 http://hri.sourceforge.net/tools/arm 中指定的方式-elf-gcc.html
我收到以下错误:
Configuring for a x86_64-unknown-linux-gnu host.
Invalid configuration `x86_64-unknown-linux-gnu': machine `x86_64-unknown' not recognized
Invalid configuration `x86_64-unknown-linux-gnu': machine `x86_64-unknown' not recognized
Unrecognized host system name x86_64-unknown-linux-gnu.
有人知道这里出了什么问题吗?
I am trying to make the ARM toolchain in ubuntu. The way it is specified in http://hri.sourceforge.net/tools/arm-elf-gcc.html
I am getting the following error:
Configuring for a x86_64-unknown-linux-gnu host.
Invalid configuration `x86_64-unknown-linux-gnu': machine `x86_64-unknown' not recognized
Invalid configuration `x86_64-unknown-linux-gnu': machine `x86_64-unknown' not recognized
Unrecognized host system name x86_64-unknown-linux-gnu.
does anybody have idea whats going wrong here.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Google 搜索“无法识别机器‘x86_64-unknown’”错误消息表明,如果程序中的
config.guess
和config.sub
文件,则可能会发生这种情况您正在构建的版本太旧,无法识别 64 位 Linux 的机器类型。我希望这就是你的问题。您可以通过用更新的版本替换 GCC 源代码树中的版本来解决这个问题;您的系统的/usr/share/libtool
目录中应该有一些可以使用的工具。或者,在 32 位 Linux 安装中进行编译,或使用“--build=i686-pc-linux-gnu --host=i686-pc-linux-gnu”配置选项进行编译。这里也有副本:
http://cvs。 savannah.gnu.org/viewvc/*checkout*/config/config/config.guess
http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.sub
真正的问题是,是:为什么你要尝试构建一个那么旧的 ARM 工具链版本?您链接到的网站上的说明将引导您下载 GCC 2.95.3 版本的源代码——该版本已于近十年前发布。用海湾合作委员会的术语来说,这绝对是古老的。最新版本是4.5。它也比许多 ARM 指令集更改更早。
因此,除非您对 2.95 编译器有特殊需求,否则解决您问题的正确方法是获取更新的 GCC 版本。
另外,除非您特别想要,否则不自己编译它可能会减轻一些痛苦。预编译交叉编译器的来源有很多;因为我在 CodeSourcery 工作,所以我会推荐我们的(您可以免费下载和使用):
http://www.codesourcery.com/sgpp/lite/手臂/门户/订阅?@template=lite。如果您想要与链接到的页面上的编译器等效的东西,您可能需要“uClinux”版本。
A Google-search on the "machine `x86_64-unknown' not recognized" error message indicates that this can happen if the
config.guess
andconfig.sub
files in the program you're building are too old to recognize the machine type for 64-bit linux. I expect that's your problem. You can fix that by replacing the ones in your GCC source tree with newer versions; your system should have some in the/usr/share/libtool
directory that will work. Alternately, compile in a 32-bit Linux installation, or with "--build=i686-pc-linux-gnu --host=i686-pc-linux-gnu" configure options.There are also copies here:
http://cvs.savannah.gnu.org/viewvc/*checkout*/config/config/config.guess
http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.sub
The real question, though, is: Why you are trying to build a version of the ARM toolchain that's that old? The directions on the site you link to will lead you to download the sources for the 2.95.3 version of GCC -- which was released nearly a decade ago. In GCC terms, that's positively ancient; the latest version is 4.5. It's older than a lot of ARM instruction-set changes, too.
Thus, the right solution to your problem, unless you have some specific need for a 2.95 compiler, is to get a version of GCC that's much more recent.
Also, you'll probably save some pain by not compiling it yourself, unless you particularly want to. There are numerous sources of precompiled cross-compilers; since I work at CodeSourcery, I'll recommend ours (which you can download and use for free):
http://www.codesourcery.com/sgpp/lite/arm/portal/subscription?@template=lite. If you want something equivalent to the compiler on the page you linked to, you probably want the "uClinux" version.