Aside from a straightforward rebase, this contains an out-of-tree patch from MaskRay which adds the `-Bsymbolic-non-weak-functions` flag to ld.