pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Ashutosh Sharma <ashu.coek88@gmail.com>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: Sandeep Thakkar <sandeep.thakkar@enterprisedb.com>
Cc: Christoph Berg <myon@debian.org>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Subject: Re: pl/perl extension fails on Windows
Date: Thu, 10 Aug 2017 11:34:46 -0400
Message-ID: <14838.1502379286@sss.pgh.pa.us> (raw)
In-Reply-To: <CAE9k0P=SuWJEe3k8X9hc2b14R1ipf00KWAcezdDA4F8btX+6Mw@mail.gmail.com>
References: <CANFyU97OVQ3+Mzfmt3MhuUm5NwPU=-FtbNH5Eb7nZL9ua8=rcA@mail.gmail.com>
	<4569.1499873707@sss.pgh.pa.us>
	<CA+OCxox=h5xftcnyk1AfA_QKSQSruD=Er0qweZakiCEg3U4rcg@mail.gmail.com>
	<20170713195345.2q6zmrtxumljhoui@msg.df7cb.de>
	<3254.1501276475@sss.pgh.pa.us>
	<20170730211444.uvedz2a24gusoaxr@msg.df7cb.de>
	<CAE9k0PnzYxyKHuwJonUEDt2xunPUc8VUVPWsd0BScRd3u+j8_A@mail.gmail.com>
	<20170731084044.q3wmppgt556zafzy@msg.df7cb.de>
	<30582.1501508356@sss.pgh.pa.us>
	<20170731164517.a34wxaapos7u5toj@msg.df7cb.de>
	<CANFyU96tucWPECj8Oy5cevuVwyijVoEZ_Dey08eCEhPk9TM85A@mail.gmail.com>
	<CA+TgmoZTu6wyjJ3vZNLuogCvXv9uwH0Xr+RMhJbo3L8f2eSVFg@mail.gmail.com>
	<CANFyU95XuHw8ajYHhg8BPdRSAa++n7MAHxpoEho90nPiEsTRKw@mail.gmail.com>
	<CA+Tgmob8We1gMW6mA-AKtc_Mx1LAGx9+aHOjmBEu_PYGDSpZkg@mail.gmail.com>
	<CAE9k0Pm9YcJqqkWXGvSQrkPGbH_f29VF7+=YzKNGOgnwnufa2Q@mail.gmail.com>
	<CA+TgmoZ6dGEb7Yr9v8JdLX=KtAtdOTcD8PQUbDxVTGBazpQ-QQ@mail.gmail.com>
	<12588.1502375771@sss.pgh.pa.us>
	<CAE9k0P=SuWJEe3k8X9hc2b14R1ipf00KWAce! zdDA4F8btX+6Mw@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>

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.)

			regards, tom lane

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Attachments:

