Prof Abimbola Olowofoyeku wrote:
By default the libm.a library is include in the ld command line so I disable it, since the library is not provided.
Modifiction of gpc.c :
<< #define MATH_LIBRARY "-lm"
--
//#define MATH_LIBRARY "-lm"
#define MATH_LIBRARY ""
AFAIR, the same holds for MS-Windows (at least Mingw, not sure about CygWin). I think the setting of MATH_LIBRARY in ../config/i386/mingw32.h makes sure that -lm is not linked there without haveing to change gpc.c. The same should be possible for Mac OS X, I guess, in the appropriate config file. If you find it, you can send us that change, so we can include it...
An empty MATH_LIBRARY used to cause no end of problems when compiling GPC for Mingw (I remember having to edit gpc.c manually to make sure that (the empty Mingw) libm.a was linked). This problem has since disappeared, although I cannot remember how we dealt with it!
Well, as I said ../config/i386/mingw32.h contains mingw32.h:#define MATH_LIBRARY "" and gpc.c respects this, so unless you changed it, I'd be surprised if -lm (empty or not) is linked.
The point is that you need to watch for this under OS X as well. It may not become a problem - or it might. If it does, all you need to is create an empty libm.a.
This is, of course, a solution -- might also help compiling other sources that link -lm.
Frank