This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: gmp/mpfr - build, host, or target?


On 2/16/08, Brian Dessent <brian@dessent.net> wrote:
> NightStrike wrote:
>
> > GCC needs GMP And MPFR.  What does it need it for, though?  Is it used
> > for the build machine, host machine, target machine, or some
> > combination thereof?  Also, is it needed for all languages?
>
> They are host libraries and are used to do constant folding and
> simplification (and whatever other misc optimizations) in a
> host-independent manner.  That is, gcc must uphold the notion that the
> code generated for a given input and a given target should be identical
> no matter whether the compiler is native or a cross, and no matter what
> the host of the cross is.  Without using these libraries to do those
> simplifications, the results might vary based on differences in host
> architecture or host precision or host libm bugs or whatnot.  They are
> needed for gfortran only in 4.2, but for all languages in 4.3.

The gcc build system, when building gmp and mpfr in the gcc source
tree, will send a --target option to the configure script of gmp and
mpfr.  If gmp is only used for the host system, why is this?  I
checked the GMP manual, and I don't think target even applies:

[Begin quote] "Note that the `--target' option is not appropriate for
GMP. It's for use when building compiler tools, with `--host' being
where they will run, and `--target' what they'll produce code for.
Ordinary programs or libraries like GMP are only interested in the
`--host' part, being where they'll run. (Some past versions of GMP
used `--target' incorrectly.)" [End quote]

So why does the gcc configure script supply a --target option to
configure for mpfr and gmp?


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]