Hi. You know, gmp/mpfr/mpc are a significant portion of building any frontend/backend.
So I looked at it. mpc of course is only for complex numbers. Our frontend doesn't use them. Maybe only for "builtins" as well. #define do_mpc_arg1(a, b, c) NULL_TREE and such. mpfr appears to be used for floating point builtins. Not for floating point constant folding as I'd thought? We generate very few builtins, just memcmp, memset, memmove, memcpy, and *sync*. Either way, floating point doesn't matter to me much. #define do_mpfr_arg1(a,b,c) NULL_TREE and such. including something_logarithm, something_exponent. And #if out the version report in toplev.c. And the then unused conversions in real.c. and the #include in real.h. and then mpfr isn't needed. That is: changes to gcc to eliminate mpc and mpfr dependencies are pretty darn small. I used #if 1/#if 0, but it'd be easy enough to have configure -without-mpc -without-mpfr. I was able to do this for 4.5, and then 4.3 was trivial, the same except no mpc. And then, if you dig a bit more, you find that gmp contains "n", "q" (rational), "z", "f" (float), and miscellaneous e.g. *rand*. (apples and oranges: *rand* must operate on some mp type, of course) None of "q" and "f" are needed, and vast swaths of "n" and "z" are unused and can be deleted. Easier to truncate the files first when experimenting. Probably can do even better. There is a file in GMP dumbmp.c (as in dump, stupid) that contains a simple portable subset of GMP, used for some "generator" programs. First glance says it isn't sufficient, but it might be close.. The result is a lot faster to build, if you are just doing a just a single stage build of a compiler. To some extent it adds up -- multiple stages. To some extent it is is minor -- if you are building libstdc++/libada/libjava x multilibs. I build just a frontend/backend though. I understand you can also build/install the libraries once. That isn't a terrible option. I have operated that away. But does have drawbacks. It is harder for Canadian cross and "cross back" (cross build a native compiler), which admittedly, I don't do much. There were problems last I tried, esp. with enable-shared and fixincludes, and it always a pain to get the C runtime headers/libraries. The first I opened bugs for. The second can't really be fixed, except e.g. with an integrated tree with glibc/newlib. Maybe some people have scripts out there to scp the appropriate files. I end up taking way more than necessary and sometimes hunting around for what I missed. and gmp doesn't build with default gcc 4.0 on Intel MacOSX 10.5. Building within the gcc tree is one workaround, because how it fiddles with CFLAGS and seemingly accidentally avoids the problems with "inline". Granted, CC=gcc-4.2 is another easy one. Other options. Anyway. - Jay