New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cmd/go: installed c-shared libraries receiving ".a" suffix on Linux #24253
Comments
/cc @ianlancetaylor |
Note that it doesn't make a great deal of sense to use I'm fine with changing the default installation name but I don't see that it will make any difference in practical use. |
@ianlancetaylor Is it really unpredictable? The installation path makes sense to me. My use case is https://github.com/google/fscrypt, of which I maintain the Debian package. If I run The fact that the library is named I could use |
I want to make clear that the go tool does not in any way promise that the path you mention is the one that will be used by future releases. It is already the case that that path is not the one used on every platform. I suppose that that is what I mean by "unpredictable." |
What version of Go are you using (
go version
)?go version go1.9.4 linux/amd64
Does this issue reproduce with the latest release?
Yes. Reproduced with
1.10
What operating system and processor architecture are you using (
go env
)?What did you do?
go install -buildmode=c-shared -x -a ./libpa
libpa
contains a a C library declared in a main package.What did you expect to see?
I expected the output file to be labeled
libpa.so
indicating it was a shared objectWhat did you see instead?
The output was labeled
libpa.a
indicating an archive file, but in actuality it was a shared object file.Additional Information
go build -buildmode=c-shared -o libpa.so -x -a ./libpa
produces the expectedlibpa.so
output. This is how.so
files are generated in cshared_test.go.go install -buildmode=c-archive -x -a ./libpa
produces an archive file correctly namedlibpa.a
cfg.ExeSuffix
empty for Linux machines when thec-shared
option is selected (sets it to ".a
" forc-archive
).The text was updated successfully, but these errors were encountered: