Unix Technical Forum

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

This is a discussion on fix build on Solaris 10/x86_64 in 64bit mode with Sun Studio 11 within the Pgsql Patches forums, part of the PostgreSQL category; --> on an Intel based Solaris 10U2 box using Sun Studio 11 with -xarch=generic64 we get a compile time failure ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > Pgsql Patches

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-18-2008, 09:15 AM
Stefan Kaltenbrunner
 
Posts: n/a
Default fix build on Solaris 10/x86_64 in 64bit mode with Sun Studio 11

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

--- /export/home/pgbuild/pgbuildfarm/HEAD/pgsql/src/include/port/solaris.h Thu Oct 5 00:49:44 2006
+++ src/include/port/solaris.h Sun Jan 7 09:24:51 2007
@@ -5,6 +5,10 @@
* symbols are defined on both GCC and Solaris CC, although GCC
* doesn't document them. The __xxx__ symbols are only on GCC.
*/
+#if defined(__amd64) && !defined(__amd64__)
+#define __amd64__
+#endif
+
#if defined(__i386) && !defined(__i386__)
#define __i386__
#endif
@@ -34,6 +38,9 @@
#ifdef __i386__
#define BYTE_ORDER LITTLE_ENDIAN
#endif
+#ifdef __amd64__
+#define BYTE_ORDER LITTLE_ENDIAN
+#endif
#endif

/*


---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
choose an index scan if your joining column's datatypes do not
match

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-18-2008, 09:17 AM
Stefan Kaltenbrunner
 
Posts: n/a
Default 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/s...-10%2014:18:23


Stefan

---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-18-2008, 09:17 AM
Tom Lane
 
Posts: n/a
Default 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

---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 04-18-2008, 09:17 AM
Tom Lane
 
Posts: n/a
Default 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

---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 04-18-2008, 09:17 AM
Stefan Kaltenbrunner
 
Posts: n/a
Default 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

---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 12:54 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com