rsc@golang.org writes: > http://codereview.appspot.com/4287056/diff/4001/src/Make.pkg#newcode48 > src/Make.pkg:48: INSTALLFILES+=$(patsubst > %.swig,$(pkgdir)/$(dir)/%.so,$(patsubst %.swigcxx,%.swig,$(SWIGFILES))) > What do we need ...
13 years, 12 months ago
(2011-03-17 15:52:20 UTC)
#3
rsc@golang.org writes:
> http://codereview.appspot.com/4287056/diff/4001/src/Make.pkg#newcode48
> src/Make.pkg:48: INSTALLFILES+=$(patsubst
> %.swig,$(pkgdir)/$(dir)/%.so,$(patsubst %.swigcxx,%.swig,$(SWIGFILES)))
> What do we need to do to get rid of these?
We need to have a linker which can fully support C++. I think the
simpler long-term path going forward will be to be to have 6l/8l emit an
ELF .o file, and complete the link using ld/. The cost is a two stage
link process when using SWIG. Alternatively we have to teach 6l/8l
about linker scripts, symbol visibility, versioning, and .init section
sorting, all of which is possible but I think more work.
I know less about Mach-O though the basic idea of emitting a Mach-O .o
file will work too.
> When cgo installed these kinds of things it
> did it to a path without /s in them so that
> the usual relative lookup could find them
> after being copied elsewhere. Do we need to
> worry about that here?
Unless I misunderstand I think we're OK. We put a simple name, not a
path, in the DT_NEEDED tag in the executable, so if you move the shared
library you can set LD_LIBRARY_PATH and the executable will find it.
It's not perfect but it's workable.
Ian
> Unless I misunderstand I think we're OK. We put a simple name, not a ...
13 years, 12 months ago
(2011-03-17 16:11:45 UTC)
#4
> Unless I misunderstand I think we're OK. We put a simple name, not a
> path, in the DT_NEEDED tag in the executable, so if you move the shared
> library you can set LD_LIBRARY_PATH and the executable will find it.
> It's not perfect but it's workable.
I looked again. It looks like the name is foo, so if there are two
different packages x/foo and y/foo they will both refer to foo.so.
Is that true? I think cgo, before it stopped using shared libraries,
referred to x_foo.so and y_foo.so, but I might be misremembering.
Russ
Russ Cox <rsc@golang.org> writes: >> Unless I misunderstand I think we're OK. We put a ...
13 years, 12 months ago
(2011-03-21 21:16:31 UTC)
#6
Russ Cox <rsc@golang.org> writes:
>> Unless I misunderstand I think we're OK. We put a simple name, not a
>> path, in the DT_NEEDED tag in the executable, so if you move the shared
>> library you can set LD_LIBRARY_PATH and the executable will find it.
>> It's not perfect but it's workable.
>
> I looked again. It looks like the name is foo, so if there are two
> different packages x/foo and y/foo they will both refer to foo.so.
> Is that true? I think cgo, before it stopped using shared libraries,
> referred to x_foo.so and y_foo.so, but I might be misremembering.
Good point. Fixed to include the full target name in the .so name.
PTAL.
Ian
Issue 4287056: code review 4287056: Make.pkg: add support for SWIG, and add two SWIG examples
(Closed)
Created 14 years ago by iant
Modified 13 years, 11 months ago
Reviewers:
Base URL:
Comments: 4