fix build on Solaris 10/x86_64 in 64bit mode with Sun Studio 11

Started by Stefan Kaltenbrunnerover 19 years ago5 messageshackers
Jump to latest
#1Stefan Kaltenbrunner
stefan@kaltenbrunner.cc

on an Intel based Solaris 10U2 box using Sun Studio 11 with
-xarch=generic64 we get a compile time failure in contrib/pgcrypto
because BYTE_ORDER is not defined.

in src/include/port/solaris.h we define it to little endian only for
__i386 - however in 64bit mode the compiler only defines __amd64 causing
YTE_ORDER to be undefined.
The other option would be to use __x86 which is defined on all intel
architectures.

attached is a quick hack to allow pgcrypto to compile on that platform.

Stefan

Attachments:

patch_sol10_amd64.difftext/plain; name=patch_sol10_amd64.diffDownload+7-0
#2Stefan Kaltenbrunner
stefan@kaltenbrunner.cc
In reply to: Stefan Kaltenbrunner (#1)
Re: [PATCHES] fix build on Solaris 10/x86_64 in 64bit mode with Sun

Stefan Kaltenbrunner wrote:

on an Intel based Solaris 10U2 box using Sun Studio 11 with
-xarch=generic64 we get a compile time failure in contrib/pgcrypto
because BYTE_ORDER is not defined.

in src/include/port/solaris.h we define it to little endian only for
__i386 - however in 64bit mode the compiler only defines __amd64 causing
YTE_ORDER to be undefined.
The other option would be to use __x86 which is defined on all intel
architectures.

attached is a quick hack to allow pgcrypto to compile on that platform.

buildfarm report for that issue:

http://www.pgbuildfarm.org/cgi-bin/show_log.pl?nm=clownfish&dt=2007-01-10%2014:18:23

Stefan

#3Tom Lane
tgl@sss.pgh.pa.us
In reply to: Stefan Kaltenbrunner (#1)
Re: [PATCHES] fix build on Solaris 10/x86_64 in 64bit mode with Sun Studio 11

Stefan Kaltenbrunner <stefan@kaltenbrunner.cc> writes:

in src/include/port/solaris.h we define it to little endian only for
__i386 - however in 64bit mode the compiler only defines __amd64 causing
YTE_ORDER to be undefined.
The other option would be to use __x86 which is defined on all intel
architectures.

Shouldn't this use the already-defined __x86_64__ symbol? I assume
that's already defined because otherwise s_lock.h would fail...

regards, tom lane

#4Tom Lane
tgl@sss.pgh.pa.us
In reply to: Stefan Kaltenbrunner (#1)
Re: [PATCHES] fix build on Solaris 10/x86_64 in 64bit mode with Sun Studio 11

Stefan Kaltenbrunner <stefan@kaltenbrunner.cc> writes:

on an Intel based Solaris 10U2 box using Sun Studio 11 with
-xarch=generic64 we get a compile time failure in contrib/pgcrypto
because BYTE_ORDER is not defined.

After further thought I changed this to handle either __amd64 or
__x86_64 (or both). Applied.

regards, tom lane

#5Stefan Kaltenbrunner
stefan@kaltenbrunner.cc
In reply to: Tom Lane (#4)
Re: [PATCHES] fix build on Solaris 10/x86_64 in 64bit mode with Sun

Tom Lane wrote:

Stefan Kaltenbrunner <stefan@kaltenbrunner.cc> writes:

on an Intel based Solaris 10U2 box using Sun Studio 11 with
-xarch=generic64 we get a compile time failure in contrib/pgcrypto
because BYTE_ORDER is not defined.

After further thought I changed this to handle either __amd64 or
__x86_64 (or both). Applied.

I think it defines both at all times - if we want fewer rules in there
we could switch to just testing __x86 f�r both 64bit and 32bit but I
guess it's fine as it stands now.

Stefan