Re: pl/perl extension fails on Windows

Sandeep Thakkar <sandeep.thakkar@enterprisedb.com>

From: Sandeep Thakkar <sandeep.thakkar@enterprisedb.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Ashutosh Sharma <ashu.coek88@gmail.com>, Robert Haas <robertmhaas@gmail.com>, Christoph Berg <myon@debian.org>, pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2017-08-14T09:42:07Z
Lists: pgsql-hackers
Hi

On Thu, Aug 10, 2017 at 9:04 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:

> Ashutosh Sharma <ashu.coek88@gmail.com> writes:
> > On Thu, Aug 10, 2017 at 8:06 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> >> Yeah ... however, if that's there, then there's something wrong with
> >> Ashutosh's explanation, because that means we *are* building with
> >> _USE_32BIT_TIME_T in 32-bit builds.  It's just getting there in a
> >> roundabout way.  (Or, alternatively, this code is somehow not doing
> >> anything at all.)
>
> > I am extremely sorry if i have communicated the things wrongly, what i
> > meant was we are always considering _USE_32BIT_TIME_T flag to build
> > plperl module on Windows 32-bit platform but unfortunately that is not
> > being considered/defined in perl code in case we use VC++ compiler
> > version greater than 8.0. and that's the reason for the binary
> > mismatch error on 32 bit platform.
>
> Got it.  So in short, it seems like the attached patch ought to fix it
> for MSVC builds.  (We'd also need to teach PGAC_CHECK_PERL_EMBED_CCFLAGS
> to let _USE_32BIT_TIME_T through on Windows, but let's confirm the theory
> first.)
>
> We built the sources with this patch and were able to create the plperl
extension on Windows 32bit and 64bit.


>                         regards, tom lane
>
>


-- 
Sandeep Thakkar
EDB

Commits

  1. MSVC: Test whether 32-bit Perl needs -D_USE_32BIT_TIME_T.

  2. Further tweaks to compiler flags for PL/Perl on Windows.

  3. Absorb -D_USE_32BIT_TIME_T switch from Perl, if relevant.

  4. PL/Perl portability fix: absorb relevant -D switches from Perl.

  5. PL/Perl portability fix: avoid including XSUB.h in plperl.c.