Re: DLL export with mingw-w64: currently a no-op

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Johann 'Myrkraverk' Oskarsson <johann(at)2ndquadrant(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: DLL export with mingw-w64: currently a no-op
Date: 2011-05-03 12:40:28
Message-ID: 4DBFF7BC.9060100@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 05/03/2011 06:45 AM, Johann 'Myrkraverk' Oskarsson wrote:
> On Tue, 03 May 2011 09:32:29 -0000, Andrew Dunstan
> <andrew(at)dunslane(dot)net> wrote:
>
>> On 05/03/2011 02:46 AM, Johann 'Myrkraverk' Oskarsson wrote:
>>>
>>> When compiling PG with mingw-w64 the PGDLLEXPORT macro is blank.
>>>
>>> Here is a patch that "fixes it for me." If this is correct, I'd
>>> appreciate it will be applied to 9.0.x as well as HEAD.
>>
>> AFAICT it's not broken and doesn't need fixing. We don't define this
>> for the 32 bit MinGW compiler, so why should it be necessary in the
>> 64 bit case?
>
> I am using a different build procedure for 64bit than 32bit, as adviced
> by the mingw-w64 team. The final step I use is:
> ${CC} -shared -o ${plugin} ${OBJS} ${BE_DLLLIBS} -L. -ljvm
>
> I guess that is my "issue." Without __declspec(dllexport) in the magic
> macro Pg_magic_func() isn't exported properly because of that, for ex-
> ample.
>
> Now while I can only blame myself for using something different/un-
> supported, I have to ask, why was I told to use gcc in the final
> link step by the mingw-w64 team while you (postgres) use something
> else (I presume dlltool)?

Our Makefiles use dlltool and dllwrap to create DLLs. If you used our
recommended build method pgxs would do lots of the work for you.

I'm not sure why you asked the mingw-w64 team about building a Postgres
extension - they are unlikely to know anything much about our build system.

cheers

andrew

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2011-05-03 14:19:55 Re: FDW table hints
Previous Message David Fetter 2011-05-03 12:39:05 Re: FDW table hints