Thread: HP-UX PA-RISC/Itanium 64-bit Patch and HP-UX 11.23 Patch

HP-UX PA-RISC/Itanium 64-bit Patch and HP-UX 11.23 Patch

From
Shinji Teragaito
Date:
Hi,

  I made a patch to let PostgreSQL work in the LP64 data model on
  HP-UX PA-RISC and HP-UX Itanium platform. Also this patch contains
  tas code for HP-UX Itanium.

  I verified this patch on the following environment and specified as
  followings at executing configure script:

  * HP-UX 11.11 PA-RISC

    PHSS_30766  s700_800 ANSI C compiler B.11.11.10 cumulative patch
    PHSS_30966  s700_800 ld(1) and linker tools cumulative patch
    PHCO_30269  s700_800 cumulative sh-posix(1) patch
    PHCO_29816  s700_800 rc(1M) scripts cumulative patch
    gcc (GCC) 3.4.1

    1) env CC=cc ./configure --without-readline --without-zlib

    2) env CC=cc CFLAGS=+DD64 ./configure --without-readline \
       --without-zlib

       Note: you may specify +DA2.0W instead of +DD64

    3) env CC=gcc ./configure --without-readline --without-zlib

    4) env CC=/usr/local/pa64/bin/gcc ./configure --without-readline \
       --without-zlib

    The regression test has no problem to all 96 tests in the 4 cases
    above.

  * HP-UX 11.23 Itanium

    PHSS_30848  s700_800 HP C Compiler (A.05.57)
    PHSS_30849  s700_800 u2comp/be/plugin library Patch
    gcc (GCC) 3.4.1

    1) env CC=cc CFLAGS="+O2" ./configure --without-readline \
       --without-zlib

    2) env CC=cc CFLAGS="+O2 +DD64" ./configure --without-readline \
       --without-zlib

    3) env CC=gcc CFLAGS="-O2" ./configure --without-readline \
       --without-zlib

    4) env CC=gcc CFLAGS="-O2 -mlp64" ./configure --without-readline \
       --without-zlib

    Only 'float8' of the regression test fails in the 4 cases above.

Cheers,

Shinji Teragaito
Hewlett-Packard Japan, Ltd.

P.S. First I made this patch for PostgreSQL 7.4.3. It's easy to
backport this patch to 7.4.3. But please be carefull to build 7.4.3 on
HP-UX 11.23 (aka HP-UX 11i v2 for HP Integrity Server): you must
specify "cc -E +legacy_cpp" in CPP at running configure. Otherwise you
will see the concatenation problem caused by genbki.sh. Now you don't
need to specify CPP to the CVS tree source code because the latest
genbki.sh doesn't use the preprocessor.


Attachment

Re: HP-UX PA-RISC/Itanium 64-bit Patch and HP-UX 11.23 Patch

From
Tom Lane
Date:
Shinji Teragaito <shinji@kobe.hp.com> writes:
>   I made a patch to let PostgreSQL work in the LP64 data model on
>   HP-UX PA-RISC and HP-UX Itanium platform.

The s_lock change looks good ... but ...

This patch seems likely to break many other platforms.  You do not
seriously expect us to apply that change to float8.out, do you?

I'd also like to know the rationale for the Makefile.shlib changes
(which did not seem to be needed the last time I tested on HPUX 11)
and the -lxnet addition to Makefile.hpux (ditto).

            regards, tom lane

Re: HP-UX PA-RISC/Itanium 64-bit Patch and HP-UX 11.23 Patch

From
Shinji Teragaito
Date:
>> On Tue, 24 Aug 2004 00:39:55 -0400, Tom Lane <tgl@sss.pgh.pa.us> said:

> Shinji Teragaito <shinji@kobe.hp.com> writes:
>> I made a patch to let PostgreSQL work in the LP64 data model on
>> HP-UX PA-RISC and HP-UX Itanium platform.

> The s_lock change looks good ... but ...

> This patch seems likely to break many other platforms.  You do not
> seriously expect us to apply that change to float8.out, do you?

  No.

> I'd also like to know the rationale for the Makefile.shlib changes
> (which did not seem to be needed the last time I tested on HPUX 11)
> and the -lxnet addition to Makefile.hpux (ditto).

  * Makefile.shlib changes are required to link libgcc.a 64-bit
    version correctly on HP-UX 11.23 (Itanium). Without specifying
    -mlp64 in LDFLAGS, you will get libgcc.a 32-bit version. Then
    linking libpq.so.3 with ld, you will see the following error:

        /usr/ccs/bin/ld +h libpq.so.3 -b +b /usr/local/pgsql/lib
        fe-auth.o ..(snip).. `gcc -print-libgcc-file-name` -o libpq.so.3

        ld: Mismatched Data ABI. Expected EF_IA_64_ABI64 but found None in file
        /usr/local/lib/gcc/ia64-hp-hpux11.23/3.4.1/libgcc.a[__divdi3.oS]

    To link 64-bit object files with libgcc.a, libgcc.a must be
    64-bit.

    On the other hand, the changes to SHLIB_LINK is not required for
    PA-RISC HP-UX. Becase the gcc binaries are seperated for 32-bit
    and 64-bit uses respectively. According to the data model, ILP32
    or LP64, you will select the appropriate gcc binary. Then `$(CC)
    -print-libgcc-file-name` results to be the correct libgcc.a.

  * When you specify _XOPEN_SOURCE_EXTENDED in CFLAGS, X/Open
    Networking Interfaces doesn't work in LP64 data model without
    linking with libxnet. The third parameter type in sockets and IP
    resolution interfaces such as bind() and getpeername() is defined
    as socklen_t. socklen_t is typedefed as size_t, which is typedefed
    as unsigned long. In LP64 data model, size_t results to be
    64-bit. But inside the HP-UX X/Open Networking Interfaces
    implementation, the third parameter is expected as 32-bit
    length. To work around this problem in LP64 data model especially,
    the -lxnet addition to Makefile.hpux is required.

    Refer to man 7 xopen_networking.