32bit_time_t.patch (text/x-diff, 3.0K) download diff --git a/src/tools/msvc/MSBuildProject.pm b/src/tools/msvc/MSBuildProject.pm index d7638b4..27329f9 100644 *** a/src/tools/msvc/MSBuildProject.pm --- b/src/tools/msvc/MSBuildProject.pm *************** EOF *** 63,83 **** </PropertyGroup> EOF - # We have to use this flag on 32 bit targets because the 32bit perls - # are built with it and sometimes crash if we don't. - my $use_32bit_time_t = - $self->{platform} eq 'Win32' ? '_USE_32BIT_TIME_T;' : ''; - $self->WriteItemDefinitionGroup( $f, 'Debug', ! { defs => "_DEBUG;DEBUG=1;$use_32bit_time_t", opt => 'Disabled', strpool => 'false', runtime => 'MultiThreadedDebugDLL' }); $self->WriteItemDefinitionGroup( $f, 'Release', ! { defs => "$use_32bit_time_t", opt => 'Full', strpool => 'true', runtime => 'MultiThreadedDLL' }); --- 63,78 ---- </PropertyGroup> EOF $self->WriteItemDefinitionGroup( $f, 'Debug', ! { defs => "_DEBUG;DEBUG=1", opt => 'Disabled', strpool => 'false', runtime => 'MultiThreadedDebugDLL' }); $self->WriteItemDefinitionGroup( $f, 'Release', ! { defs => "", opt => 'Full', strpool => 'true', runtime => 'MultiThreadedDLL' }); diff --git a/src/tools/msvc/Mkvcbuild.pm b/src/tools/msvc/Mkvcbuild.pm index a7e3a01..940bef6 100644 *** a/src/tools/msvc/Mkvcbuild.pm --- b/src/tools/msvc/Mkvcbuild.pm *************** sub mkvcbuild *** 522,528 **** my @perl_embed_ccflags; foreach my $f (split(" ",$Config{ccflags})) { ! if ($f =~ /^-D[^_]/) { $f =~ s/\-D//; push(@perl_embed_ccflags, $f); --- 522,529 ---- my @perl_embed_ccflags; foreach my $f (split(" ",$Config{ccflags})) { ! if ($f =~ /^-D[^_]/ || ! $f =~ /^-D_USE_32BIT_TIME_T/) { $f =~ s/\-D//; push(@perl_embed_ccflags, $f); diff --git a/src/tools/msvc/VCBuildProject.pm b/src/tools/msvc/VCBuildProject.pm index a8d75d8..669ba17 100644 *** a/src/tools/msvc/VCBuildProject.pm --- b/src/tools/msvc/VCBuildProject.pm *************** sub WriteHeader *** 33,47 **** <Configurations> EOF - # We have to use this flag on 32 bit targets because the 32bit perls - # are built with it and sometimes crash if we don't. - my $use_32bit_time_t = - $self->{platform} eq 'Win32' ? '_USE_32BIT_TIME_T;' : ''; - - $self->WriteConfiguration( $f, 'Debug', ! { defs => "_DEBUG;DEBUG=1;$use_32bit_time_t", wholeopt => 0, opt => 0, strpool => 'false', --- 33,41 ---- <Configurations> EOF $self->WriteConfiguration( $f, 'Debug', ! { defs => "_DEBUG;DEBUG=1", wholeopt => 0, opt => 0, strpool => 'false', *************** EOF *** 49,55 **** $self->WriteConfiguration( $f, 'Release', ! { defs => "$use_32bit_time_t", wholeopt => 0, opt => 3, strpool => 'true', --- 43,49 ---- $self->WriteConfiguration( $f, 'Release', ! { defs => "", wholeopt => 0, opt => 3, strpool => 'true',

view thread (94+ messages)  latest in thread

Message-ID: <14838.1502379286@sss.pgh.pa.us>
Permalink:  ../14838.1502379286@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/14838.1502379286@sss.pgh.pa.us

 ·  · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-hackers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, ashu.coek88@gmail.com, robertmhaas@gmail.com, sandeep.thakkar@enterprisedb.com, myon@debian.org
  Subject: Re: pl/perl extension fails on Windows
  In-Reply-To: <14838.1502379286@sss.pgh.pa.us>
  References: <CANFyU97OVQ3+Mzfmt3MhuUm5NwPU=-FtbNH5Eb7nZL9ua8=rcA@mail.gmail.com> <4569.1499873707@sss.pgh.pa.us> <CA+OCxox=h5xftcnyk1AfA_QKSQSruD=Er0qweZakiCEg3U4rcg@mail.gmail.com> <20170713195345.2q6zmrtxumljhoui@msg.df7cb.de> <3254.1501276475@sss.pgh.pa.us> <20170730211444.uvedz2a24gusoaxr@msg.df7cb.de> <CAE9k0PnzYxyKHuwJonUEDt2xunPUc8VUVPWsd0BScRd3u+j8_A@mail.gmail.com> <20170731084044.q3wmppgt556zafzy@msg.df7cb.de> <30582.1501508356@sss.pgh.pa.us> <20170731164517.a34wxaapos7u5toj@msg.df7cb.de> <CANFyU96tucWPECj8Oy5cevuVwyijVoEZ_Dey08eCEhPk9TM85A@mail.gmail.com> <CA+TgmoZTu6wyjJ3vZNLuogCvXv9uwH0Xr+RMhJbo3L8f2eSVFg@mail.gmail.com> <CANFyU95XuHw8ajYHhg8BPdRSAa++n7MAHxpoEho90nPiEsTRKw@mail.gmail.com> <CA+Tgmob8We1gMW6mA-AKtc_Mx1LAGx9+aHOjmBEu_PYGDSpZkg@mail.gmail.com> <CAE9k0Pm9YcJqqkWXGvSQrkPGbH_f29VF7+=YzKNGOgnwnufa2Q@mail.gmail.com> <CA+TgmoZ6dGEb7Yr9v8JdLX=KtAtdOTcD8PQUbDxVTGBazpQ-QQ@mail.gmail.com> <12588.1502375771@sss.pgh.pa.us> <14838.1502379286@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox