Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit12af9cd

Browse files
committed
Add support for Solaris x86_64 using Sun's compiler.
Pierre Girard
1 parentc876d96 commit12af9cd

File tree

4 files changed

+49
-6
lines changed

4 files changed

+49
-6
lines changed

‎src/Makefile.shlib

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# Copyright (c) 1998, Regents of the University of California
77
#
88
# 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 $
1010
#
1111
#-------------------------------------------------------------------------
1212

@@ -193,7 +193,7 @@ ifeq ($(PORTNAME), solaris)
193193
ifeq ($(GCC), yes)
194194
LINK.shared= $(CC) -shared
195195
else
196-
LINK.shared= $(CC) -G
196+
LINK.shared= $(CC) -G $(CFLAGS)# CFLAGS added for X86_64
197197
endif
198198
ifeq ($(with_gnu_ld), yes)
199199
LINK.shared+= -Wl,-soname,$(soname)

‎src/backend/port/tas/solaris_x86_64.s

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
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+
.align16
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+
movq8(%rbp),%rbx /load bx with address oflock
18+
movq$255,%rax /put somethingin ax
19+
xchgb%al,(%rbx) /swaplock value with"0"
20+
cmpb$0,%al /did we get thelock?
21+
jne .Locked
22+
subq%rax,%rax /yes, we got it -- return0
23+
jmp .Finish
24+
.align8
25+
.Locked:
26+
movq$1,%rax /no, we didn't get it - return1
27+
.Finish:
28+
popq%rbx /restore prev bx
29+
movq%rbp,%rsp /restore stack state
30+
popq%rbp
31+
ret /return
32+
.align8
33+
.type tas,@function
34+
.size tas,.-tas
35+

‎src/include/storage/s_lock.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
6767
* Portions Copyright (c) 1994, Regents of the University of California
6868
*
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 $
7070
*
7171
*-------------------------------------------------------------------------
7272
*/
@@ -791,7 +791,8 @@ typedef unsigned char slock_t;
791791

792792
/* out-of-line assembler from src/backend/port/tas/foo.s */
793793

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__))
795796
/*
796797
* Solaris/386 (we only get here for non-gcc case)
797798
*/

‎src/template/solaris

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,15 @@ case $host in
1717
;;
1818
i?86-*-solaris*)
1919
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
2229
fi
2330
;;
2431
esac

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp