You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (go version)?
1.7 (but nothing has changed here lately)
What operating system and processor architecture are you using (go env)?
Linux.
What did you do?
Applied a distro patch that does not change the exported API of any package, but does add a new file (it adds a header file to runtime/cgo, to be precise)
What did you expect to see?
I expected the ABI hash of libstd.so to be the same.
What did you see instead?
It had changed.
This turns out to be because the linker computes the ABI hash for the shared library by hashing the __.PKGDEF file from each .a file going into the shared library. But that includes the build id that the go tool determines, which is irrelevant for this purpose. I think it would be better to just hash the first line of __.PKGDEF (which has the version of the compiler and GOEXPERIMENT markers) and then the export data, which after all is what the compiler looks at when compiling code that imports this package (which can be found by looking for $$ markers, I think).
Practice suggests that this might still be too fine -- I need to think about preventing inlining across module boundaries -- but that's mostly orthogonal, I think.
The text was updated successfully, but these errors were encountered:
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
go version
)?1.7 (but nothing has changed here lately)
What operating system and processor architecture are you using (
go env
)?Linux.
What did you do?
Applied a distro patch that does not change the exported API of any package, but does add a new file (it adds a header file to runtime/cgo, to be precise)
What did you expect to see?
I expected the ABI hash of libstd.so to be the same.
What did you see instead?
It had changed.
This turns out to be because the linker computes the ABI hash for the shared library by hashing the __.PKGDEF file from each .a file going into the shared library. But that includes the build id that the go tool determines, which is irrelevant for this purpose. I think it would be better to just hash the first line of __.PKGDEF (which has the version of the compiler and GOEXPERIMENT markers) and then the export data, which after all is what the compiler looks at when compiling code that imports this package (which can be found by looking for $$ markers, I think).
Practice suggests that this might still be too fine -- I need to think about preventing inlining across module boundaries -- but that's mostly orthogonal, I think.
The text was updated successfully, but these errors were encountered: