[lfs-support] GCC-4.7.1-Pass 2 MPC configure fails

Bruce Dubbs bruce.dubbs at gmail.com
Wed Sep 19 18:11:35 PDT 2012

Whitequill Riclo wrote:
> On Wed, Sep 19, 2012 at 9:35 AM, Feuerbacher, Alan <
> AFeuerbacher at allegromicro.com> wrote:
>> William Harrington wrote:
>>> Sometimes you can't build mpfr mpc and gmp within the gcc source tree
>>> for some targets. We found that out in CLFS. That's we we don't build
>>> gmp mpc and mpfr within the tree. Works okay for x86 and x86_64,
>>> however, when you start building for other targets, it becomes hairy.
>>> You may want to try to build gmp mpfr and mpc separately.
>> I've been mostly quietly keeping up with this question on several lists:
>> is it better to build those programs in the source tree or separately?
>> There's a discussion somewhere (on a gcc list?) that comes down strongly on
>> the side of building them in the source tree. It even asks why anyone would
>> want to do it differently. Yet the programs contain instructions for
>> tuning, which requires them to be built separately.
>> During the 1 1/2 years I've been playing around with compiling gcc and all
>> of the LFS programs, I've experimented with building separately many times.
>> No problem building them, but gcc usually fails to find at least one of
>> them.
>> Now, I'm a real newbie when it comes to all this, but if anyone knows why
>> gcc can't seem to find the programs, I'd sure like to know. I'm trying to
>> understand all the ins and outs of everything covered by LFS and a lot more
>> besides.
>> Alan
> I've already succeeded at building gmp, and mpc with in the gcc build
> directory, I need to make mpfr, what do you suggest I do?
> Is there a way to just build the following code block;

Needs #include <mpfr.h>

>     1. | int
>     2. | main ()
>     3. | {
>     4. | mpfr_t x;  mpfr_init(x) ; mpfr_clear(x);
>     5. |
>     6. |   ;
>     7. |   return 0;
>     8. | }
> and then re-run make?

After lfs is completed, there are the files /usr/lib/libmpfr.{a,so). 
How about:

gcc -o xyz xyz.c -lmpfr

Works for me.

$ ldd xyz
         linux-gate.so.1 (0xffffe000)
         libmpfr.so.4 => /usr/lib/libmpfr.so.4 (0xb7735000)
         libc.so.6 => /lib/libc.so.6 (0xb7584000)
         libgmp.so.10 => /usr/lib/libgmp.so.10 (0xb751f000)
         /lib/ld-linux.so.2 (0xb77a7000)

   -- Bruce

More information about the lfs-support mailing list