win32 contrib linking fails

From: Andreas Pflug <pgadmin(at)pse-consulting(dot)de>
To: pgsql-hackers-win32(at)postgresql(dot)org
Subject: win32 contrib linking fails
Date: 2004-08-03 11:55:32
Message-ID: 410F7D34.3000806@pse-consulting.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers-win32

When referencing postmaster variables (e.g. GUC variables), linking of
contrib modules fail.

What I get is
INFO: resolving _PostmasterPid by linking to __imp__PostmasterPid
(auto-import)
undefined reference to 'libpostgres_a_iname'
undefined reference to '_nm__PostmasterPid'

I find the symbol in postgres.def (PostmasterPid @934 DATA), and
libpostgres.a has __imp__PostmasterPid.

Apparently all symbols in DATA are not resolvable. Any hints?

dlltool --version 2.13.90,
gcc --version 3.2.3 (mingw 20030504-1)

Regards,
Andreas

PS
There's a cyclic reference in libraries, which seems a bit dubious:
libpgport.a is made with references to libpostgres.a and vice versa.
Making the backend will fail if made from src/backend, with an undefined
reference to _imp__CurrentMemoryContext.

Actually, using postgres.exe as dll is quite uncommon; usually all code
would be stuffed into postgres.dll, with a very small postgres.exe
(main.c) just loading and executing the dll. This might also resolve the
contrib linkage issue. In future situations, this also might enable us
to offer an interface to use pgsql linked to apps, without piping or
other inter process communication.

Browse pgsql-hackers-win32 by date

  From Date Subject
Next Message Jochem van Dieten 2004-08-03 13:16:30 Re: pg_dumpall on win32
Previous Message Andreas Pflug 2004-08-03 10:03:56 Re: make fails if path has spaces