Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dfpU7-00080Y-Ia for pgsql-hackers@arkaria.postgresql.org; Thu, 10 Aug 2017 15:34:55 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1dfpU7-0007tG-5G for pgsql-hackers@arkaria.postgresql.org; Thu, 10 Aug 2017 15:34:55 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dfpU6-0007sS-Fg for pgsql-hackers@postgresql.org; Thu, 10 Aug 2017 15:34:54 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dfpU3-0002K8-9m for pgsql-hackers@postgresql.org; Thu, 10 Aug 2017 15:34:54 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id v7AFYkRN014839; Thu, 10 Aug 2017 11:34:46 -0400 From: Tom Lane To: Ashutosh Sharma cc: Robert Haas , Sandeep Thakkar , Christoph Berg , pgsql-hackers Subject: Re: pl/perl extension fails on Windows In-reply-to: References: <4569.1499873707@sss.pgh.pa.us> <20170713195345.2q6zmrtxumljhoui@msg.df7cb.de> <3254.1501276475@sss.pgh.pa.us> <20170730211444.uvedz2a24gusoaxr@msg.df7cb.de> <20170731084044.q3wmppgt556zafzy@msg.df7cb.de> <30582.1501508356@sss.pgh.pa.us> <20170731164517.a34wxaapos7u5toj@msg.df7cb.de> <12588.1502375771@sss.pgh.pa.us> Comments: In-reply-to Ashutosh Sharma message dated "Thu, 10 Aug 2017 20:53:33 +0530" MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----- =_aaaaaaaaaa0" Content-ID: <14818.1502379261.0@sss.pgh.pa.us> Date: Thu, 10 Aug 2017 11:34:46 -0400 Message-ID: <14838.1502379286@sss.pgh.pa.us> List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org ------- =_aaaaaaaaaa0 Content-Type: text/plain; charset="us-ascii" Content-ID: <14818.1502379261.1@sss.pgh.pa.us> Ashutosh Sharma writes: > On Thu, Aug 10, 2017 at 8:06 PM, Tom Lane 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 ------- =_aaaaaaaaaa0 Content-Type: text/x-diff; name="32bit_time_t.patch"; charset="us-ascii" Content-ID: <14818.1502379261.2@sss.pgh.pa.us> Content-Description: 32bit_time_t.patch Content-Transfer-Encoding: quoted-printable diff --git a/src/tools/msvc/MSBuildProject.pm b/src/tools/msvc/MSBuildProje= ct.pm index d7638b4..27329f9 100644 *** a/src/tools/msvc/MSBuildProject.pm --- b/src/tools/msvc/MSBuildProject.pm *************** EOF *** 63,83 **** EOF =20=20 - # 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 =3D - $self->{platform} eq 'Win32' ? '_USE_32BIT_TIME_T;' : ''; -=20 $self->WriteItemDefinitionGroup( $f, 'Debug', ! { defs =3D> "_DEBUG;DEBUG=3D1;$use_32bit_time_t", opt =3D> 'Disabled', strpool =3D> 'false', runtime =3D> 'MultiThreadedDebugDLL' }); $self->WriteItemDefinitionGroup( $f, 'Release', ! { defs =3D> "$use_32bit_time_t", opt =3D> 'Full', strpool =3D> 'true', runtime =3D> 'MultiThreadedDLL' }); --- 63,78 ---- EOF =20=20 $self->WriteItemDefinitionGroup( $f, 'Debug', ! { defs =3D> "_DEBUG;DEBUG=3D1", opt =3D> 'Disabled', strpool =3D> 'false', runtime =3D> 'MultiThreadedDebugDLL' }); $self->WriteItemDefinitionGroup( $f, 'Release', ! { defs =3D> "", opt =3D> 'Full', strpool =3D> 'true', runtime =3D> '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 =3D~ /^-D[^_]/) { $f =3D~ s/\-D//; push(@perl_embed_ccflags, $f); --- 522,529 ---- my @perl_embed_ccflags; foreach my $f (split(" ",$Config{ccflags})) { ! if ($f =3D~ /^-D[^_]/ || ! $f =3D~ /^-D_USE_32BIT_TIME_T/) { $f =3D~ s/\-D//; push(@perl_embed_ccflags, $f); diff --git a/src/tools/msvc/VCBuildProject.pm b/src/tools/msvc/VCBuildProje= ct.pm index a8d75d8..669ba17 100644 *** a/src/tools/msvc/VCBuildProject.pm --- b/src/tools/msvc/VCBuildProject.pm *************** sub WriteHeader *** 33,47 **** EOF =20=20 - # 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 =3D - $self->{platform} eq 'Win32' ? '_USE_32BIT_TIME_T;' : ''; -=20 -=20 $self->WriteConfiguration( $f, 'Debug', ! { defs =3D> "_DEBUG;DEBUG=3D1;$use_32bit_time_t", wholeopt =3D> 0, opt =3D> 0, strpool =3D> 'false', --- 33,41 ---- EOF =20=20 $self->WriteConfiguration( $f, 'Debug', ! { defs =3D> "_DEBUG;DEBUG=3D1", wholeopt =3D> 0, opt =3D> 0, strpool =3D> 'false', *************** EOF *** 49,55 **** $self->WriteConfiguration( $f, 'Release', ! { defs =3D> "$use_32bit_time_t", wholeopt =3D> 0, opt =3D> 3, strpool =3D> 'true', --- 43,49 ---- $self->WriteConfiguration( $f, 'Release', ! { defs =3D> "", wholeopt =3D> 0, opt =3D> 3, strpool =3D> 'true', ------- =_aaaaaaaaaa0 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers ------- =_aaaaaaaaaa0--