More gcc / glibc work

Another round of fixes for #758. Still not done.