cmd/compile: go build -buildmode=c-shared -linkshared produces .so that isn't loadable by dlopen #60957
Labels
compiler/runtime
Issues related to the Go compiler and/or runtime.
FrozenDueToAge
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
What version of Go are you using (
go version
)?go 1.17
Does this issue reproduce with the latest release?
Yes, tried with 1.19 and 1.20
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
We have a project that builds multiple plugins using c-go and -buildmode=c-share. We would like to use -linkshared to reduce the total disk usage of the plugins.
So I suppose I should start with the question, is this a reasonable thing to try and do?
$go install -buildmode=shared -linkshared std // To install golang shared libs
$go build -buildmode=c-shared -linkshared -o ./myplugin.so ./pluginsource
What did you expect to see?
Expected ./myplugin.so to be produced that is linked to stdlib.so and also be loadable by dlopen.
What did you see instead?
The plugin compiles successfully but is not loadable by dlopen.
Example
Steps:
The text was updated successfully, but these errors were encountered: