Subject: PostgreSQL Patch: Modified Test-and-set routine for HP-UX (IA-64) specifically for the HP-C compiler
 
With reference to Tom Lane's response to our previous patch request  (at
http://archives.postgresql.org/pgsql-bugs/2003-10/msg00149.php)
this is a modified and more focussed patch request for PostgreSQL for for HP-UX
11i V2  for the Intel Itanium architecture  (known to the PostgreSQL code as
IA-64).
 
The patch is required for HP-UX customers who want to compile the product
with the HP-C compiler. We have a significant number of HP-UX users who want
to build PostgreSQL on the IA-64 platform, but with the HP-C compiler.
 
The primary content of this patch is inline tas code that will build with HP-C. 
There is one side-effect (described later) of using HP-C, also addressed by the
patch.
 
The target version is PostgreSQL 7.4.

We have downloaded the source (on Nov 18), applied the patch, and have tested
it successfully.
 
Note: HP-UX users building the product with the gcc compiler can use
the 7.4 version (or even the 7.3.4 version).
 
Details for the patch are in the attached template file. A summary is provided
here:

Version: PostgreSQL 7.4
 
Files modified:
 
1.  s_lock.h: modified with inline tas code for the HP-C compiler
 
2.  genbki.sh: a one-line change that fixes a string concatenation problem with the
    HP-C compiler (specific to included .c files).
 
thanks
ViSolve OpenSource Team (for HP)
 

Attachment: PostgreSQL_74_taspatch_hpux_ia64_hpc.patch
Description: Binary data

============================================================================
                        POSTGRESQL BUG REPORT TEMPLATE
============================================================================

Your name               :       ViSolve OpenSource team (for HP)
Your email address      :       [EMAIL PROTECTED]


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. 

============================================================================

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Reply via email to