mirror of https://github.com/postgres/postgres
Per discussion, this compiler suite is no longer maintained, and it has not been able to compile PostgreSQL since at least PostgreSQL 17. This removes all the remaining support code for this compiler. Note that the Solaris operating system continues to be supported, but using GCC as the compiler. Reviewed-by: Andres Freund <andres@anarazel.de> Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us> Discussion: https://www.postgresql.org/message-id/flat/a0f817ee-fb86-483a-8a14-b6f7f5991b6e%40eisentraut.orgpull/240/head
parent
e92677e863
commit
25f36066dd
@ -1,53 +0,0 @@ |
||||
!------------------------------------------------------------------------- |
||||
! |
||||
! sunstudio_sparc.s |
||||
! compare and swap for Sun Studio on Sparc |
||||
! |
||||
! Portions Copyright (c) 1996-2025, PostgreSQL Global Development Group |
||||
! Portions Copyright (c) 1994, Regents of the University of California |
||||
! |
||||
! IDENTIFICATION |
||||
! src/backend/port/tas/sunstudio_sparc.s |
||||
! |
||||
!------------------------------------------------------------------------- |
||||
|
||||
! Fortunately the Sun compiler can process cpp conditionals with -P |
||||
|
||||
! '/' is the comment for x86, while '!' is the comment for Sparc |
||||
|
||||
#if defined(__sparcv9) || defined(__sparc) |
||||
|
||||
.section ".text" |
||||
.align 8
|
||||
.skip 24
|
||||
.align 4
|
||||
|
||||
.global pg_atomic_cas
|
||||
pg_atomic_cas: |
||||
|
||||
! "cas" only works on sparcv9 and sparcv8plus chips, and |
||||
! requires a compiler targeting these CPUs. It will fail |
||||
! on a compiler targeting sparcv8, and of course will not |
||||
! be understood by a sparcv8 CPU. gcc continues to use |
||||
! "ldstub" because it targets sparcv7. |
||||
! |
||||
! There is actually a trick for embedding "cas" in a |
||||
! sparcv8-targeted compiler, but it can only be run |
||||
! on a sparcv8plus/v9 cpus: |
||||
! |
||||
! http://cvs.opensolaris.org/source/xref/on/usr/src/lib/libc/sparc/threads/sparc.il |
||||
! |
||||
! NB: We're assuming we're running on a TSO system here - solaris |
||||
! userland luckily always has done so. |
||||
|
||||
#if defined(__sparcv9) || defined(__sparcv8plus) |
||||
cas [%o0],%o2,%o1 |
||||
#else |
||||
ldstub [%o0],%o1 |
||||
#endif |
||||
mov %o1,%o0 |
||||
retl |
||||
nop |
||||
.type pg_atomic_cas,2 |
||||
.size pg_atomic_cas,(.-pg_atomic_cas) |
||||
#endif |
||||
@ -1,43 +0,0 @@ |
||||
/------------------------------------------------------------------------- |
||||
/ |
||||
/ sunstudio_x86.s |
||||
/ compare and swap for Sun Studio on x86 |
||||
/ |
||||
/ Portions Copyright (c) 1996-2025, PostgreSQL Global Development Group |
||||
/ Portions Copyright (c) 1994, Regents of the University of California |
||||
/ |
||||
/ IDENTIFICATION |
||||
/ src/backend/port/tas/sunstudio_x86.s |
||||
/ |
||||
/------------------------------------------------------------------------- |
||||
|
||||
/ Fortunately the Sun compiler can process cpp conditionals with -P |
||||
|
||||
/ '/' is the comment for x86, while '!' is the comment for Sparc |
||||
|
||||
.file "tas.s" |
||||
|
||||
#if defined(__amd64) |
||||
.code64 |
||||
#endif |
||||
|
||||
.globl pg_atomic_cas
|
||||
.type pg_atomic_cas, @function
|
||||
|
||||
.section .text, "ax" |
||||
.align 16
|
||||
|
||||
pg_atomic_cas: |
||||
#if defined(__amd64) |
||||
movl %edx,%eax |
||||
lock |
||||
cmpxchgl %esi,(%rdi) |
||||
#else |
||||
movl 4(%esp), %edx |
||||
movl 8(%esp), %ecx |
||||
movl 12(%esp), %eax |
||||
lock |
||||
cmpxchgl %ecx, (%edx) |
||||
#endif |
||||
ret |
||||
.size pg_atomic_cas, . - pg_atomic_cas |
||||
@ -1,113 +0,0 @@ |
||||
/*-------------------------------------------------------------------------
|
||||
* |
||||
* generic-sunpro.h |
||||
* Atomic operations for solaris' CC |
||||
* |
||||
* Portions Copyright (c) 2013-2025, PostgreSQL Global Development Group |
||||
* |
||||
* NOTES: |
||||
* |
||||
* Documentation: |
||||
* * manpage for atomic_cas(3C) |
||||
* http://www.unix.com/man-page/opensolaris/3c/atomic_cas/
|
||||
* http://docs.oracle.com/cd/E23824_01/html/821-1465/atomic-cas-3c.html
|
||||
* |
||||
* src/include/port/atomics/generic-sunpro.h |
||||
* |
||||
* ------------------------------------------------------------------------- |
||||
*/ |
||||
|
||||
#ifdef HAVE_MBARRIER_H |
||||
#include <mbarrier.h> |
||||
|
||||
#define pg_compiler_barrier_impl() __compiler_barrier() |
||||
|
||||
#ifndef pg_memory_barrier_impl |
||||
/*
|
||||
* Despite the name this is actually a full barrier. Expanding to mfence/ |
||||
* membar #StoreStore | #LoadStore | #StoreLoad | #LoadLoad on x86/sparc |
||||
* respectively. |
||||
*/ |
||||
# define pg_memory_barrier_impl() __machine_rw_barrier() |
||||
#endif |
||||
#ifndef pg_read_barrier_impl |
||||
# define pg_read_barrier_impl() __machine_r_barrier() |
||||
#endif |
||||
#ifndef pg_write_barrier_impl |
||||
# define pg_write_barrier_impl() __machine_w_barrier() |
||||
#endif |
||||
|
||||
#endif /* HAVE_MBARRIER_H */ |
||||
|
||||
/* Older versions of the compiler don't have atomic.h... */ |
||||
#ifdef HAVE_ATOMIC_H |
||||
|
||||
#include <atomic.h> |
||||
|
||||
#define PG_HAVE_ATOMIC_U32_SUPPORT |
||||
typedef struct pg_atomic_uint32 |
||||
{ |
||||
volatile uint32 value; |
||||
} pg_atomic_uint32; |
||||
|
||||
#define PG_HAVE_ATOMIC_U64_SUPPORT |
||||
typedef struct pg_atomic_uint64 |
||||
{ |
||||
/*
|
||||
* Syntax to enforce variable alignment should be supported by versions |
||||
* supporting atomic.h, but it's hard to find accurate documentation. If |
||||
* it proves to be a problem, we'll have to add more version checks for 64 |
||||
* bit support. |
||||
*/ |
||||
volatile uint64 value pg_attribute_aligned(8); |
||||
} pg_atomic_uint64; |
||||
|
||||
#endif /* HAVE_ATOMIC_H */ |
||||
|
||||
|
||||
#ifdef HAVE_ATOMIC_H |
||||
|
||||
#define PG_HAVE_ATOMIC_COMPARE_EXCHANGE_U32 |
||||
static inline bool |
||||
pg_atomic_compare_exchange_u32_impl(volatile pg_atomic_uint32 *ptr, |
||||
uint32 *expected, uint32 newval) |
||||
{ |
||||
bool ret; |
||||
uint32 current; |
||||
|
||||
current = atomic_cas_32(&ptr->value, *expected, newval); |
||||
ret = current == *expected; |
||||
*expected = current; |
||||
return ret; |
||||
} |
||||
|
||||
#define PG_HAVE_ATOMIC_EXCHANGE_U32 |
||||
static inline uint32 |
||||
pg_atomic_exchange_u32_impl(volatile pg_atomic_uint32 *ptr, uint32 newval) |
||||
{ |
||||
return atomic_swap_32(&ptr->value, newval); |
||||
} |
||||
|
||||
#define PG_HAVE_ATOMIC_COMPARE_EXCHANGE_U64 |
||||
static inline bool |
||||
pg_atomic_compare_exchange_u64_impl(volatile pg_atomic_uint64 *ptr, |
||||
uint64 *expected, uint64 newval) |
||||
{ |
||||
bool ret; |
||||
uint64 current; |
||||
|
||||
AssertPointerAlignment(expected, 8); |
||||
current = atomic_cas_64(&ptr->value, *expected, newval); |
||||
ret = current == *expected; |
||||
*expected = current; |
||||
return ret; |
||||
} |
||||
|
||||
#define PG_HAVE_ATOMIC_EXCHANGE_U64 |
||||
static inline uint64 |
||||
pg_atomic_exchange_u64_impl(volatile pg_atomic_uint64 *ptr, uint64 newval) |
||||
{ |
||||
return atomic_swap_64(&ptr->value, newval); |
||||
} |
||||
|
||||
#endif /* HAVE_ATOMIC_H */ |
||||
@ -1,31 +1,4 @@ |
||||
# src/template/solaris |
||||
|
||||
# Extra CFLAGS for code that will go into a shared library |
||||
if test "$GCC" = yes ; then |
||||
CFLAGS_SL="-fPIC" |
||||
else |
||||
CFLAGS_SL="-KPIC" |
||||
fi |
||||
|
||||
if test "$SUN_STUDIO_CC" = 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 |
||||
|
||||
# Pick the right test-and-set (TAS) code for the Sun compiler. |
||||
# We would like to use in-line assembler, but the compiler |
||||
# requires *.il files to be on every compile line, making |
||||
# the build system too fragile. |
||||
case $host_cpu in |
||||
sparc) |
||||
need_tas=yes |
||||
tas_file=sunstudio_sparc.s |
||||
;; |
||||
i?86|x86_64) |
||||
need_tas=yes |
||||
tas_file=sunstudio_x86.s |
||||
;; |
||||
esac |
||||
fi |
||||
CFLAGS_SL="-fPIC" |
||||
|
||||
Loading…
Reference in new issue