This is the mail archive of the
cygwin@cygwin.com
mailing list for the Cygwin project.
RE: exporting symbols from executable and linking shared objects question
- To: <cygwin at cygwin dot com>
- Subject: RE: exporting symbols from executable and linking shared objects question
- From: Horák Daniel <horak at sit dot plzen-city dot cz>
- Date: Wed, 23 May 2001 16:21:59 +0200
> I'm new to the list, but I searched archives looking for a
> solution and
> found nothing.
>
> I have TWO questions, but it's the same problem.
>
> First is -rdynamic swich for gcc. it's used to export symbols
> for shared
> objects and the second is about linking shared objects (.dll)
> with symbols
> declared as external.
You can look into a Makefile (src/backend/Makefile) that is used to
create PostgreSQL server executable. It also requires to export symbols
from the main executable to be available for dynamicly loaded modules.
postgres: $(OBJS) $(top_builddir)/src/utils/dllinit.o postgres.def
libpostgres.a
dlltool --dllname $@$(X) --output-exp $@.exp --def postgres.def
gcc -g -o $@$(X) -Wl,--base-file,$@.base $@.exp $(OBJS)
$(DLLLIBS)
dlltool --dllname $@$(X) --base-file $@.base --output-exp $@.exp
--def postgres.def
gcc -g -o $@$(X) $@.exp $(OBJS) $(DLLLIBS)
rm $@.exp $@.base
postgres.def: $(OBJS)
$(DLLTOOL) --export-all --output-def $@ $(OBJS)
libpostgres.a: $(OBJS) $(top_builddir)/src/utils/dllinit.o postgres.def
$(DLLTOOL) --dllname postgres.exe --def postgres.def
--output-lib $@
It was created a few years ago, so it doesn't use features in recent
compiler/linker. The main trick is to create a DLL with .EXE suffix.
Dan
--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple