1

我正在尝试在 opensolaris 2009.6 上编译 gcc 4.4.0

目前在盒子里(这是一台 AMD 64 位机器),我安装了 gcc 3.4.6。

我解压了 gcc 4.4.0 tarball。

我设置了以下环境变量:

export CXX=/usr/local/bin/g++
export CC=/usr/local/bin/gcc

然后我运行“configure && make”,这是我得到的错误消息:

checking for i386-pc-solaris2.11-gcc... /export/home/me/wd/gcc/gcc-4.4.0/host-i386-pc-solaris2.11/gcc/xgcc -B/export/home/me/wd/gcc/gcc-4.4.0/host-i386-pc-solaris2.11/gcc/ -B/usr/local/i386-pc-solaris2.11/bin/ -B/usr/local/i386-pc-solaris2.11/lib/ -isystem /usr/local/i386-pc-solaris2.11/include -isystem /usr/local/i386-pc-solaris2.11/sys-include  -m64
checking for suffix of object files... configure: error: in `/export/home/me/wd/gcc/gcc-4.4.0/i386-pc-solaris2.11/amd64/libgcc':
configure: error: cannot compute suffix of object files: cannot compile
See `config.log' for more details.

有人对如何解决此错误消息有任何建议吗?

/Edit:config.log 的内容发布在此处:链接文本

4

2 回答 2

2

通常,GCC 构建是自举的,即首先它使用系统编译器来构建 GCC C 编译器,然后它使用新构建的编译器再次重新编译 GCC(然后再一次)。配置行显示它不是系统编译器,而是已经构建的 GCC 编译器,用于在那里进行配置测试。

由于它失败了,问题是新构建的 GCC 在这里以某种方式“死产”。如果 config.log 对您没有帮助,我建议您向 gcc-help@gcc.gnu.org 提问。

编辑:啊哈,我认为是汇编程序。您正在使用 GNU 汇编程序,但不受支持的选项看起来像是为 Sun 汇编程序设计的。这应该通过添加--with-gnu-as配置选项来解决(然后可能必须明确指定其路径--with-as=/usr/gnu/bin/as

您还可以查看特定于 Solaris 的 GCC 构建说明

于 2009-06-13T22:39:38.507 回答
1

gcc4 有一个现成的版本,您可以尝试更新它。它的当前版本是 4.3.3。首先,pkg-get从 OpenCSW 安装并从 subversion 存储库中检查构建:

svn co https://gar.svn.sourceforge.net/svnroot/gar/csw/mgar/pkg/gcc4/trunk/ gcc4
cd gcc4
gmake package
于 2009-06-17T07:14:46.577 回答