[Nestedvm] building nestedvm with gcc 4.x
Simmons, Aaron
asimmons at rosettastone.com
Thu May 6 13:09:08 EDT 2010
As mentioned earlier, trying to build the C++ part of nestedvm (make cxxtest) with gcc 4.x will fail with this error:
../../gcc-3.3.6/gcc/f/com.c:11080: error: conflicting types for 'ffecom_gfrt_basictype'
../../gcc-3.3.6/gcc/f/com.h:236: error: previous declaration of 'ffecom_gfrt_basictype' was here
The workaround has been to use gcc 3.3.6, which can be painful on systems where its unavailable (newer Ubuntu or any recent Mac OS X).
However, I've figured out a workaround that allows gcc 4.x to be used. It turns out the error is coming from a bona-fide bug in the gcc 3.3.6 code: the function prototype for "ffecom_gfrt_basictype" is different in com.h than it is in com.c. (It looks like a copy-paste bug for the nearby function "ffecom_gfrt_kindtype".) Apparently old versions of gcc would let this kind of prototype mismatching slide, whereas gcc 4.x enforces it. Anyway, the fix is to simply make the prototype of "ffecom_gfrt_basictype" in com.h match the function in com.c. Then the rest of it compiles and works!
I'm attaching a patchfile that implements the fix. I think it would be a good idea to have the nestedvm build process apply this patch to gcc before it builds it. This will allow nestedvm to be used on many newer platforms. :)
Thanks,
aaron
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gcc-3.3.6.patch
Type: application/octet-stream
Size: 561 bytes
Desc: gcc-3.3.6.patch
Url : http://lists.hcoop.net/pipermail/nestedvm/attachments/20100506/f57d4c9f/attachment.obj
More information about the Nestedvm
mailing list