Everything was going so well...

I'm trying to build gcc-4.7.2, following the instructions in the LFS book. When I run make, I get the following:

checking for MPFR... no
configure: error: libmpfr not found or uses a different ABI (including static vs shared).
make[1]: *** [configure-mpc] Error 1
make[1]: Leaving directory `/mnt/lfs/sources/gcc-4.7.2'
make: *** [all] Error 2

My question is this: wut?

(If you require further info, please ask in the comments.)

  • Is the issue that you don't understand this at all, or that you think you have an appropriate libmpfr available but it still isn't working? – goldilocks Dec 30 '12 at 18:35
  • @goldilocks The former. I don't understand at all. – Korgan Rivera Dec 30 '12 at 18:36
  • Okay -- so looking here: linuxfromscratch.org/lfs/view/stable/chapter05/gcc-pass1.html You need to unpack source for mpfr and a few other things into the top level of the GCC source directory and rename them. Did you do that stuff? Also, I would stick with exact versions with LFS, which appears to be 4.7.1 not 4.7.2 – goldilocks Dec 30 '12 at 18:48

I found a fix for this. If you're having the same problem, try this. Before configuring, try this in your gcc folder:



Probably you don't have libmpfr installed run ldconfig -v|grep -i mpfr you should see a entry if not then

  1. Its not installed on your system
  2. ldconfig doesn't know how to find it

In the case of 1 then install it, if you are using a distro based on rpm then you might have yum

yum search mpfr or yum whatprovides libmpfr*
yum install mpfr

In the case of 2 then you should either export the path of LD_CONFIG_PATH to include the path where the library is installed or add a new conf file under /etc/ld.conf.so.d/mpfr.conf and put inside the path where the library is.

Regarding the message or uses a different ABI then I advice you to look into this stackoverflow link: https://stackoverflow.com/questions/2801938/gcc-abi-compatibility

  • 1
    This is mostly not applicable to the LFS scenario. – goldilocks Dec 30 '12 at 18:47
  • Also, it would be the libmpfr-devel package (headers) that's missing. To explain further about "not applicable": while installing that in the LFS host environment will work, you then risk having stuff missing in the target environment later. In this case, probably not, but methinks Korgan is still best to follow the LFS procedure to the letter. – goldilocks Dec 30 '12 at 19:02
  • @goldilocks That's the problem. There are all kinds of errata in the book. I'm guessing my way through some of it. Anyway, I found a fix here: stackoverflow.com/questions/9297933/… – Korgan Rivera Dec 30 '12 at 19:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.