File tree 4 files changed +49
-6
lines changed
4 files changed +49
-6
lines changed Original file line number Diff line number Diff line change 6
6
# Copyright (c) 1998, Regents of the University of California
7
7
#
8
8
# IDENTIFICATION
9
- # $PostgreSQL: pgsql/src/Makefile.shlib,v 1.100 2005/12/09 21:19:34 petere Exp $
9
+ # $PostgreSQL: pgsql/src/Makefile.shlib,v 1.101 2005/12/30 21:43:41 momjian Exp $
10
10
#
11
11
#-------------------------------------------------------------------------
12
12
@@ -193,7 +193,7 @@ ifeq ($(PORTNAME), solaris)
193
193
ifeq ($(GCC), yes)
194
194
LINK.shared = $(CC) -shared
195
195
else
196
- LINK.shared = $(CC) -G
196
+ LINK.shared = $(CC) -G $(CFLAGS) # CFLAGS added for X86_64
197
197
endif
198
198
ifeq ($(with_gnu_ld), yes)
199
199
LINK.shared += -Wl,-soname,$(soname)
Original file line number Diff line number Diff line change
1
+ /=============================================================================
2
+ / tas.s -- test and set lock for solaris_i386
3
+ / based on i386 ASM with modifications outlined in
4
+ / http://www.x86-64.org/documentation/assembly
5
+ /=============================================================================
6
+
7
+ .file "tas.s"
8
+ .text
9
+ .align 16
10
+ .L1.text:
11
+
12
+ .globl tas
13
+ tas:
14
+ pushq %rbp /save prev base pointer
15
+ movq %rsp ,%rbp /new base pointer
16
+ pushq %rbx /save prev bx
17
+ movq 8 (%rbp ),%rbx /load bx with address of lock
18
+ movq $255 ,%rax /put something in ax
19
+ xchgb %al ,(%rbx ) /swap lock value with "0"
20
+ cmpb $0 ,%al /did we get the lock ?
21
+ jne .Locked
22
+ subq %rax ,%rax /yes, we got it -- return 0
23
+ jmp .Finish
24
+ .align 8
25
+ .Locked:
26
+ movq $1 ,%rax /no, we didn't get it - return 1
27
+ .Finish:
28
+ popq %rbx /restore prev bx
29
+ movq %rbp ,%rsp /restore stack state
30
+ popq %rbp
31
+ ret /return
32
+ .align 8
33
+ .type tas,@function
34
+ .size tas,.-tas
35
+
Original file line number Diff line number Diff line change 66
66
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
67
67
* Portions Copyright (c) 1994, Regents of the University of California
68
68
*
69
- * $PostgreSQL: pgsql/src/include/storage/s_lock.h,v 1.145 2005/12/17 21:08:24 momjian Exp $
69
+ * $PostgreSQL: pgsql/src/include/storage/s_lock.h,v 1.146 2005/12/30 21:43:41 momjian Exp $
70
70
*
71
71
*-------------------------------------------------------------------------
72
72
*/
@@ -791,7 +791,8 @@ typedef unsigned char slock_t;
791
791
792
792
/* out-of-line assembler from src/backend/port/tas/foo.s */
793
793
794
- #if defined(__sun ) && defined(__i386 ) /* i386 using Sun compiler */
794
+ /* i386/X86_64 using Sun compiler */
795
+ #if defined(__sun ) && (defined(__i386 ) || defined(__x86_64__ ))
795
796
/*
796
797
* Solaris/386 (we only get here for non-gcc case)
797
798
*/
Original file line number Diff line number Diff line change @@ -17,8 +17,15 @@ case $host in
17
17
;;
18
18
i?86-*-solaris*)
19
19
if test "$GCC" != yes ; then
20
- need_tas=yes
21
- tas_file=solaris_i386.s
20
+ soarch=`isainfo`
21
+ if isainfo | grep amd64
22
+ then
23
+ need_tas=yes
24
+ tas_file=solaris_x86_64.s
25
+ else
26
+ need_tas=yes
27
+ tas_file=solaris_i386.s
28
+ fi
22
29
fi
23
30
;;
24
31
esac
You can’t perform that action at this time.
0 commit comments