Skip to content
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/link: generate .so from Go code #256

Closed
gopherbot opened this issue Nov 18, 2009 · 23 comments
Closed

cmd/link: generate .so from Go code #256

gopherbot opened this issue Nov 18, 2009 · 23 comments
Milestone

Comments

@gopherbot
Copy link

by JeanLou.Dupont:

It would be nice to be able to generate Shared Libraries (.so).
@rsc
Copy link
Contributor

rsc commented Nov 18, 2009

Comment 1:

Status changed to LongTerm.

@gopherbot
Copy link
Author

Comment 2 by eugueny:

Ughh... Shared libraries are target #1 for any lower-level systems programming language.
Most code on my system is in .so files and nearly all my code runs under either nginx or
python processes, I just don't see how I can use Go.

@gopherbot
Copy link
Author

Comment 4 by geek@duzy.info:

expecting SO

@rsc
Copy link
Contributor

rsc commented Dec 9, 2011

Comment 5:

Labels changed: added priority-later.

@alberts
Copy link
Contributor

alberts commented Sep 22, 2012

Comment 7:

will issue #4069 help with this?

@minux
Copy link
Member

minux commented Sep 22, 2012

Comment 8:

Yes, except that issue #4069 doesn't mention to generate PIC object files
which is preferable (but not essential) for shared objects.
If issue #4069 is solved, at least we can generate non-PIC .so.

@gopherbot
Copy link
Author

Comment 11 by geek@duzy.info:

-shared is not available in 6l, 8l, 5l etc

@gopherbot
Copy link
Author

Comment 12 by geek@duzy.info:

-shared is now available in 6l, 8l, 5l etc

@anacrolix
Copy link
Contributor

Comment 13:

-shared is not enumerated in go help build.

@rsc
Copy link
Contributor

rsc commented Nov 27, 2013

Comment 14:

Labels changed: added go1.3maybe.

@gopherbot
Copy link
Author

Comment 15 by rasmus@mindplay.dk:

The changes you are working on - will they provide .so only or .dll on Windows too?
I am fast falling in love with Go, but realized too late that although it is technically
a "system" programming language, things like shell-extensions and plug-ins are still out
of reach...

@eliasnaur
Copy link
Contributor

Comment 16:

I'm only working on Linux support, but if that is accepted and added to mainline in some
form, Windows support will be a relatively minor change.

@rsc
Copy link
Contributor

rsc commented Dec 4, 2013

Comment 17:

Labels changed: added release-none, removed go1.3maybe.

@rsc
Copy link
Contributor

rsc commented Dec 4, 2013

Comment 18:

Labels changed: added repo-main.

@sbinet
Copy link
Member

sbinet commented Dec 4, 2013

Comment 19:

following https://code.google.com/p/go-wiki/wiki/HandlingIssues
here is a quick rationale:
- allow some form of dynamic code loading
- ability to, say, implement a CPython module in Go (or a ruby one, or...)

@gopherbot
Copy link
Author

Comment 20 by peter@scraperwiki.com:

I would also like to be able to implement an NSS module using go, which is not possible
without this functionality.

@gopherbot
Copy link
Author

Comment 21 by bkcsfi:

I would like to build PPAPI plugins in Go.. Need DLL generation support for that.

@gopherbot
Copy link
Author

Comment 22 by rasmus@mindplay.dk:

Writing a VST plugin in this language would be so bad ass, since Go provides performance
suitable for real-time DSP.

@gopherbot
Copy link
Author

Comment 23:

CL https://golang.org/cl/9738047 references this issue.

@rsc rsc added this to the Unplanned milestone Apr 10, 2015
@rsc rsc changed the title cmd/ld: generate .so from Go code cmd/link: generate .so from Go code Jun 8, 2015
@ianlancetaylor
Copy link
Contributor

This issue is a little vague. It now works in some ways on some systems on tip, using -buildmode=shared, -buildmode=c-shared, and -linkshared.

Let's move more specific uses on specific systems to separate issues.

@mikioh mikioh modified the milestones: Go1.5, Unplanned Jun 17, 2015
@d3x0r
Copy link

d3x0r commented Aug 17, 2015

Re: See https://docs.google.com/a/golang.org/document/d/1nr-TQHw_er6GOQRsF6T43GGhFDelrAP0NqSS_00RgZQ/edit#heading=h.fwmrrio0df0i

Reflection also needs to be considered when loading a library; I may not know what symbols are available; but I know what interfaces I support, so being able to scan a dynamically loaded extension for its types and picking those with interfaces of interest is useful.

I started today thinking about writing plugins for an existing shell I have. This would have been first 'can Go link shared libraries?' But on further consideration, if it did use shared libraries how would I use them?
c# doesn't really behave like dlopen/dlsym/et al It instead gives back lists of types that can be queries for support. An alternative available on C# is Attributes; but go has no idea about attributes so it would definitly have to be done with reflection

@golang golang locked and limited conversation to collaborators Aug 22, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

10 participants