cmd/link: exit if runtime.a is missing

Many stages in the linker assume some runtime symbols exist.
Error out if the runtime package cannot be found.

Fixes #56685.

Change-Id: I39b2663f6d7419688e30e6d8650e5eb8fc43a2b1
Reviewed-on: https://go-review.googlesource.com/c/go/+/449638
Reviewed-by: Than McIntosh <thanm@google.com>
Run-TryBot: Cherry Mui <cherryyz@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
This commit is contained in:
Cherry Mui 2022-11-10 17:17:54 -05:00
parent 73f987c88b
commit fffda6b3ad

View file

@ -466,6 +466,9 @@ func loadinternal(ctxt *Link, name string) *sym.Library {
}
}
if name == "runtime" {
Exitf("error: unable to find runtime.a")
}
ctxt.Logf("warning: unable to find %s.a\n", name)
return nil
}