1
0
mirror of https://github.com/golang/go synced 2024-11-20 06:44:40 -07:00
go/misc/cgo/testplugin
David Crawshaw 605331f43e cmd/go: pass plugin package name to compile -p
When compiling a plugin, package main gets a new name so as not to
conflict with the main package in the host binary, or any other
plugins. It is already defined by cmd/go, and used by cmd/link when
filling out the "" package placeholder in symbols.

With this CL, the plugin-specific name for main is also passed to
cmd/compile's -p flag. This is used to fill out the pkgpath field
of types, and ensures that two types defined in two different plugin
mains with the same name will not be mistaken for one another at
runtime.

Fixes #21386

Change-Id: I8a646d8d7451caff533fe0007343ea8b8e1704ed
Reviewed-on: https://go-review.googlesource.com/60910
Run-TryBot: David Crawshaw <crawshaw@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-09-01 18:27:59 +00:00
..
altpath/src cmd/link, runtime, plugin: versioning 2016-11-15 16:14:27 +00:00
src cmd/go: pass plugin package name to compile -p 2017-09-01 18:27:59 +00:00
test.bash plugin: resolve plugin import path issue 2017-04-26 00:54:54 +00:00
unnamed1.go plugin: properly handle recursively defined types 2017-04-12 12:46:07 +00:00
unnamed2.go plugin: properly handle recursively defined types 2017-04-12 12:46:07 +00:00