Received: from magus.postgresql.org ([87.238.57.229]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TLCBK-0000Ed-Qw for pgsql-hackers@postgresql.org; Mon, 08 Oct 2012 12:11:34 +0000 Received: from mail-qa0-f53.google.com ([209.85.216.53]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TLCBI-0001KB-9t for pgsql-hackers@postgresql.org; Mon, 08 Oct 2012 12:11:34 +0000 Received: by mail-qa0-f53.google.com with SMTP id s11so1835250qaa.19 for ; Mon, 08 Oct 2012 05:11:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent :x-gm-message-state; bh=6eM4d1KfLRoRTWSZeM0Kqz4xdKDnjUJn6Tpk7tzPOCA=; b=OUWxQgdyuQxDqSMS4Du7upfK9Qhpp/i3tcKkSnaVaniNRVd76aY8JUhYRJQxeTWn34 uTFoMXsTPasIaSZ3cq8de8xcy5qmUjfrrjh1t659msmuM2goxmKjwdksHcaE+nR/5bsv n3CfRB2vUGFiJ0EnVXShWgSgJhkQkLK9zxcmuU0jUwySiNXfwC1E/3FdGDqwfD8G7q6T E3GaCTLtB2hEueItnwofuI/S6TI2nDz001QzRkNG4ta24AuAevXbDCSWG/pTCPdW/xAf d+A7iV1Tnh8zNXgdgXmq5Qdq11kY3HKKfozTWAVThcdxuDhnLkkOdJAhXTngtDJ0yej2 ZdEg== Received: by 10.229.106.226 with SMTP id y34mr6739309qco.54.1349698291414; Mon, 08 Oct 2012 05:11:31 -0700 (PDT) Received: from tornado.leadboat.com (ip68-105-236-221.hr.hr.cox.net. [68.105.236.221]) by mx.google.com with ESMTPS id j3sm17617249qek.7.2012.10.08.05.11.30 (version=SSLv3 cipher=OTHER); Mon, 08 Oct 2012 05:11:30 -0700 (PDT) Date: Mon, 8 Oct 2012 08:11:28 -0400 From: Noah Misch To: Brar Piening Cc: Heikki Linnakangas , Magnus Hagander , pgsql-hackers Subject: Re: Visual Studio 2012 RC Message-ID: <20121008121128.GA2248@tornado.leadboat.com> References: <4FCA84F6.5090706@gmx.de> <4FD3F553.9060105@gmx.de> <4FEB0D39.6080108@enterprisedb.com> <50526BA6.3030103@gmx.de> <20121002011201.GC30396@tornado.leadboat.com> <5071CA3E.5040509@gmx.de> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="Md/poaVZ8hnGTzuv" Content-Disposition: inline In-Reply-To: <5071CA3E.5040509@gmx.de> User-Agent: Mutt/1.5.18 (2008-05-17) X-Gm-Message-State: ALoCoQkx9p1L2t6AwrvT34uxX9z8jJsYSlOZGFtkouUJbAM6sDeHB4jReh2cDJRQ0Nk/iUu1iLKv X-Pg-Spam-Score: -2.6 (--) X-Archive-Number: 201210/333 X-Sequence-Number: 214569 --Md/poaVZ8hnGTzuv Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Sun, Oct 07, 2012 at 08:30:22PM +0200, Brar Piening wrote: > Noah Misch wrote: >> I'm marking this patch Waiting on Author, but the changes needed to >> get it Ready for Committer are fairly trivial. Thanks, nm > > Thanks for your review and sorry for my delayed response - I've been on > vacation. > > I'll look into adressing your comments and suggestions within the next > few days. Thanks. I decided to try a 32-bit build, but Solution::DeterminePlatform detected it as x64. Its shibboleth is no longer valid; the cl.exe shipping with VS 2012 Express for Desktop has a /favor option for both architectures: 32clhelp:/favor: select processor to optimize for, one of: 64clhelp:/favor: select processor to optimize for, one of: Overlaying the first attached change fixed detection for this particular compiler, but I have not checked compatibility with older versions. Do you have VS 2008 and/or VS 2010 handy? Having worked around that, the build eventually failed like this: Creating library Debug\postgres\postgres.lib and object Debug\postgres\postgres.exp postgres.exp : error LNK2001: unresolved external symbol _xmm@41f00000000000000000000000000000 [c:\cygwin\home\nm\src\pg\postgresql\postgres.vcxproj] postgres.exp : error LNK2001: unresolved external symbol _xmm@80000000000000008000000000000000 [c:\cygwin\home\nm\src\pg\postgresql\postgres.vcxproj] postgres.exp : error LNK2001: unresolved external symbol _xmm@80000000800000008000000080000000 [c:\cygwin\home\nm\src\pg\postgresql\postgres.vcxproj] .\Debug\postgres\postgres.exe : fatal error LNK1120: 3 unresolved externals [c:\cygwin\home\nm\src\pg\postgresql\postgres.vcxproj] The command exited with code 1120. Done executing task "Link" -- FAILED. This compiler emits _xmm symbols automatically, where needed. The second attached change lets the build complete and pass tests, but I can't readily explain why it's necessary. In the 64-bit build, the _xmm symbols export normally (albeit, I presume, needlessly). I hoped to find some rationale for the preexisting gendef.pl exclusion of _real, which seems to resemble _xmm in origin and use. Magnus/anyone, can you shed light on our exclusion of "_real" symbols from .def files? In any event, if these incremental changes seem sane to you, please merge them into your next version. nm --Md/poaVZ8hnGTzuv Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="vs2012-detect-32bit.patch" diff --git a/src/tools/msvc/Solution.pm b/src/tools/msvc/Solution.pm index e51665c..218ca8d 100644 --- a/src/tools/msvc/Solution.pm +++ b/src/tools/msvc/Solution.pm @@ -63,13 +63,12 @@ sub DeterminePlatform { my $self = shift; - # Determine if we are in 32 or 64-bit mode. Do this by seeing if CL has - # 64-bit only parameters. + # Examine CL help output to determine if we are in 32 or 64-bit mode. $self->{platform} = 'Win32'; - open(P, "cl /? 2>NUL|") || die "cl command not found"; + open(P, "cl /? 2>&1 |") || die "cl command not found"; while (

) { - if (/^\/favor:{platform} = 'x64'; last; --Md/poaVZ8hnGTzuv Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="vs2012-exclude-_xmm.patch" diff --git a/src/tools/msvc/gendef.pl b/src/tools/msvc/gendef.pl index ab65c46..8ef0422 100644 --- a/src/tools/msvc/gendef.pl +++ b/src/tools/msvc/gendef.pl @@ -40,6 +40,7 @@ while (<$ARGV[0]/*.obj>) next if $pieces[6] =~ /^\(/; next if $pieces[6] =~ /^__real/; next if $pieces[6] =~ /^__imp/; + next if $pieces[6] =~ /^__xmm/; next if $pieces[6] =~ /NULL_THUNK_DATA$/; next if $pieces[6] =~ /^__IMPORT_DESCRIPTOR/; next if $pieces[6] =~ /^__NULL_IMPORT/; --Md/poaVZ8hnGTzuv--