Cheers,

Shinji Teragaito
Hewlett-Packard Japan, Ltd.


Re: HP-UX PA-RISC/Itanium 64-bit Patch and HP-UX 11.23 Patch

From
Bruce Momjian
Date:
This has been applied and will be in beta3.

---------------------------------------------------------------------------

Shinji Teragaito wrote:
> >> On Tue, 24 Aug 2004 00:39:55 -0400, Tom Lane <tgl@sss.pgh.pa.us> said:
>
> > Shinji Teragaito <shinji@kobe.hp.com> writes:
> >> I made a patch to let PostgreSQL work in the LP64 data model on
> >> HP-UX PA-RISC and HP-UX Itanium platform.
>
> > The s_lock change looks good ... but ...
>
> > This patch seems likely to break many other platforms.  You do not
> > seriously expect us to apply that change to float8.out, do you?
>
>   No.
>
> > I'd also like to know the rationale for the Makefile.shlib changes
> > (which did not seem to be needed the last time I tested on HPUX 11)
> > and the -lxnet addition to Makefile.hpux (ditto).
>
>   * Makefile.shlib changes are required to link libgcc.a 64-bit
>     version correctly on HP-UX 11.23 (Itanium). Without specifying
>     -mlp64 in LDFLAGS, you will get libgcc.a 32-bit version. Then
>     linking libpq.so.3 with ld, you will see the following error:
>
>         /usr/ccs/bin/ld +h libpq.so.3 -b +b /usr/local/pgsql/lib
>         fe-auth.o ..(snip).. `gcc -print-libgcc-file-name` -o libpq.so.3
>
>         ld: Mismatched Data ABI. Expected EF_IA_64_ABI64 but found None in file
>         /usr/local/lib/gcc/ia64-hp-hpux11.23/3.4.1/libgcc.a[__divdi3.oS]
>
>     To link 64-bit object files with libgcc.a, libgcc.a must be
>     64-bit.
>
>     On the other hand, the changes to SHLIB_LINK is not required for
>     PA-RISC HP-UX. Becase the gcc binaries are seperated for 32-bit
>     and 64-bit uses respectively. According to the data model, ILP32
>     or LP64, you will select the appropriate gcc binary. Then `$(CC)
>     -print-libgcc-file-name` results to be the correct libgcc.a.
>
>   * When you specify _XOPEN_SOURCE_EXTENDED in CFLAGS, X/Open
>     Networking Interfaces doesn't work in LP64 data model without
>     linking with libxnet. The third parameter type in sockets and IP
>     resolution interfaces such as bind() and getpeername() is defined
>     as socklen_t. socklen_t is typedefed as size_t, which is typedefed
>     as unsigned long. In LP64 data model, size_t results to be
>     64-bit. But inside the HP-UX X/Open Networking Interfaces
>     implementation, the third parameter is expected as 32-bit
>     length. To work around this problem in LP64 data model especially,
>     the -lxnet addition to Makefile.hpux is required.
>
>     Refer to man 7 xopen_networking.
>
> Cheers,
>
> Shinji Teragaito
> Hewlett-Packard Japan, Ltd.
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org
>

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

Re: HP-UX PA-RISC/Itanium 64-bit Patch and HP-UX 11.23 Patch

From
"Ed L."
Date:
> > > Shinji Teragaito <shinji@kobe.hp.com> writes:
> > >> I made a patch to let PostgreSQL work in the LP64 data model on
> > >> HP-UX PA-RISC and HP-UX Itanium platform.

I see Shinji's patch changed the library suffix from .sl to .so for ia64.
Is that is necessary?  If so, why?

Thanks,
Ed


Re: HP-UX PA-RISC/Itanium 64-bit Patch and HP-UX 11.23 Patch

From
Shinji Teragaito
Date:
>> On Tue, 26 Oct 2004 21:27:13 -0600, "Ed L." <pgsql@bluepolka.net> said:

>> > > Shinji Teragaito <shinji@kobe.hp.com> writes:
>> > >> I made a patch to let PostgreSQL work in the LP64 data model on
>> > >> HP-UX PA-RISC and HP-UX Itanium platform.

> I see Shinji's patch changed the library suffix from .sl to .so for ia64.
> Is that is necessary?  If so, why?

  HP-UX Itanium native shared library suffix is ".so", not ".sl".
  My patch conforms to such a convention.

  Please take a look at the directory /usr/lib/hpux{32,64}. Note ".sl"
  libraries under /usr/lib and /usr/lib/pa{1.1,2.0,20_32,20_64} are PA
  binaries for Aries.

Cheers,

Shinji