【问题标题】:GCC downgrade problemsGCC 降级问题
【发布时间】:2012-05-27 18:21:03
【问题描述】:

我正在尝试从 Cyclone 编程语言的源编译器构建。我正在运行 32 位 Ubuntu 12.04,默认安装 GCC 4.6.3。

但是由于引导实用程序崩溃,make 失败。为了解决这个问题,我正在尝试安装较旧的 GCC 版本。

我已经修补了 /etc/apt/sources.list 并使用 apt-get 安装了 gcc-3.3 和 g++-3.3。但是配置脚本在强制使用 GCC 3.3 时会失败:

$ export CC=gcc-3.3
$ export CXX=g++-3.3
$ ./configure
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking target system type... i686-pc-linux-gnu
checking for gcc... gcc-3.3
checking for C compiler default output file name... configure: error: C compiler cannot create executables
See `config.log' for more details.

而 config.log 显示:

...
/usr/bin/ld: cannot find crt1.o: No such file or directory
/usr/bin/ld: cannot find crti.o: No such file or directory
/usr/bin/ld: cannot find -lgcc_s
...

ld的版本是2.22

【问题讨论】:

    标签: gcc ld configure downgrade cyclone


    【解决方案1】:

    正如 michel 提到的,您可以这样做来让旧的 GCC 引导:

    export LIBRARY_PATH=/usr/lib/i386-linux-gnu
    

    无论crt1.o 文件在您的系统上的哪个位置——在我的系统上,它都在/usr/lib32 中。

    然后,一旦你构建了一个工作的 GCC,你可以将crt1.ocrti.ocrtn.o 符号链接(或复制)到新构建的编译器的 ${prefix}/lib/gcc/... 目录中,你将不会使用时不需要设置LIBRARY_PATH。寻找crtstart.o 文件或类似的东西,这是放置符号链接的正确目录。

    【讨论】:

      【解决方案2】:

      我也遇到过同样的问题。 libc6-dev 软件包提供 crt1.o 文件,但它安装在 gcc 的非标准目录中。这是为了在同一主机上支持 32 位和 64 位程序。

      为了解决这个问题,我设置了以下环境变量:

      导出 LIBRARY_PATH=/usr/lib/i386-linux-gnu

      【讨论】:

        【解决方案3】:

        apt-file search crt1.o 显示哪些包包含此文件。如果它不打印任何内容,请运行一次apt-file update

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 2021-06-16
          • 1970-01-01
          • 2018-04-10
          • 1970-01-01
          • 1970-01-01
          相关资源
          最近更新 更多