构建交叉编译器 – 错误:找不到libmpfr

我正在尝试构建一个交叉编译器。 我按照本教程: http : //wiki.osdev.org/GCC_Cross-Compiler

我在/ opt / cross中安装了binutils。 现在我尝试用mpfr-2.4.2安装gcc-4.7.4。 我使用命令来准备和配置:

export PREFIX="$HOME/opt/cross" export TARGET=i686-elf export PATH="$PREFIX/bin:$PATH" mv gmp-4.3.2 gcc-4.7.4/gmp mv mpfr-2.4.2 gcc-4.7.4/mpfr mv mpc-0.8.1 gcc-4.7.4/mpc # i am in usr/src directory mkdir build-gcc cd build-gcc ../gcc-4.7.4/configure --target=$TARGET --prefix="$PREFIX" --disable-nls --enable-languages=c,c++ --without-headers 

现在,我使用make all-gcc来构建,但是我收到以下错误: configure: error: libmpfr not found or uses a different ABI (including static vs shared).

为什么会发生这种情况以及如何解决这个问题?

谢谢!

您可以检查“配置”检查如果libmpfr可用(configure在哪里查找)或者仅提供libmpfr的路径 – 可能是–enable-libmpfr = / path /或类似的东西。

第二个选项是给gcc配置选项禁用mpfr( – disable-mpfr?)

我假设你正在尝试为你的主机编译另一个架构的gcc。 也许gcc configure发现了libmpfr,但它是你主机的mpfr而不是目标架构? 您可以查看config.log文件(如果有)并通过configure检查哪个mpfr正在使用。

您是否尝试使用export LD_LIBRARY_PATH =。/ gcc-4.7.4 / mpfr / .libs链接库