* Michael Stapelberg: > Can you please list the full instructions you did to accomplish building > sparse/index/regexp as a shared library?
Sure. See the Makefile at the end of this mail. Please note that I don't really know what I'm doing here -- just tried a few things and tried to make sense of error messages until I got working binaries. I put symlinks to the index, sparse, regexp directories into src/code.google.com/p/codesearch and added -Isrc to every gccgo invocation, so that the compiler looks for the local imports in the right place. For the shared libraries, I added 1. -shared -fPIC 2. -fno-split-stack Otherwise I could not link executables and got the following error message: /usr/bin/ld.bfd.real: cindex: hidden symbol `__morestack' in /usr/lib/gcc/x86_64-linux-gnu/4.7/libgcc.a/morestack.o) is referenced by DSO /usr/bin/ld.bfd.real: final link failed: Bad value When the libraries are put into src/code.google.com/codesearch/lib{sparse,regexp,index}.so, they are subsequently found by the compiler -- and apparently used for imports, even if the source files are missing. I have not yet figured out how to specify the full namespace-related path to the linker yet: -lcode.google.com/p/codesearch/index causes ld then to look for libcode.google.com/p/codesearch/index.so which is almost but not quite what is needed. Cheers, -Hilko PREFIX=src/code.google.com/p/codesearch GCCGO_FLAGS=-Isrc GCCGO_LIBFLAGS = -shared -fPIC -fno-split-stack GCCGO_LDFLAGS = -L$(PREFIX) GCCGO_EXE_LDFLAGS = $(GCCGO_LDFLAGS) -Wl,-R,$(PREFIX) dirs: mkdir -p $(PREFIX) ln -sf `pwd`/regexp `pwd`/index `pwd`/sparse $(PREFIX)/ LIBS=sparse regexp index DYNLIBS=$(patsubst %,$(PREFIX)/lib%.so,$(LIBS)) dynlibs: $(DYNLIBS) $(PREFIX)/lib%.so: $(PREFIX)/%/*.go gccgo $(GCCGO_FLAGS) $(GCCGO_LIBFLAGS) -o $@ $^ $(PREFIX)/libregexp.so: $(PREFIX)/regexp/*.go gccgo $(GCCGO_FLAGS) $(GCCGO_LIBFLAGS) -o $@ $^ $(GCCGO_LDFLAGS) -lsparse $(PREFIX)/libindex.so: $(PREFIX)/index/*.go gccgo $(GCCGO_FLAGS) $(GCCGO_LIBFLAGS) -o $@ $^ $(GCCGO_LDFLAGS) -lsparse -lregexp BINS=cindex csearch cgrep cindex: cmd/cindex/*.go gccgo $(GCCGO_FLAGS) -o $@ $^ $(GCCGO_EXE_LDFLAGS) -lindex csearch: cmd/csearch/*.go gccgo $(GCCGO_FLAGS) -o $@ $^ $(GCCGO_EXE_LDFLAGS) -lregexp -lindex cgrep: cmd/cgrep/*.go gccgo $(GCCGO_FLAGS) -o $@ $^ $(GCCGO_EXE_LDFLAGS) -lregexp bins: $(DYNLIBS) $(BINS) -- To UNSUBSCRIBE, email to debian-devel-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org Archive: http://lists.debian.org/87ip6d4l1p.fsf...@msgid.hilluzination.de