]> Cypherpunks repositories - gostls13.git/commit
[release-branch.go1.20] cmd/compile: re-compile instantiated generic methods in links...
authorCuong Manh Le <cuong.manhle.vn@gmail.com>
Fri, 17 Mar 2023 17:53:07 +0000 (00:53 +0700)
committerMatthew Dempsky <mdempsky@google.com>
Wed, 29 Mar 2023 18:40:30 +0000 (18:40 +0000)
commit94c02a3cc481e4b73ce275ba6e50c286d4c492ff
tree8b40ce7c3c43e6812a6afdd3e04c342de498c63f
parent65fa8a69312dd64e09e32e4138ccc7278d0693e5
[release-branch.go1.20] cmd/compile: re-compile instantiated generic methods in linkshared mode

For G[T] that was seen and compiled in imported package, it is not added
to typecheck.Target.Decls, prevent wasting compile time re-creating
DUPOKS symbols. However, the linker do not support a type symbol
referencing a method symbol across DSO boundary. That causes unreachable
sym error when building under -linkshared mode.

To fix it, always re-compile generic methods in linkshared mode.

Fixes #59236

Change-Id: I894b417cfe8234ae1fe809cc975889345df22cef
Reviewed-on: https://go-review.googlesource.com/c/go/+/477375
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-on: https://go-review.googlesource.com/c/go/+/479355
misc/cgo/testshared/shared_test.go
misc/cgo/testshared/testdata/issue58966/main.go [new file with mode: 0644]
src/cmd/compile/internal/noder/unified.go