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

gopherbot 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.

Show comment
Hide comment
@rsc

rsc Nov 18, 2009

Contributor

Comment 1:

Status changed to LongTerm.

Contributor

rsc commented Nov 18, 2009

Comment 1:

Status changed to LongTerm.

@gopherbot

This comment has been minimized.

Show comment
Hide comment
@gopherbot

gopherbot 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 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.

Show comment
Hide comment
@gopherbot

gopherbot Aug 1, 2011

Comment 4 by geek@duzy.info:

expecting SO

gopherbot commented Aug 1, 2011

Comment 4 by geek@duzy.info:

expecting SO
@rsc

This comment has been minimized.

Show comment
Hide comment
@rsc

rsc Dec 9, 2011

Contributor

Comment 5:

Labels changed: added priority-later.

Contributor

rsc commented Dec 9, 2011

Comment 5:

Labels changed: added priority-later.

@alberts

This comment has been minimized.

Show comment
Hide comment
@alberts

alberts Sep 22, 2012

Contributor

Comment 7:

will issue #4069 help with this?
Contributor

alberts commented Sep 22, 2012

Comment 7:

will issue #4069 help with this?
@minux

This comment has been minimized.

Show comment
Hide comment
@minux

minux Sep 22, 2012

Member

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.
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

This comment has been minimized.

Show comment
Hide comment
@gopherbot

gopherbot Feb 24, 2013

Comment 11 by geek@duzy.info:

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

gopherbot 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.

Show comment
Hide comment
@gopherbot

gopherbot Feb 24, 2013

Comment 12 by geek@duzy.info:

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

gopherbot 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.

Show comment
Hide comment
@anacrolix

anacrolix Feb 25, 2013

Contributor

Comment 13:

-shared is not enumerated in go help build.
Contributor

anacrolix commented Feb 25, 2013

Comment 13:

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

This comment has been minimized.

Show comment
Hide comment
@rsc

rsc Nov 27, 2013

Contributor

Comment 14:

Labels changed: added go1.3maybe.

Contributor

rsc commented Nov 27, 2013

Comment 14:

Labels changed: added go1.3maybe.

@gopherbot

This comment has been minimized.

Show comment
Hide comment
@gopherbot

gopherbot 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...

gopherbot 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.

Show comment
Hide comment
@eliasnaur

eliasnaur Dec 2, 2013

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.
Contributor

eliasnaur 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.

Show comment
Hide comment
@rsc

rsc Dec 4, 2013

Contributor

Comment 17:

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

Contributor

rsc commented Dec 4, 2013

Comment 17:

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

@rsc

This comment has been minimized.

Show comment
Hide comment
@rsc

rsc Dec 4, 2013

Contributor

Comment 18:

Labels changed: added repo-main.

Contributor

rsc commented Dec 4, 2013

Comment 18:

Labels changed: added repo-main.

@sbinet

This comment has been minimized.

Show comment
Hide comment
@sbinet

sbinet Dec 4, 2013

Member

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...)
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

This comment has been minimized.

Show comment
Hide comment
@gopherbot

gopherbot 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 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.

Show comment
Hide comment
@gopherbot

gopherbot Jan 16, 2014

Comment 21 by bkcsfi:

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

gopherbot 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.

Show comment
Hide comment
@gopherbot

gopherbot 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 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.

Show comment
Hide comment
@gopherbot

gopherbot Apr 9, 2014

Comment 23:

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

gopherbot 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 from cmd/ld: generate .so from Go code to cmd/link: generate .so from Go code Jun 8, 2015

@ianlancetaylor

This comment has been minimized.

Show comment
Hide comment
@ianlancetaylor

ianlancetaylor Jun 16, 2015

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.

Contributor

ianlancetaylor 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.

Show comment
Hide comment
@d3x0r

d3x0r 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

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.