============================================================================ POSTGRESQL BUG REPORT TEMPLATE ============================================================================ Your name : ViSolve OpenSource team (for HP) Your email address : opensrc_support_hp@visolve.com System Configuration --------------------- Architecture (example: Intel Pentium) : Intel Itanium Operating System (example: Linux 2.0.26 ELF) : HP-UX 11.2x PostgreSQL version (example: PostgreSQL-7.3.4): PostgreSQL-7.4 Compiler used (example: gcc 2.95.2) : HP-C for HP-UX IA-64 Please enter a FULL description of your problem: ------------------------------------------------ This patch will allow HP-UX users to build the PostgreSQL 7.4 code correctly using the HP-C compiler, with the appropriate (inline) tas code that will work for HP-UX IA-64. We have a significant number of HP customers who want to build PostgreSQL on this platform, but with HP-C instead of gcc. The IA-64 inline tas code that comes with the 7.4 version is gcc-specific, and hence the need for this patch. Please describe a way to repeat the problem. Please try to provide a concise reproducible example, if at all possible: ---------------------------------------------------------------------- There are 2 problems here: 1. The current gcc-specific inline tas code (for IA-64) in s_lock.h will not compile with HP-c 2. There is an additional issue (unrelated to tas) related to HP-C generating incorrect code in postgres.bki. If you know how this problem might be fixed, list the solution below: --------------------------------------------------------------------- The attached patch fixes the problems described above. The patch modifies two files: 1. s_lock.h: modified to include inline tas code that can be compiled by the HP-C compiler. 2. genbki.sh: modified to correctly generate postgres.bki using HP-C. Without this modification, the HP-C environment generates bad code in postgres.bki that causes several functions to fail. One example of bad code is shown below: With gcc: insert OID = 1296 ( timedate_pl 11 1 14 f f t f i 2 1114 "1083 1082" "select ($2 + $1)" - _null_ ) with HP-C: insert OID = 1296 ( timedate_pl 11 1 14 f f t f i 2 1114 "1083 1082select ($2 + $1)" - _null_ ) The HP-C compiler concatenates adjacent double-quoted strings into a single string. It does this only for .c files. That is the problem. Our fix consists of a one-line change. The line: TMPFILE = "$TMPDIR/genbkitmp.c" is modified to: TMPFILE = "$TMPDIR/genbkitmp.h" The gcc compiler does not care whether an included file is .c or .h, so other platforms will not be impacted. FYI, some relevant discussion can also be found at http://archives.postgresql.org/pgsql-general/2003-01/msg00924.php If you don't find this one-line change appropriate, we will need to manually change it each time we get a new PostgreSQL version - not ideal, but not too bad either. The s_lock.h modification has been coded to be used only by the HP-C compiler. Note: We also noticed that the 7.4(STABLE) version has already modified the configure.in file to explicitly provide a tas_file name for hppa*-*-hpux* thereby excluding IA-64 from the list. This is different from the 7.3.4 version where the tas_file name was provided for *-*-hpux* That being the case, the 7.4 configure.in is already set up for this attached patch, and needs no further modifications. ============================================================================