dbTalk Databases Forums  

Re: [BUGS] Sun inline assembler ...

mailing.database.pgsql-bugs mailing.database.pgsql-bugs


Discuss Re: [BUGS] Sun inline assembler ... in the mailing.database.pgsql-bugs forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Michael Fuhr
 
Posts: n/a

Default Re: [BUGS] Sun inline assembler ... - 07-07-2005 , 10:10 AM






On Thu, Jul 07, 2005 at 04:53:16PM +0200, Hans-Jürgen Schönig wrote:
Quote:
I have some minor troubles when using the Sun Compiler 9 on Solaris 9.
The spinlock assembler code is somehow broken for Solaris 9 and Solaris
10 (it works for Sun CC 8).

The following patch fixes this:

[hs@localhost postgresql-8.0.1]$ cd src/backend/storage/lmgr/
[hs@localhost lmgr]$ diff s_lock.c /tmp/fixed_s_lock.c
248,249c248,249
asm(".section \"data\"");
asm(".section \"text\"");
---
asm(".seg \"data\"");
asm(".seg \"text\"");
There's already an #ifdef around that code -- is it not matching
correctly for your compiler? Here's what I see in REL8_0_STABLE
and in HEAD (s_lock.c 1.35):

244 #ifdef SUNOS4_CC
245 asm(".seg \"data\"");
246 asm(".seg \"text\"");
247 #else
248 asm(".section \"data\"");
249 asm(".section \"text\"");
250 #endif

This looks like the thread that led to the above code:

http://archives.postgresql.org/pgsql...2/msg00213.php

--
Michael Fuhr
http://www.fuhr.org/~mfuhr/

---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings


Reply With Quote
  #2  
Old   
Tom Lane
 
Posts: n/a

Default Re: [BUGS] Sun inline assembler ... - 07-07-2005 , 10:29 AM






Quote:
Here's what I see in REL8_0_STABLE
and in HEAD (s_lock.c 1.35):

244 #ifdef SUNOS4_CC
245 asm(".seg \"data\"");
246 asm(".seg \"text\"");
247 #else
248 asm(".section \"data\"");
249 asm(".section \"text\"");
250 #endif
I see that template/sunos4 adds -DSUNOS4_CC to CFLAGS, but template/solaris
does not. Maybe it should too? I'm not real clear about which platforms
each of those templates gets used on.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo (AT) postgresql (DOT) org so that your
message can get through to the mailing list cleanly


Reply With Quote
  #3  
Old   
John R Pierce
 
Posts: n/a

Default Re: [BUGS] Sun inline assembler ... - 07-07-2005 , 12:15 PM



Tom Lane wrote:
Quote:
Here's what I see in REL8_0_STABLE
and in HEAD (s_lock.c 1.35):

244 #ifdef SUNOS4_CC
245 asm(".seg \"data\"");
246 asm(".seg \"text\"");
247 #else
248 asm(".section \"data\"");
249 asm(".section \"text\"");
250 #endif


I see that template/sunos4 adds -DSUNOS4_CC to CFLAGS, but template/solaris
does not. Maybe it should too? I'm not real clear about which platforms
each of those templates gets used on.
as a random reminder for those who don't deal with sun... Solaris is SunOS 5.x,
currently 5.9 and now 5.10. To get really confusing, they called it Solaris
2.x up to 2.6 (actually SunOS 5.7), then Solaris 7 was 2.7/5.7

solaris ver sunos ver
Solaris 1.3 SunOS 4.3
Solaris 2.5.1 SunOS 5.5.1
Solaris 2.6 SunOS 5.6
Solaris 7 SunOS 5.7
Solaris 8 SunOS 5.8
Solaris 9 SunOS 5.9

this is nearly as bad as Java versioning.

Java 1.x
Java 2
Java 2.1
Java 2.1.1 -> Java2 release 1.1
Java 2.1.4.2 -> Java2 1.4.2
Java 2.5 -> J2SE 5.0

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo (AT) postgresql (DOT) org so that your
message can get through to the mailing list cleanly


Reply With Quote
  #4  
Old   
Bruce Momjian
 
Posts: n/a

Default Re: [BUGS] Sun inline assembler ... - 07-29-2005 , 10:07 PM



--ELM1122692659-23209-0_
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset=US-ASCII


I have applied the following patch to fix this, hopefully.

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

John R Pierce wrote:
Quote:
Tom Lane wrote:
Here's what I see in REL8_0_STABLE
and in HEAD (s_lock.c 1.35):

244 #ifdef SUNOS4_CC
245 asm(".seg \"data\"");
246 asm(".seg \"text\"");
247 #else
248 asm(".section \"data\"");
249 asm(".section \"text\"");
250 #endif


I see that template/sunos4 adds -DSUNOS4_CC to CFLAGS, but template/solaris
does not. Maybe it should too? I'm not real clear about which platforms
each of those templates gets used on.

as a random reminder for those who don't deal with sun... Solaris is SunOS 5.x,
currently 5.9 and now 5.10. To get really confusing, they called it Solaris
2.x up to 2.6 (actually SunOS 5.7), then Solaris 7 was 2.7/5.7

solaris ver sunos ver
Solaris 1.3 SunOS 4.3
Solaris 2.5.1 SunOS 5.5.1
Solaris 2.6 SunOS 5.6
Solaris 7 SunOS 5.7
Solaris 8 SunOS 5.8
Solaris 9 SunOS 5.9

this is nearly as bad as Java versioning.

Java 1.x
Java 2
Java 2.1
Java 2.1.1 -> Java2 release 1.1
Java 2.1.4.2 -> Java2 1.4.2
Java 2.5 -> J2SE 5.0

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo (AT) postgresql (DOT) org so that your
message can get through to the mailing list cleanly

--
Bruce Momjian | http://candle.pha.pa.us
pgman (AT) candle (DOT) 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

--ELM1122692659-23209-0_
Content-Transfer-Encoding: 7bit
Content-Type: text/plain
Content-Disposition: inline; filename="/bjm/diff"

Index: src/backend/storage/lmgr/s_lock.c
================================================== =================
RCS file: /cvsroot/pgsql/src/backend/storage/lmgr/s_lock.c,v
retrieving revision 1.35
diff -c -c -r1.35 s_lock.c
*** src/backend/storage/lmgr/s_lock.c 31 Dec 2004 22:01:05 -0000 1.35
--- src/backend/storage/lmgr/s_lock.c 30 Jul 2005 03:03:20 -0000
***************
*** 241,247 ****
* *lock); */
{

! #ifdef SUNOS4_CC
asm(".seg \"data\"");
asm(".seg \"text\"");
#else
--- 241,247 ----
* *lock); */
{

! #ifdef SUNOS_CC
asm(".seg \"data\"");
asm(".seg \"text\"");
#else
Index: src/template/solaris
================================================== =================
RCS file: /cvsroot/pgsql/src/template/solaris,v
retrieving revision 1.22
diff -c -c -r1.22 solaris
*** src/template/solaris 2 Dec 2004 18:11:40 -0000 1.22
--- src/template/solaris 30 Jul 2005 03:03:21 -0000
***************
*** 1,6 ****
if test "$GCC" != yes ; then
CC="$CC -Xa" # relaxed ISO C mode
! CFLAGS="-v" # -v is like gcc -Wall
if test "$enable_debug" != yes; then
CFLAGS="$CFLAGS -O" # any optimization breaks debug
fi
--- 1,6 ----
if test "$GCC" != yes ; then
CC="$CC -Xa" # relaxed ISO C mode
! CFLAGS="-v -DSUNOS_CC" # -v is like gcc -Wall
if test "$enable_debug" != yes; then
CFLAGS="$CFLAGS -O" # any optimization breaks debug
fi
Index: src/template/sunos4
================================================== =================
RCS file: /cvsroot/pgsql/src/template/sunos4,v
retrieving revision 1.4
diff -c -c -r1.4 sunos4
*** src/template/sunos4 29 Dec 2004 23:47:40 -0000 1.4
--- src/template/sunos4 30 Jul 2005 03:03:21 -0000
***************
*** 1,6 ****
if test "$GCC" != yes ; then
CC="$CC -Xa" # relaxed ISO C mode
! CFLAGS="-v -DSUNOS4_CC" # -v is like gcc -Wall
if test "$enable_debug" != yes; then
CFLAGS="$CFLAGS -O" # any optimization breaks debug
fi
--- 1,6 ----
if test "$GCC" != yes ; then
CC="$CC -Xa" # relaxed ISO C mode
! CFLAGS="-v -DSUNOS_CC" # -v is like gcc -Wall
if test "$enable_debug" != yes; then
CFLAGS="$CFLAGS -O" # any optimization breaks debug
fi

--ELM1122692659-23209-0_
Content-Type: text/plain
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0


---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

--ELM1122692659-23209-0_--


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



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.