【问题标题】:C compiler cannot create executables when trying to build BinutilsC 编译器在尝试构建 Binutils 时无法创建可执行文件
【发布时间】:2011-02-14 21:06:36
【问题描述】:

我正在尝试从头开始构建 Linux,现在我在 chapter 5.4,它告诉我如何构建 Binutils。我有 binutils 2.20 的源代码,但是当我尝试构建它时:

time { ./binutils-2.20/configure --target=$LFS_TGT --prefix=/tools --disable-nls --disable-werror ; }

它给了我一个错误:

checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking target system type... i686-lfs-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether ln works... yes
checking whether ln -s works... yes
checking for a sed that does not truncate output... /bin/sed
checking for gawk... gawk
checking for gcc... GCC
checking for C compiler default output file name... 
configure: error: in `/media/LFS':
configure: error: C compiler cannot create executables
See `config.log' for more details.

您可以在 pastebin.com 上查看我的 config.log:http://pastebin.com/hX7v5KLn

我刚刚安装了 Ubuntu 10.04,并重新安装了 GCC 并安装了 G++。此外,构建是由名为 'lfs' 的非 root、非管理员用户(在 Linux From Scratch 中也有描述)完成的,并且位于与系统安装位置不同的分区上。

谁能帮助我?谢谢

【问题讨论】:

  • 如果从命令行编译一个简单的 c 程序会发生什么?

标签: c compilation configure binutils linux-from-scratch


【解决方案1】:

试试:

export CC=/usr/bin/gcc

在运行配置之前。

【讨论】:

  • 嗯,问题是configure脚本试图使用GCC作为编译器,但编译器实际上调用的是gcc
  • 也许,但不太可能。您首先需要找出配置脚本尝试使用“GCC”的原因。我怀疑你的构建环境很糟糕。
【解决方案2】:

/tools 目录不存在。我创建了它,现在可以正常编译了。

【讨论】:

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