It seems like we have yet another app that needs an insaneously large amount of RAM to compile (the first one was dc-gui). The root of the problem is cpuemu_6.c file. I've made a script which splits it into two smaller files, which makes compilation faster and less memory expensive. Attached is the script and a patch to the uae ebuild. It works for me (256 MB RAM), but please test it to make sure nothing is broken :)
Created attachment 26892 [details] the splitter script
Created attachment 26893 [details, diff] the patch
Thanks, works for me so I commited it.