Index: gcc-8-8-20180308-1.1/src/libgo/runtime/getncpu-gnu.c =================================================================== --- /dev/null +++ gcc-8-8-20180308-1.1/src/libgo/runtime/getncpu-gnu.c @@ -0,0 +1,16 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +#include + +#include "runtime.h" +#include "defs.h" + +int32 +getproccount(void) +{ + int32 n; + n = (int32)sysconf(_SC_NPROCESSORS_ONLN); + return n > 1 ? n : 1; +} Index: gcc-8-8-20180308-1.1/src/libgo/runtime/go-caller.c =================================================================== --- gcc-8-8-20180308-1.1.orig/src/libgo/runtime/go-caller.c +++ gcc-8-8-20180308-1.1/src/libgo/runtime/go-caller.c @@ -116,7 +116,7 @@ __go_get_backtrace_state () argv[0] (http://gcc.gnu.org/PR61895). It would be nice to have a better check for whether this file is the real executable. */ - if (stat (filename, &s) < 0 || s.st_size < 1024) + if (filename != NULL && (stat (filename, &s) < 0 || s.st_size < 1024)) filename = NULL; back_state = backtrace_create_state (filename, 1, error_callback, NULL);