为什么我无法构建较低版本的编译器

发布于 2025-01-02 09:07:39 字数 762 浏览 4 评论 0原文

我目前正在尝试在新更新的 ubuntu 11.10 上构建 gcc 4.4。然而,在尝试引导时,构建编译器总是会失败并出现一些问题。

首先找不到crti.ocrtn.o。我将它们符号链接到搜索路径中的另一个目录,这样我就可以获得引导编译器。但是现在它失败并显示消息:

configure:错误:C 编译器无法创建可执行文件

我尝试在一个简单的测试程序上使用中间编译器,然后收到消息:

$ ./host-x86_64-unknown-linux-gnu/prev-gcc/xgcc test.c
xgcc: error trying to exec 'cc1': execvp: File or directory not found

So things is后方严重混乱看起来我的中间编译器的路径。当我在 ubuntu 11.04 上做同样的事情时,一切都工作正常。

我使用以下命令行进行配置:

./configure --prefix=/opt --program-suffix=44

我还尝试了 VPATH 构建以及源代码构建,但两者都有相同的问题。我仍然在 /opt 中保留了更新之前的 gcc44,但自更新以来它已变得无法使用。

有没有什么简单的方法可以让 gcc 4.4 在 Ubuntu 11.10 下工作?我不必是一个自建编译器,如果我可以下载一个包并安装它,那就好了。

I am currently trying to build a gcc 4.4 on a newly updated ubuntu 11.10. However building the compiler always fails with some problems, when trying to bootstrap.

First crti.o and crtn.o could not be found. I symlinked them into another directory within the search path, and so I could get a bootstrap compiler. However now it fails with the message:

configure: error: C compiler cannot create executables

I tried out to use the intermediate compiler on a simple test program, and I get the message:

$ ./host-x86_64-unknown-linux-gnu/prev-gcc/xgcc test.c
xgcc: error trying to exec 'cc1': execvp: File or directory not found

So something is seriously messed up with the paths of my intermediate compiler it seems. When I did the same thing on ubuntu 11.04 everything just worked fine.

I used the following command line to configure:

./configure --prefix=/opt --program-suffix=44

I also tried both a VPATH-built, as well as an in source build, but both have the same problem. I still have the gcc44 from before the update lying around within /opt, but it has become unusable since the update.

Is there any easy way to get gcc 4.4 working under Ubuntu 11.10? I does not have to be a self build compiler, if I can just download a package and install that, it would be fine as well.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

无人接听 2025-01-09 09:07:39

这是由于 Ubuntu 切换到多架构造成的。基本上所有“标准”路径都已更改,因此您可以在同一台计算机上安装多个体系结构的库,而不会发生任何冲突。

当然,Ubuntu GCC 已经打了补丁来解决这个问题,但我上次检查时上游编译器仍然没有修复。

请参阅此处:https://askubuntu.com/questions/69365 /自从升级到11-10以来就无法再构建gcc

This is caused by Ubuntu's switch to multi-arch. Basically all the "standard" paths have been changed so you can install libraries for multiple architectures on the same machine without any clashes.

Ubuntu GCC has been patched to fix the problem, of course, but the upstream compiler still wasn't fixed last time I checked.

See here: https://askubuntu.com/questions/69365/cant-build-gcc-anymore-since-upgrade-to-11-10

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文