On Apr 6, 2007, at 4:00 PM, HP Wei wrote:
I tried to compile the new version: gambc-4.0b22.tar.gz on a Sun-Solaris machine with gcc --version 2.95.3
This is a very old version of gcc.
During compiling gsi, there are many messages like warning: implicit declaration of function `__builtin_expect'
And then at the final link step, it fails with undefined reference to `__builtin_expect'
I tried to rebuilt the old version 4.0b20 by the same processes and it succeeded.
So, there might be something missing in the package in gambc-4.0b22.tar.gz
Something was added; versions of gcc more recent than 2.95.3 (they're now up to 4.1.2) have __builtin_expect built in, as it were, and Marc is using it in beta 22, but it appears that gambit.h checks only whether gcc is being used as the compiler, not whether a very old version of gcc is being used.
Try to change one line in include/gambit.h to be
[descartes:~/programs/gambc-4.0b22/include] lucier% rcsdiff gambit.h =================================================================== RCS file: RCS/gambit.h,v retrieving revision 1.1 diff -r1.1 gambit.h 1354c1354 < #ifdef __GNUC__ ---
#if __GNUC__ >= 3
Brad Lucier