Hey hey, even after my recent hardware upgrade I still notice issues compiling big AUR packages from github, like aws-sdk-cpp-git or mysql. This does not happen when cloning the git repository without AUR and compile using the package's build system.
I notice that the AUR compile seems to go quicker. I know that I had the make option -j 4 turned on a while ago, but switched it off again.
The thing that happens is for the AUR build process to swap massive amounts of data, grinding the system almost to a halt and finally failing without much of a reason. Nothing typically source code or linkage related.
My system has 4GB of RAM and 4GB of swap, with a swapiness of 10.