> 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 [email protected] --def postgres.def
        gcc -g -o $@$(X) -Wl,--base-file,[email protected] [email protected] $(OBJS)
$(DLLLIBS)
        dlltool --dllname $@$(X) --base-file [email protected] --output-exp [email protected]
--def postgres.def
        gcc -g -o $@$(X) [email protected] $(OBJS) $(DLLLIBS)
        rm [email protected] [email protected]

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

Reply via email to