Miscellaneous 64bit fixes

This patchset contains a bunch of little fixes that I found were needed when compiling for a 64-bit host.  We're not quite able to link a 64-bit rr, as some of the socketcall-using bits still have to be fixed up, but we're pretty close.

ef27a3b is mostly there so I can get it out of my local tree and there's one less thing to change when I want to try this the next time.  It also turned up the need for 0cce2b2.