Re: Add PGDLLEXPORT to PG_FUNCTION_INFO_V1

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Add PGDLLEXPORT to PG_FUNCTION_INFO_V1
Дата
Msg-id 10909.1476282370@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Add PGDLLEXPORT to PG_FUNCTION_INFO_V1  (Albe Laurenz <laurenz.albe@wien.gv.at>)
Ответы Re: Add PGDLLEXPORT to PG_FUNCTION_INFO_V1  (Albe Laurenz <laurenz.albe@wien.gv.at>)
Список pgsql-hackers
Albe Laurenz <laurenz.albe@wien.gv.at> writes:
> Tom Lane wrote:
>> Except that we don't.  There aren't PGDLLEXPORT markings for any
>> functions exported from contrib modules, and we don't use dlltool
>> on them either.  By your argument, none of contrib would work on
>> Windows builds at all, but we have a ton of buildfarm evidence and
>> successful field use to the contrary.  How is that all working?

> I thought it was the job of src/tools/msvc/gendef.pl to generate
> .DEF files?

Hm, okay, so after further review and googling:

MSVC: gendef.pl is used to build a .DEF file, creating the equivalent
of --export-all-symbols behavior.

Mingw: we use handmade .DEF files for libpq and a few other libraries,
otherwise Makefile.shlib explicitly specifies -Wl,--export-all-symbols.

Cygwin: per https://sourceware.org/binutils/docs-2.17/ld/WIN32.html
--export-all-symbols is the default unless you use a .DEF file or have at
least one symbol marked __declspec(dllexport) --- but the Cygwin build
defines PGDLLEXPORT as empty, so there won't be any of the latter.

So it works for us, but the stackoverflow complainant is evidently using
some homebrew build process that does none of the above.

I'm okay with adding PGDLLEXPORT to the extern, but we should update
that comment to note that it's not necessary with any of our standard
Windows build processes.  (For that matter, the comment fails to explain
why this macro is providing an extern for the base function at all...)
        regards, tom lane



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: ICU integration
Следующее
От: Heikki Linnakangas
Дата:
Сообщение: Re: Logical tape pause/resume