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

Comments

Projects
None yet
10 participants
@gopherbot
Copy link

commented Nov 18, 2009

by JeanLou.Dupont:

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

This comment has been minimized.

Copy link
Contributor

commented Nov 18, 2009

Comment 1:

Status changed to LongTerm.

@gopherbot

This comment has been minimized.

Copy link
Author

commented Aug 20, 2010

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

This comment has been minimized.

Copy link
Author

commented Aug 1, 2011

Comment 4 by geek@duzy.info:

expecting SO
@rsc

This comment has been minimized.

Copy link
Contributor

commented Dec 9, 2011

Comment 5:

Labels changed: added priority-later.

@alberts

This comment has been minimized.

Copy link
Contributor

commented Sep 22, 2012

Comment 7:

will issue #4069 help with this?
@minux

This comment has been minimized.

Copy link
Member

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

This comment has been minimized.

Copy link
Author

commented Feb 24, 2013

Comment 11 by geek@duzy.info:

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

This comment has been minimized.

Copy link
Author

commented Feb 24, 2013

Comment 12 by geek@duzy.info:

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

This comment has been minimized.

Copy link
Contributor

commented Feb 25, 2013

Comment 13:

-shared is not enumerated in go help build.
@rsc

This comment has been minimized.

Copy link
Contributor

commented Nov 27, 2013

Comment 14:

Labels changed: added go1.3maybe.

@gopherbot

This comment has been minimized.

Copy link
Author

commented Dec 2, 2013

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

This comment has been minimized.

Copy link
Contributor

commented Dec 2, 2013

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

This comment has been minimized.

Copy link
Contributor

commented Dec 4, 2013

Comment 17:

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

@rsc

This comment has been minimized.

Copy link
Contributor

commented Dec 4, 2013

Comment 18:

Labels changed: added repo-main.

@sbinet

This comment has been minimized.

Copy link
Member

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

This comment has been minimized.

Copy link
Author

commented Dec 4, 2013

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

This comment has been minimized.

Copy link
Author

commented Jan 16, 2014

Comment 21 by bkcsfi:

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

This comment has been minimized.

Copy link
Author

commented Jan 16, 2014

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

This comment has been minimized.

Copy link
Author

commented Apr 9, 2014

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

This comment has been minimized.

Copy link
Contributor

commented Jun 16, 2015

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

This comment has been minimized.

Copy link

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.
You can’t perform that action at this time.