building gmp with MSYS and MinGW for VC++

Kevin Ryde user42 at
Fri May 7 02:55:12 CEST 2004

Sisyphus <kalinabears at> writes:
> I know I didn't specify that option when I built 4.1.2 - and wouldn't
> that affect *all* of GMP ?

Well, what it sounds like is you used malloc in your 4.1.2 build and
mpfr applications, then built 4.1.3 with alloca (the default).  Hence
the mismatch trying to use the new dll with the old app.

This arises in mpfr because mpfr uses various gmp internals.  You
should use mpfr with the libgmp it was built against.  (Or rebuild.)

> I've been looking at the manual in regard to the various 'alloca'
> build options, and I find it a little confusing. The one you've given
> above is not there, afaict.

Oh, yes.

> Is 'enable-alloca=malloc' synonymous with
> 'enable-alloca=malloc-notreentrant' ?

No, malloc-reentrant actually (it's the one that ends up using

> I don't exactly know what 'reentrancy' is. I guess it has something to
> do with threads, in which case I probably don't need it.

A function (or library) is re-entered when its code is currently
executing, then either a thread switch or an interrupt occurs and a
further call to the same function (or library) is made.

malloc-notreentrant uses certain global variables, which will be badly
messed up if the code is re-entered while they're being manipulated.

> There's no simple way of querying the build options that were used, is
> there ? (I think I recall past discussions that stated there weren't.)


More information about the gmp-discuss mailing list