runtime: move osinit to Go

This is a step toward updating libgo to 1.13.  This adds the 1.13
version of the osinit function to Go code, and removes the
corresponding code from the C runtime.  This should simplify future updates.
Some additional 1.13 code was brought in to simplify this change.

Change-Id: I7cb17ad89f62dec0342a3b98daac3045e473b7b3
Reviewed-by: Than McIntosh <>
Reviewed-by: Cherry Zhang <>
29 files changed