Created attachment 347812 [details] sys-devel/gcc-4.2.4-r01.4 failure log GCC's build system was patched upstream to omit checks for strsignal() and psignal() on Cygwin. This causes a failure when building libiberty because libiberty will then define its own functions for strsignal() and psignal(), which are already provided by Cygwin's libc. The build fails before the linker is invoked because Cygwin's headers define incompatible prototypes. A comment included in the code that omits these checks suggests that this (somehow?) works when building Cygwin itself because one of Cygwin's components links to libiberty. Unfortunately, this makes no sense when building a standalone GCC. Removing the code in question fixes the problem.
Created attachment 347814 [details, diff] configure{,.ac} patch to fix libiberty builds This patch fixes the problem on sys-devel/gcc-4.2.4-r01.4. A similar patch is probably needed on other versions of GCC, but I have not gotten far enough in the bootstrap process to encounter that issue yet.
This hack is no longer present in the upstream repositories' GCC 4.3.x branch, so there should be no need to port this patch to other versions of GCC. Ignore my previous comment about needing a similar patch on other versions of GCC.
Cygwin (x64) support was integrated in Prefix in 2016, using something newer than gcc-4.2.