Add support for Solaris x86_64 using Sun's compiler.
Pierre Girard
This commit is contained in:
parent
c876d965f5
commit
12af9cdff4
@ -6,7 +6,7 @@
|
|||||||
# Copyright (c) 1998, Regents of the University of California
|
# Copyright (c) 1998, Regents of the University of California
|
||||||
#
|
#
|
||||||
# IDENTIFICATION
|
# IDENTIFICATION
|
||||||
# $PostgreSQL: pgsql/src/Makefile.shlib,v 1.100 2005/12/09 21:19:34 petere Exp $
|
# $PostgreSQL: pgsql/src/Makefile.shlib,v 1.101 2005/12/30 21:43:41 momjian Exp $
|
||||||
#
|
#
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
|
|
||||||
@ -193,7 +193,7 @@ ifeq ($(PORTNAME), solaris)
|
|||||||
ifeq ($(GCC), yes)
|
ifeq ($(GCC), yes)
|
||||||
LINK.shared = $(CC) -shared
|
LINK.shared = $(CC) -shared
|
||||||
else
|
else
|
||||||
LINK.shared = $(CC) -G
|
LINK.shared = $(CC) -G $(CFLAGS) # CFLAGS added for X86_64
|
||||||
endif
|
endif
|
||||||
ifeq ($(with_gnu_ld), yes)
|
ifeq ($(with_gnu_ld), yes)
|
||||||
LINK.shared += -Wl,-soname,$(soname)
|
LINK.shared += -Wl,-soname,$(soname)
|
||||||
|
35
src/backend/port/tas/solaris_x86_64.s
Normal file
35
src/backend/port/tas/solaris_x86_64.s
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
/=============================================================================
|
||||||
|
/ tas.s -- test and set lock for solaris_i386
|
||||||
|
/ based on i386 ASM with modifications outlined in
|
||||||
|
/ http://www.x86-64.org/documentation/assembly
|
||||||
|
/=============================================================================
|
||||||
|
|
||||||
|
.file "tas.s"
|
||||||
|
.text
|
||||||
|
.align 16
|
||||||
|
.L1.text:
|
||||||
|
|
||||||
|
.globl tas
|
||||||
|
tas:
|
||||||
|
pushq %rbp /save prev base pointer
|
||||||
|
movq %rsp,%rbp /new base pointer
|
||||||
|
pushq %rbx /save prev bx
|
||||||
|
movq 8(%rbp),%rbx /load bx with address of lock
|
||||||
|
movq $255,%rax /put something in ax
|
||||||
|
xchgb %al,(%rbx) /swap lock value with "0"
|
||||||
|
cmpb $0,%al /did we get the lock?
|
||||||
|
jne .Locked
|
||||||
|
subq %rax,%rax /yes, we got it -- return 0
|
||||||
|
jmp .Finish
|
||||||
|
.align 8
|
||||||
|
.Locked:
|
||||||
|
movq $1,%rax /no, we didn't get it - return 1
|
||||||
|
.Finish:
|
||||||
|
popq %rbx /restore prev bx
|
||||||
|
movq %rbp,%rsp /restore stack state
|
||||||
|
popq %rbp
|
||||||
|
ret /return
|
||||||
|
.align 8
|
||||||
|
.type tas,@function
|
||||||
|
.size tas,.-tas
|
||||||
|
|
@ -66,7 +66,7 @@
|
|||||||
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
|
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
|
||||||
* Portions Copyright (c) 1994, Regents of the University of California
|
* Portions Copyright (c) 1994, Regents of the University of California
|
||||||
*
|
*
|
||||||
* $PostgreSQL: pgsql/src/include/storage/s_lock.h,v 1.145 2005/12/17 21:08:24 momjian Exp $
|
* $PostgreSQL: pgsql/src/include/storage/s_lock.h,v 1.146 2005/12/30 21:43:41 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -791,7 +791,8 @@ typedef unsigned char slock_t;
|
|||||||
|
|
||||||
/* out-of-line assembler from src/backend/port/tas/foo.s */
|
/* out-of-line assembler from src/backend/port/tas/foo.s */
|
||||||
|
|
||||||
#if defined(__sun) && defined(__i386) /* i386 using Sun compiler */
|
/* i386/X86_64 using Sun compiler */
|
||||||
|
#if defined(__sun) && (defined(__i386) || defined(__x86_64__))
|
||||||
/*
|
/*
|
||||||
* Solaris/386 (we only get here for non-gcc case)
|
* Solaris/386 (we only get here for non-gcc case)
|
||||||
*/
|
*/
|
||||||
|
@ -17,8 +17,15 @@ case $host in
|
|||||||
;;
|
;;
|
||||||
i?86-*-solaris*)
|
i?86-*-solaris*)
|
||||||
if test "$GCC" != yes ; then
|
if test "$GCC" != yes ; then
|
||||||
need_tas=yes
|
soarch=`isainfo`
|
||||||
tas_file=solaris_i386.s
|
if isainfo | grep amd64
|
||||||
|
then
|
||||||
|
need_tas=yes
|
||||||
|
tas_file=solaris_x86_64.s
|
||||||
|
else
|
||||||
|
need_tas=yes
|
||||||
|
tas_file=solaris_i386.s
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
Loading…
x
Reference in New Issue
Block a user