Solaris fixes 1.20
Cherry-pick Solaris fixes from master to server-1.20-branch.
Includes all of the fixes from !126 (merged) and one from !289 (merged). (Building the 1.20 branch with meson on Solaris needs more work still, so the meson fixes aren't included yet.)
Edited by Alan Coopersmith