Status update: mini-gmp

Torbjorn Granlund tg at
Thu Feb 16 12:11:19 CET 2012

nisse at (Niels Möller) writes:

  After copying the mini-gmp directory, I can build gmp with the attached
  patch. For the functions in dumbmp.c:

  * Most aren't needed any more.
  * Functions used in only one file are copied to that file.
  * The remaining few functions are moved to a new file, named
    mini-gmp-extra.c, at the gmp top-level.
Perhaps a better name would be bootstrap.c?

  Functions which get by with just mini-gmp include mini-gmp/mini-gmp.c,
  the rest instead include mini-gmp-extra.c.
I suppose that's not a truly necessary tweak.  Using the strategy of
including bootstrap.c/mini-gmp-extra.c in all files might be a bit

  I did some other minor changes to the files: Use assert rather than
  ASSERT. Use memmove rather than mem_copyi. Deleted casts of the return
  value from xmalloc, instead expecting the return value to be of type
  void *. In mini-gmp-extra.c, I defined xmalloc as an alias for
  gmp_default_xalloc, an internal function in mini-gmp.c, rather than
  including yet another copy of the same thing.

  I'm not sure how to best do the automakery to get mini-gmp included in
  the gmp distribution. Is it good enough to just add the mini-gmp
  directory to EXTRA_DIST? Or do we need a list or glob pattern for the
  wanted files somewhere?

I don't recall, I do this to seldomly, please make some experiments.

  > From GMP's perspective, I don't think mini-gmp unit testing should be
  > necessary.
  I see. But it would be nice with a top-level make targat check-mini-gmp,
  to build and test mini-gmp with the same configuration (compiler,
  builddir, etc) as set up for gmp.
Makes sense.


More information about the gmp-devel mailing list