patch to fix linker issues on Ubuntu build farm from cjwatson.