I've experienced the same thing while trying to build Clang on virtual Ubuntu machine. Linking allocates more than 1GB of memory, fills the swap partition and eventually fails. Adding 2GB of RAM solves the problem.