Commit 5da1c254 authored by David Crawshaw's avatar David Crawshaw

runtime: do not run main when buildmode=c-shared

Change-Id: Ie7f85873978adf3fd5c739176f501ca219592824
Reviewed-on: https://go-review.googlesource.com/9011Reviewed-by: default avatarHyang-Ah Hana Kim <hyangah@gmail.com>
Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
parent 810bbfe6
...@@ -72,10 +72,6 @@ func main() { ...@@ -72,10 +72,6 @@ func main() {
gcenable() gcenable()
if islibrary {
// Allocate new M as main_main() is expected to block forever.
systemstack(newextram)
}
main_init_done = make(chan bool) main_init_done = make(chan bool)
if iscgo { if iscgo {
if _cgo_thread_start == nil { if _cgo_thread_start == nil {
...@@ -107,9 +103,9 @@ func main() { ...@@ -107,9 +103,9 @@ func main() {
needUnlock = false needUnlock = false
unlockOSThread() unlockOSThread()
if isarchive { if isarchive || islibrary {
// A program compiled with -buildmode=c-archive has a main, // A program compiled with -buildmode=c-archive or c-shared
// but it is not executed. // has a main, but it is not executed.
return return
} }
main_main() main_main()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment