Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 157F61337B8F for ; Mon, 20 Dec 2010 07:32:16 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 27130-10 for ; Mon, 20 Dec 2010 11:32:08 +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 E7C3D1337B93 for ; Mon, 20 Dec 2010 07:32:07 -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 oBKBVe2N090365 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Mon, 20 Dec 2010 12:31:41 +0100 (CET) (envelope-from h.m.brand@xs4all.nl) Date: Mon, 20 Dec 2010 12:31:38 +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: <20101220123138.5935920f@pc09.procura.nl> In-Reply-To: <23792.1292522172@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> <23387.1292520681@sss.pgh.pa.us> <20101216184257.2d19fa5a@pc09.procura.nl> <23792.1292522172@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/149 X-Sequence-Number: 28955 On Thu, 16 Dec 2010 12:56:12 -0500, Tom Lane wrote: > "H.Merijn Brand" writes: > > On Thu, 16 Dec 2010 12:31:21 -0500, Tom Lane wrote: > >> So what I'm thinking is happening is that libpq expects size_t as > >> the argument type, but it's getting linked against a libc that > >> expects int as the argument type, and whatever HP is doing under > >> the hood fails to cope with that case. You might try removing > >> -D_XOPEN_SOURCE_EXTENDED from the template file --- I don't know if > >> that will have any bad side-effects, but it's worth a try to build > >> libpq that way. > > > I'll try that first after cleaning up my environment. > > I looked in the git history and found that I added > -D_XOPEN_SOURCE_EXTENDED in a patch that made getaddrinfo work > correctly: > http://git.postgresql.org/gitweb?p=postgresql.git;a=commit;h=1da6eb7fdaa79a93972c290174bd7136672a894f > So taking it out may indeed have unpleasant side-effects. I have read that patch, and it may well be that this might only be needed on PA-RISC. I at least see that the comment written in src/makefiles/Makefile.hpux is not completely correct. Probably true for LP64, but not for IA64. I hav now taken out the -D_XOPEN_SOURCE_EXTENDED and -lxnet requirements and compiled postgres against BSD sockets. Now it passes both its internal test suite *AND* the DBD::Pg test suite. Side notes env CC=cc CFLAGS="-Ae -z +Z +DD64 -O2" configure --prefix=/pro/pgsql \ --without-readline --without-ldap --with-openssl currently doesn't work, as src/template/hpux and src/makefiles/Makefile.hpux overrule these env vars, which means that I still have to modify src/Makefile.global Note again that I am on HP-UX 11.31 on Itanium (not PA-RISC) and that I am compiling a 64bitall environment. HP-UX 11.31/64 U rx2660/64 Itanium 2 9100/1710(2) ia64 4075 Mb This is perl, v5.10.1 (*) built for IA64.ARCHREV_0-LP64 /pro/pgsql/bin/psql: ELF-64 executable object file - IA64 psql (PostgreSQL) 8.4.5 Below is the diff between what was generated by default on 8.4.5 and after what I changed to make it work. Note that I did not alter either the template not the specific original makefile to do so automatically. I can (try to) do so if you would like to see how I would do that After make, these are the essential diffs: --8<--- diff -purd postgresql-8.4.5-org/config.status postgresql-8.4.5/config.status --- postgresql-8.4.5-org/config.status 2010-12-20 11:52:19 +0100 +++ postgresql-8.4.5/config.status 2010-12-20 12:04:26 +0100 @@ -567,7 +567,7 @@ s,@enable_dtrace@,|#_!!_#|no,g s,@CC@,|#_!!_#|cc -Ae,g s,@CFLAGS@,|#_!!_#|-Ae -z +Z +DD64 -O2,g s,@LDFLAGS@,|#_!!_#| -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 ,g -s,@CPPFLAGS@,|#_!!_#| -D_XOPEN_SOURCE_EXTENDED ,g +s,@CPPFLAGS@,|#_!!_#| ,g s,@ac_ct_CC@,|#_!!_#|,g s,@EXEEXT@,|#_!!_#|,g s,@OBJEXT@,|#_!!_#|o,g @@ -981,8 +981,8 @@ s,^\([ #]*\)[^ ]*\([ ]*SIZEOF_OFF_T\) s,^\([ #]*\)[^ ]*\([ ]*HAVE_INT_TIMEZONE\)[ (].*,\1define\2 , s,^\([ #]*\)[^ ]*\([ ]*ACCEPT_TYPE_RETURN\)[ (].*,\1define\2 int , s,^\([ #]*\)[^ ]*\([ ]*ACCEPT_TYPE_ARG1\)[ (].*,\1define\2 int , -s,^\([ #]*\)[^ ]*\([ ]*ACCEPT_TYPE_ARG2\)[ (].*,\1define\2 struct sockaddr * , -s,^\([ #]*\)[^ ]*\([ ]*ACCEPT_TYPE_ARG3\)[ (].*,\1define\2 size_t , +s,^\([ #]*\)[^ ]*\([ ]*ACCEPT_TYPE_ARG2\)[ (].*,\1define\2 void * , +s,^\([ #]*\)[^ ]*\([ ]*ACCEPT_TYPE_ARG3\)[ (].*,\1define\2 int , s,^\([ #]*\)[^ ]*\([ ]*HAVE_CBRT\)[ (].*,\1define\2 1 , s,^\([ #]*\)[^ ]*\([ ]*HAVE_DLOPEN\)[ (].*,\1define\2 1 , s,^\([ #]*\)[^ ]*\([ ]*HAVE_FCVT\)[ (].*,\1define\2 1 , diff -purd postgresql-8.4.5-org/src/Makefile.global postgresql-8.4.5/src/Makefile.global --- postgresql-8.4.5-org/src/Makefile.global 2010-12-20 11:52:19 +0100 +++ postgresql-8.4.5/src/Makefile.global 2010-12-20 12:05:17 +0100 @@ -199,8 +199,8 @@ DOCBOOK2MAN = # Compilers -CPP = cc -Ae -E -CPPFLAGS = -D_XOPEN_SOURCE_EXTENDED +CPP = cc -E +CPPFLAGS = ifdef PGXS override CPPFLAGS := -I$(includedir_server) -I$(includedir_internal) $(CPPFLAGS) @@ -211,7 +211,7 @@ override CPPFLAGS := -I$(top_builddir)/s endif endif # not PGXS -CC = cc -Ae +CC = cc GCC = SUN_STUDIO_CC = no CFLAGS = -Ae -z +Z +DD64 -O2 diff -purd postgresql-8.4.5-org/src/Makefile.port postgresql-8.4.5/src/Makefile.port --- postgresql-8.4.5-org/src/Makefile.port 2010-10-01 15:35:31 +0200 +++ postgresql-8.4.5/src/Makefile.port 2010-12-20 11:58:53 +0100 @@ -8,7 +8,7 @@ endif # Using X/Open Networking Interfaces requires to link with libxnet. # Without specifying this, bind(), getpeername() and so on don't work # correctly in the LP64 data model. -LIBS := -lxnet $(LIBS) +#LIBS := -lxnet $(LIBS) # Set up rpath so that the executables don't need SHLIB_PATH to be set. # (Note: --disable-rpath is a really bad idea on this platform...) diff -purd postgresql-8.4.5-org/src/include/pg_config.h postgresql-8.4.5/src/include/pg_config.h --- postgresql-8.4.5-org/src/include/pg_config.h 2010-12-20 11:52:19 +0100 +++ postgresql-8.4.5/src/include/pg_config.h 2010-12-20 12:04:27 +0100 @@ -5,10 +5,10 @@ #define ACCEPT_TYPE_ARG1 int /* Define to the type of arg 2 of 'accept' */ -#define ACCEPT_TYPE_ARG2 struct sockaddr * +#define ACCEPT_TYPE_ARG2 void * /* Define to the type of arg 3 of 'accept' */ -#define ACCEPT_TYPE_ARG3 size_t +#define ACCEPT_TYPE_ARG3 int /* Define to the return type of 'accept' */ #define ACCEPT_TYPE_RETURN int diff -purd postgresql-8.4.5-org/src/makefiles/Makefile.hpux postgresql-8.4.5/src/makefiles/Makefile.hpux --- postgresql-8.4.5-org/src/makefiles/Makefile.hpux 2010-10-01 15:35:31 +0200 +++ postgresql-8.4.5/src/makefiles/Makefile.hpux 2010-12-20 11:58:53 +0100 @@ -8,7 +8,7 @@ endif # Using X/Open Networking Interfaces requires to link with libxnet. # Without specifying this, bind(), getpeername() and so on don't work # correctly in the LP64 data model. -LIBS := -lxnet $(LIBS) +#LIBS := -lxnet $(LIBS) # Set up rpath so that the executables don't need SHLIB_PATH to be set. # (Note: --disable-rpath is a really bad idea on this platform...) diff -purd postgresql-8.4.5-org/src/template/hpux postgresql-8.4.5/src/template/hpux --- postgresql-8.4.5-org/src/template/hpux 2010-10-01 15:35:31 +0200 +++ postgresql-8.4.5/src/template/hpux 2010-12-20 11:58:20 +0100 @@ -1,6 +1,6 @@ # $PostgreSQL: pgsql/src/template/hpux,v 1.16 2006/12/12 19:43:19 petere Exp $ -CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE_EXTENDED" +#CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE_EXTENDED" if test "$GCC" != yes ; then CC="$CC -Ae" -->8--- -- 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/