Re: narwhal and PGDLLIMPORT

From: Craig Ringer <craig(at)2ndquadrant(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Hiroshi Inoue <inoue(at)tpf(dot)co(dot)jp>
Cc: Andrew Dunstan <andrew(at)dunslane(dot)net>, Robert Haas <robertmhaas(at)gmail(dot)com>, Andres Freund <andres(at)2ndquadrant(dot)com>, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: narwhal and PGDLLIMPORT
Date: 2014-02-12 00:04:41
Message-ID: 52FABA99.20407@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 02/12/2014 07:30 AM, Tom Lane wrote:

> gcc -O2 -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -g -Wno-comment -shared -o plperl.dll plperl.o SPI.o Util.o -L../../../src/port -L../../../src/common -Wl,--allow-multiple-definition -L/mingw/lib -Wl,--as-needed -LC:/Perl/lib/CORE -lperl58 -L../../../src/backend -lpostgres -lpgcommon -lpgport -lintl -lxslt -lxml2 -lssleay32 -leay32 -lz -lm -lws2_32 -lshfolder -Wl,--export-all-symbols -Wl,--out-implib=libplperl.a
> Cannot export .idata$4: symbol not found
> Cannot export .idata$5: symbol not found
> Cannot export .idata$6: symbol not found
> Cannot export .text: symbol not found
> Cannot export perl58_NULL_THUNK_DATA: symbol not found
> Creating library file: libplperl.a
> collect2: ld returned 1 exit status
> make[3]: *** [plperl.dll] Error 1
>
> Not very clear what's going on there; could this be a problem in
> narwhal's admittedly-ancient toolchain?

Easily.

> BTW, now that I look at this ... why are we bothering to build static
> libraries (.a files) for DLLs? They have no possible use AFAICS.

This is actually compiling a DLL:

-o plperl.dll

but is also emitting an import library:

-Wl,--out-implib=libplperl.a

which is required if you wish to link to plperl.dll from any other
compilation unit (except for by dynamic linkage).

I don't see any use for that with plperl, but it might be a valid thing
to be doing for (e.g.) hstore.dll. Though you can't really link to it
from another module anyway, you have to go through the fmgr to get
access to its symbols at rutime, so we can probably just skip generation
of import libraries for contribs and PLs.

--
Craig Ringer http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2014-02-12 00:08:58 Re: narwhal and PGDLLIMPORT
Previous Message Craig Ringer 2014-02-12 00:00:24 Re: narwhal and PGDLLIMPORT