Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id CF2411336971 for ; Thu, 16 Dec 2010 13:43:01 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 92852-01-6 for ; Thu, 16 Dec 2010 17:42:53 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from smtp-vbr16.xs4all.nl (smtp-vbr16.xs4all.nl [194.109.24.36]) by mail.postgresql.org (Postfix) with ESMTP id 339911338041 for ; Thu, 16 Dec 2010 13:39:11 -0400 (AST) Received: from pc09.procura.nl (procura.xs4all.nl [82.95.216.29]) (authenticated bits=0) by smtp-vbr16.xs4all.nl (8.13.8/8.13.8) with ESMTP id oBGHd2N2053187 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Thu, 16 Dec 2010 18:39:08 +0100 (CET) (envelope-from h.m.brand@xs4all.nl) Date: Thu, 16 Dec 2010 18:39:02 +0100 From: "H.Merijn Brand" To: Tom Lane Cc: Simon Riggs , pgsql-bugs@postgresql.org Subject: Re: [Fwd: DBD::Pg on HP-UX 11.31 64bit] Message-ID: <20101216183902.5aaa8d35@pc09.procura.nl> In-Reply-To: <23253.1292520241@sss.pgh.pa.us> References: <1292355427.2737.4589.camel@ebony> <18189.1292357796@sss.pgh.pa.us> <20101216174803.20b2b6db@pc09.procura.nl> <23253.1292520241@sss.pgh.pa.us> X-Mailer: Claws Mail 3.7.8cvs1 (GTK+ 2.18.6; x86_64-unknown-linux-gnu) Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwEAIAAACI8LKTAAAACXBIWXMAAABIAAAASABGyWs+AAAC JElEQVRo3u2aMY4CMQxFczZ6RItEzRm4DBINDbRUSPRInIRbsNK6+dJfezN4kokn48IaCSjysL8d e9Knoj2fr9f9/gllqQ6U9/vxWK3EdwdIEGjRIVCu18NhuxUfK46SH81+fzrdbuKPx/P5ctHQdAdI TKAgpvV6s9ntBEfXEYSGgMQzIHnuFBBjkshCNJ2KtJZ04hHNAugP8bZr3NIHhbcF0AKoK0CoaHXU LUWBIs1n+jV+Fl8CVqOApEXAwyMO/DSR4XVntoAYDR7eBjQupuYAYTMph8Rj21D4m7MChN02tpqs NSnb/KqU2oHCXu5xDCgflj/RAgBiKBIXnICzAsSjWBsTz5K4/HeXYvb8yK5lY3VGEwPi2aONKT+5 AlcxrTPOwcTiraGRChgMEKJh0bVVifGVTq6qgBiNVl8QE29EsK6VE+YJAOG2wz5AvsqUS6uqgHCA n4NGvBYpnJ64Jgg27sCtxtBk1CJIA4S/GhdWKh07QxUB48jWGhZ4jKamRRr/T8/M0AaEyctry6YB 4dTGj9iWZNs3DahES5kPCJOu0RQbF/fQOBprsB9gaO9JtPDzII9U5ySXX7AnuIt91y54AAW7rPpT LCe5gt3F+CLqr2UarGB3MXvMylWGq4+9RCx3TW1oJq1t3HPQlFs6N1fFNEB4s8dn7Ne7ACSm7TPQ I5quAWmw6qBpulHM33B0Csge4Nd8JTTYG2b1XyRe3lH8x34ABJ6aePuQ2N4AAAAASUVORK5CYII= Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: by XS4ALL Virus Scanner X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-5 required=5 tests=BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201012/119 X-Sequence-Number: 28925 On Thu, 16 Dec 2010 12:24:01 -0500, Tom Lane wrote: > "H.Merijn Brand" writes: > > This is what the docs on HP-UX say: > > > int getsockopt ( > > int s, > > int level, > > int optname, > > void *optval, > > int *optlen > > ); > > > UNIX 03 Only (X/Open Sockets) > > > int getsockopt ( > > int s, > > int level, > > int optname, > > void *__restrict optval, > > socklen_t *__restrict optlen > > ); > > Mmm, fun. And what is socklen_t defined as? sys/types.h 473:typedef size_t socklen_t; > > the includes tell me > > src/include/pg_config.h:#define ACCEPT_TYPE_ARG3 size_t > > Hmm, that suggests that configure was already seeing the socklen_t > variant ... That was my conclusion too > > To use X/Open sockets, which seems to me the better option for > > postgresql, I changed scr/Makefile.global => > > > CC = cc > > CFLAGS = -O2 -g -Ae -z +Z +DD64 -D_XOPEN_SOURCE=600 > > LIBS = -lssl -lcrypto -lxnet -lz -lm > > LDFLAGS = -Wl,+vnocompatwarnings +DD64 -L/usr/local/ia64/lib \ > > -L/usr/lib/hpux64 -L/usr/contrib/X11R6/lib/hpux64 -s \ > > -L/usr/local/lib -L/usr/lib/X11R6 -L/usr/contrib/X11R6/lib > > Screwing around with CFLAGS in an already-generated Makefile.global > is definitely *not* the way to approach this; you need configure to > have seen the same switches, else it will have selected the wrong > ACCEPT_TYPE_ARG3. Try it with > configure CPPFLAGS="-D_XOPEN_SOURCE=600" > or something like that. I know, but I first wanted to nail down the real cause of failure > > To ensure optimal alignment, I also added > > #pragma pack 16 > > to all header files > > And please do not inject random other ways of breaking things at the > same time --- there's no good reason to believe that that will even > work, and it's surely complicating trying to solve the immediate > problem. I did this because of the truckload of warnings I got. I'll do a fresh checkout on my next attempt > > # PostgreSQL (reported) PostgreSQL 8.4.4 on x86_64-unknown-linux-gnu, compiled by GCC gcc (SUSE Linux) 4.4.1 [gcc-4_4-branch revision 150839], 64-bit > > Where'd that come from? Seems a bit weird that this is referring to > something other than your HPUX build. $PGHOST is set to our postgres server One of the reasons is that *that* is what I eventually have to get working: 64bit perl on HP-UX 11.31 talking through DBD::Pg to a remote postgres server. > > As, at this point, there is no control over the library that perl > > itself is linked with: > > Hmm. I wonder whether perl is built with libraries that expect the > "int" definition instead of the "socklen_t" definition, or vice versa > (whichever way is not what libpq expects). Do you know exactly how HP > is managing to support both of those ABIs? It is, as getsockopt () is in libc. All executables - of course - are linked to libc, so unless they were *also* linked to libxnet, the libc variant will be chosen. I might find some time to rebuild perl from scratch with the -D option and the addition of libxnet and see it that causes a different result -- H.Merijn Brand http://tux.nl Perl Monger http://amsterdam.pm.org/ using 5.00307 through 5.12 and porting perl5.13.x on HP-UX 10.20, 11.00, 11.11, 11.23 and 11.31, OpenSuSE 10.1, 11.0 .. 11.3 and AIX 5.2 and 5.3. http://mirrors.develooper.com/hpux/ http://www.test-smoke.org/ http://qa.perl.org http://www.goldmark.org/jeff/stupid-disclaimers/