Created attachment 320572 [details]
Fix for gcc during prefix bootstrap on NetBSD
bootstrapping gcc 4.2 and possibly higher fails in iberty with errors in mempcpy.c. The issue is caused in ansidecl.h where PTR is not defined for NetBSD systems. Confirmed on irc #netbsd that PTR should be (int *) on x64. ryao found a patch for this which I tested and confirmed it to work. http://www.ki.nu/~makoto/diary/2009/01/19/ and I have attached the patch.
There is another failure in libstdc++. The bootstrap procedure should build a newer version of GCC before that becomes an issue.
This patch will permit sys-devel/gcc-4.2* to build on amd64 NetBSD with USE="-cxx nocxx". Without it, it will not build at all.
Also, we should either wrap the typedef with a NetBSD preprocessor conditional or do regression testing on other platforms.
We do not use gcc-4.2 any more in Prefix.