aboutsummaryrefslogtreecommitdiff
path: root/libgo/runtime/go-main.c
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>2019-05-11 01:12:37 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2019-05-11 01:12:37 +0000
commitc130ab6aad57e0309ec02f58f383aece584ac8cb (patch)
tree0a5fd2bf4f6ad9b59a03ff33d2758937064fc015 /libgo/runtime/go-main.c
parentd7b9b0805d5ab514c43e1fe57e43a10394d5d965 (diff)
downloadgcc-c130ab6aad57e0309ec02f58f383aece584ac8cb.zip
gcc-c130ab6aad57e0309ec02f58f383aece584ac8cb.tar.gz
gcc-c130ab6aad57e0309ec02f58f383aece584ac8cb.tar.bz2
runtime: set up g early
runtime.throw needs a g to work properly. Set up g early, to ensure that if something goes wrong in the runtime startup (e.g. runtime.check fails), the program terminates in a reasonable way. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/176657 From-SVN: r271088
Diffstat (limited to 'libgo/runtime/go-main.c')
-rw-r--r--libgo/runtime/go-main.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/libgo/runtime/go-main.c b/libgo/runtime/go-main.c
index 301ac4e..e9da8ac 100644
--- a/libgo/runtime/go-main.c
+++ b/libgo/runtime/go-main.c
@@ -48,6 +48,7 @@ main (int argc, char **argv)
setIsCgo ();
__go_end = (uintptr)_end;
+ runtime_ginit ();
runtime_cpuinit ();
runtime_check ();
runtime_args (argc, (byte **) argv);