1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-18 02:02:55 +03:00

Remove traces of support for Sun Studio compiler

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.org
This commit is contained in:
Peter Eisentraut
2025-09-11 11:55:29 +02:00
parent e92677e863
commit 25f36066dd
21 changed files with 24 additions and 485 deletions

View File

@@ -22,7 +22,6 @@ top_builddir = ../../..
include $(top_builddir)/src/Makefile.global
OBJS = \
$(TAS) \
atomics.o \
pg_sema.o \
pg_shmem.o
@@ -33,16 +32,5 @@ endif
include $(top_srcdir)/src/backend/common.mk
tas.o: tas.s
ifeq ($(SUN_STUDIO_CC), yes)
# preprocess assembler file with cpp
$(CC) $(CFLAGS) -c -P $<
mv $*.i $*_cpp.s
$(CC) $(CFLAGS) -c $*_cpp.s -o $@
else
$(CC) $(CFLAGS) -c $<
endif
clean:
rm -f tas_cpp.s
$(MAKE) -C win32 clean

View File

@@ -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

View File

@@ -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

View File

@@ -24,13 +24,9 @@ OBJS = \
include $(top_srcdir)/src/backend/common.mk
ifdef TAS
TASPATH = $(top_builddir)/src/backend/port/tas.o
endif
s_lock_test: s_lock.c $(top_builddir)/src/common/libpgcommon.a $(top_builddir)/src/port/libpgport.a
$(CC) $(CPPFLAGS) $(CFLAGS) -DS_LOCK_TEST=1 $(srcdir)/s_lock.c \
$(TASPATH) -L $(top_builddir)/src/common -lpgcommon \
-L $(top_builddir)/src/common -lpgcommon \
-L $(top_builddir)/src/port -lpgport -lm -o s_lock_test
lwlocknames.h: ../../../include/storage/lwlocklist.h ../../utils/activity/wait_event_names.txt generate-lwlocknames.pl