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

@ -83,7 +83,7 @@ if test x"$pgac_cv__128bit_int" = xyes ; then
AC_CACHE_CHECK([for __int128 alignment bug], [pgac_cv__128bit_int_bug],
[AC_RUN_IFELSE([AC_LANG_PROGRAM([
/* This must match the corresponding code in c.h: */
#if defined(__GNUC__) || defined(__SUNPRO_C)
#if defined(__GNUC__)
#define pg_attribute_aligned(a) __attribute__((aligned(a)))
#elif defined(_MSC_VER)
#define pg_attribute_aligned(a) __declspec(align(a))

53
configure vendored
View File

@ -739,7 +739,6 @@ PKG_CONFIG_LIBDIR
PKG_CONFIG_PATH
PKG_CONFIG
DLSUFFIX
TAS
GCC
CPP
CFLAGS_SL
@ -760,7 +759,6 @@ CLANG
LLVM_CONFIG
AWK
with_llvm
SUN_STUDIO_CC
ac_ct_CXX
CXXFLAGS
CXX
@ -3059,12 +3057,6 @@ $as_echo "$template" >&6; }
PORTNAME=$template
# Initialize default assumption that we do not need separate assembly code
# for TAS (test-and-set). This can be overridden by the template file
# when it's executed.
need_tas=no
tas_file=dummy.s
# Default, works for most platforms, override in template file if needed
DLSUFFIX=".so"
@ -4799,30 +4791,6 @@ else
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
# Check if it's Sun Studio compiler. We assume that
# __SUNPRO_C will be defined for Sun Studio compilers
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
main ()
{
#ifndef __SUNPRO_C
choke me
#endif
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
SUN_STUDIO_CC=yes
else
SUN_STUDIO_CC=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
#
# LLVM
@ -6748,7 +6716,7 @@ fi
# __attribute__((visibility("hidden"))) is supported, if we encounter a
# compiler that supports one of the supported variants of -fvisibility=hidden
# but uses a different syntax to mark a symbol as exported.
if test "$GCC" = yes -o "$SUN_STUDIO_CC" = yes ; then
if test "$GCC" = yes; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CC} supports -fvisibility=hidden, for CFLAGS_SL_MODULE" >&5
$as_echo_n "checking whether ${CC} supports -fvisibility=hidden, for CFLAGS_SL_MODULE... " >&6; }
if ${pgac_cv_prog_CC_cflags__fvisibility_hidden+:} false; then :
@ -7731,20 +7699,6 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
#
# Set up TAS assembly code if needed; the template file has now had its
# chance to request this.
#
ac_config_links="$ac_config_links src/backend/port/tas.s:src/backend/port/tas/${tas_file}"
if test "$need_tas" = yes ; then
TAS=tas.o
else
TAS=""
fi
cat >>confdefs.h <<_ACEOF
#define DLSUFFIX "$DLSUFFIX"
@ -17141,7 +17095,7 @@ else
/* end confdefs.h. */
/* This must match the corresponding code in c.h: */
#if defined(__GNUC__) || defined(__SUNPRO_C)
#if defined(__GNUC__)
#define pg_attribute_aligned(a) __attribute__((aligned(a)))
#elif defined(_MSC_VER)
#define pg_attribute_aligned(a) __declspec(align(a))
@ -19344,8 +19298,6 @@ fi
if test x"$GCC" = x"yes" ; then
cc_string=`${CC} --version | sed q`
case $cc_string in [A-Za-z]*) ;; *) cc_string="GCC $cc_string";; esac
elif test x"$SUN_STUDIO_CC" = x"yes" ; then
cc_string=`${CC} -V 2>&1 | sed q`
else
cc_string=$CC
fi
@ -20142,7 +20094,6 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
for ac_config_target in $ac_config_targets
do
case $ac_config_target in
"src/backend/port/tas.s") CONFIG_LINKS="$CONFIG_LINKS src/backend/port/tas.s:src/backend/port/tas/${tas_file}" ;;
"GNUmakefile") CONFIG_FILES="$CONFIG_FILES GNUmakefile" ;;
"src/Makefile.global") CONFIG_FILES="$CONFIG_FILES src/Makefile.global" ;;
"src/backend/port/pg_sema.c") CONFIG_LINKS="$CONFIG_LINKS src/backend/port/pg_sema.c:${SEMA_IMPLEMENTATION}" ;;

View File

@ -95,12 +95,6 @@ AC_MSG_RESULT([$template])
PORTNAME=$template
AC_SUBST(PORTNAME)
# Initialize default assumption that we do not need separate assembly code
# for TAS (test-and-set). This can be overridden by the template file
# when it's executed.
need_tas=no
tas_file=dummy.s
# Default, works for most platforms, override in template file if needed
DLSUFFIX=".so"
@ -400,14 +394,6 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [@%:@ifndef __INTEL_COMPILER
choke me
@%:@endif])], [ICC=yes], [ICC=no])
# Check if it's Sun Studio compiler. We assume that
# __SUNPRO_C will be defined for Sun Studio compilers
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [@%:@ifndef __SUNPRO_C
choke me
@%:@endif])], [SUN_STUDIO_CC=yes], [SUN_STUDIO_CC=no])
AC_SUBST(SUN_STUDIO_CC)
#
# LLVM
@ -618,7 +604,7 @@ fi
# __attribute__((visibility("hidden"))) is supported, if we encounter a
# compiler that supports one of the supported variants of -fvisibility=hidden
# but uses a different syntax to mark a symbol as exported.
if test "$GCC" = yes -o "$SUN_STUDIO_CC" = yes ; then
if test "$GCC" = yes; then
PGAC_PROG_CC_VAR_OPT(CFLAGS_SL_MODULE, [-fvisibility=hidden])
# For C++ we additionally want -fvisibility-inlines-hidden
PGAC_PROG_VARCXX_VARFLAGS_OPT(CXX, CXXFLAGS_SL_MODULE, [-fvisibility=hidden])
@ -774,19 +760,6 @@ AC_PROG_CPP
AC_SUBST(GCC)
#
# Set up TAS assembly code if needed; the template file has now had its
# chance to request this.
#
AC_CONFIG_LINKS([src/backend/port/tas.s:src/backend/port/tas/${tas_file}])
if test "$need_tas" = yes ; then
TAS=tas.o
else
TAS=""
fi
AC_SUBST(TAS)
AC_SUBST(DLSUFFIX)dnl
AC_DEFINE_UNQUOTED([DLSUFFIX], ["$DLSUFFIX"],
[Define to the file name extension of dynamically-loadable modules.])
@ -2478,8 +2451,6 @@ AC_SUBST(LDFLAGS_EX_BE)
if test x"$GCC" = x"yes" ; then
cc_string=`${CC} --version | sed q`
case $cc_string in [[A-Za-z]]*) ;; *) cc_string="GCC $cc_string";; esac
elif test x"$SUN_STUDIO_CC" = x"yes" ; then
cc_string=`${CC} -V 2>&1 | sed q`
else
cc_string=$CC
fi

View File

@ -157,19 +157,12 @@ ld -Bshareable -o foo.so foo.o
<listitem>
<para>
The compiler flag to create <acronym>PIC</acronym> is
<option>-KPIC</option> with the Sun compiler and
<option>-fPIC</option> with <application>GCC</application>. To
link shared libraries, the compiler option is
<option>-G</option> with either compiler or alternatively
<option>-shared</option> with <application>GCC</application>.
<programlisting>
cc -KPIC -c foo.c
cc -G -o foo.so foo.o
</programlisting>
or
<programlisting>
gcc -fPIC -c foo.c
gcc -G -o foo.so foo.o
gcc -shared -o foo.so foo.o
</programlisting>
</para>
</listitem>

View File

@ -1676,10 +1676,6 @@ build-postgresql:
using the GCC compiler:
<screen>
./configure CC='gcc -m64' --enable-dtrace DTRACEFLAGS='-64' ...
</screen>
Using Sun's compiler:
<screen>
./configure CC='/opt/SUNWspro/bin/cc -xtarget=native64' --enable-dtrace DTRACEFLAGS='-64' ...
</screen>
</para>
</listitem>
@ -3713,24 +3709,13 @@ xcrun --show-sdk-path
<title>Required Tools</title>
<para>
You can build with either GCC or Sun's compiler suite. For
better code optimization, Sun's compiler is strongly recommended
on the SPARC architecture. If
you are using Sun's compiler, be careful not to select
<filename>/usr/ucb/cc</filename>;
use <filename>/opt/SUNWspro/bin/cc</filename>.
Only GCC is supported as the compiler. Sun's compiler suite is no longer
supported.
</para>
<para>
You can download Sun Studio
from <ulink url="https://www.oracle.com/technetwork/server-storage/solarisstudio/downloads/"></ulink>.
Many GNU tools are integrated into Solaris 10, or they are
present on the Solaris companion CD. If you need packages for
older versions of Solaris, you can find these tools
at <ulink url="http://www.sunfreeware.com"></ulink>.
If you prefer
sources, look
at <ulink url="https://www.gnu.org/prep/ftp"></ulink>.
Many additional dependencies can be installed via the package management
system.
</para>
</sect3>
@ -3753,27 +3738,6 @@ configure ... LDFLAGS="-R /usr/sfw/lib:/opt/sfw/lib:/usr/local/lib"
</para>
</sect3>
<sect3 id="installation-notes-solaris-comp-opt-perf">
<title>Compiling for Optimal Performance</title>
<para>
On the SPARC architecture, Sun Studio is strongly recommended for
compilation. Try using the <option>-xO5</option> optimization
flag to generate significantly faster binaries. Do not use any
flags that modify behavior of floating-point operations
and <varname>errno</varname> processing (e.g.,
<option>-fast</option>).
</para>
<para>
If you do not have a reason to use 64-bit binaries on SPARC,
prefer the 32-bit version. The 64-bit operations are slower and
64-bit binaries are slower than the 32-bit variants. On the
other hand, 32-bit code on the AMD64 CPU family is not native,
so 32-bit code is significantly slower on that CPU family.
</para>
</sect3>
<sect3 id="installation-notes-solaris-using-dtrace">
<title>Using DTrace for Tracing PostgreSQL</title>
@ -3781,22 +3745,6 @@ configure ... LDFLAGS="-R /usr/sfw/lib:/opt/sfw/lib:/usr/local/lib"
Yes, using DTrace is possible. See <xref linkend="dynamic-trace"/> for
further information.
</para>
<para>
If you see the linking of the <command>postgres</command> executable abort with an
error message like:
<screen>
Undefined first referenced
symbol in file
AbortTransaction utils/probes.o
CommitTransaction utils/probes.o
ld: fatal: Symbol referencing errors. No output written to postgres
collect2: ld returned 1 exit status
make: *** [postgres] Error 1
</screen>
your DTrace installation is too old to handle probes in static
functions. You need Solaris 10u4 or newer to use DTrace.
</para>
</sect3>
</sect2>

View File

@ -1809,7 +1809,7 @@ if cc.links('''
if not meson.is_cross_build()
r = cc.run('''
/* This must match the corresponding code in c.h: */
#if defined(__GNUC__) || defined(__SUNPRO_C)
#if defined(__GNUC__)
#define pg_attribute_aligned(a) __attribute__((aligned(a)))
#elif defined(_MSC_VER)
#define pg_attribute_aligned(a) __declspec(align(a))

View File

@ -267,7 +267,6 @@ endif # not PGXS
CC = @CC@
GCC = @GCC@
SUN_STUDIO_CC = @SUN_STUDIO_CC@
CXX = @CXX@
CFLAGS = @CFLAGS@
CFLAGS_SL = @CFLAGS_SL@
@ -796,9 +795,6 @@ ifeq ($(PORTNAME),win32)
LIBS += -lws2_32
endif
# Not really standard libc functions, used by the backend.
TAS = @TAS@
##########################################################################
#

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

View File

@ -114,7 +114,6 @@
* GCC: https://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html
* GCC: https://gcc.gnu.org/onlinedocs/gcc/Type-Attributes.html
* Clang: https://clang.llvm.org/docs/AttributeReference.html
* Sunpro: https://docs.oracle.com/cd/E18659_01/html/821-1384/gjzke.html
*/
/*
@ -157,7 +156,7 @@
*/
#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
#define pg_noreturn _Noreturn
#elif defined(__GNUC__) || defined(__SUNPRO_C)
#elif defined(__GNUC__)
#define pg_noreturn __attribute__((noreturn))
#elif defined(_MSC_VER)
#define pg_noreturn __declspec(noreturn)
@ -233,8 +232,8 @@
#define pg_attribute_printf(f,a)
#endif
/* GCC and Sunpro support aligned and packed */
#if defined(__GNUC__) || defined(__SUNPRO_C)
/* GCC supports aligned and packed */
#if defined(__GNUC__)
#define pg_attribute_aligned(a) __attribute__((aligned(a)))
#define pg_attribute_packed() __attribute__((packed))
#elif defined(_MSC_VER)
@ -259,8 +258,8 @@
* choose not to. But, if possible, don't force inlining in unoptimized
* debug builds.
*/
#if (defined(__GNUC__) && defined(__OPTIMIZE__)) || defined(__SUNPRO_C)
/* GCC and Sunpro support always_inline via __attribute__ */
#if defined(__GNUC__) && defined(__OPTIMIZE__)
/* GCC supports always_inline via __attribute__ */
#define pg_attribute_always_inline __attribute__((always_inline)) inline
#elif defined(_MSC_VER)
/* MSVC has a special keyword for this */
@ -276,8 +275,8 @@
* for proper cost attribution. Note that unlike the pg_attribute_XXX macros
* above, this should be placed before the function's return type and name.
*/
/* GCC and Sunpro support noinline via __attribute__ */
#if defined(__GNUC__) || defined(__SUNPRO_C)
/* GCC supports noinline via __attribute__ */
#if defined(__GNUC__)
#define pg_noinline __attribute__((noinline))
/* msvc via declspec */
#elif defined(_MSC_VER)

View File

@ -88,8 +88,6 @@
#include "port/atomics/generic-gcc.h"
#elif defined(_MSC_VER)
#include "port/atomics/generic-msvc.h"
#elif defined(__SUNPRO_C) && !defined(__GNUC__)
#include "port/atomics/generic-sunpro.h"
#else
/* Unknown compiler. */
#endif

View File

@ -241,6 +241,6 @@ pg_atomic_fetch_add_u64_impl(volatile pg_atomic_uint64 *ptr, int64 add_)
*/
#if defined(__i568__) || defined(__i668__) || /* gcc i586+ */ \
(defined(_M_IX86) && _M_IX86 >= 500) || /* msvc i586+ */ \
defined(__x86_64__) || defined(__x86_64) || defined(_M_X64) /* gcc, sunpro, msvc */
defined(__x86_64__) || defined(__x86_64) || defined(_M_X64) /* gcc, msvc */
#define PG_HAVE_8BYTE_SINGLE_COPY_ATOMICITY
#endif /* 8 byte single-copy atomicity */

View File

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

View File

@ -1,26 +1,5 @@
/* src/include/port/solaris.h */
/*
* Sort this out for all operating systems some time. The __xxx
* symbols are defined on both GCC and Solaris CC, although GCC
* doesn't document them. The __xxx__ symbols are only on GCC.
*/
#if defined(__i386) && !defined(__i386__)
#define __i386__
#endif
#if defined(__amd64) && !defined(__amd64__)
#define __amd64__
#endif
#if defined(__x86_64) && !defined(__x86_64__)
#define __x86_64__
#endif
#if defined(__sparc) && !defined(__sparc__)
#define __sparc__
#endif
#if defined(__i386__)
#include <sys/isa_defs.h>
#endif

View File

@ -333,9 +333,9 @@ tas(volatile slock_t *lock)
slock_t _res;
/*
* See comment in src/backend/port/tas/sunstudio_sparc.s for why this
* uses "ldstub", and that file uses "cas". gcc currently generates
* sparcv7-targeted binaries, so "cas" use isn't possible.
* "cas" would be better than "ldstub", but it is only present on
* sparcv8plus and later, while some platforms still support sparcv7 or
* sparcv8. Also, "cas" requires that the system be running in TSO mode.
*/
__asm__ __volatile__(
" ldstub [%2], %0 \n"
@ -594,24 +594,6 @@ tas(volatile slock_t *lock)
#if !defined(HAS_TEST_AND_SET) /* We didn't trigger above, let's try here */
/* These are in sunstudio_(sparc|x86).s */
#if defined(__SUNPRO_C) && (defined(__i386) || defined(__x86_64__) || defined(__sparc__) || defined(__sparc))
#define HAS_TEST_AND_SET
#if defined(__i386) || defined(__x86_64__) || defined(__sparcv9) || defined(__sparcv8plus)
typedef unsigned int slock_t;
#else
typedef unsigned char slock_t;
#endif
extern slock_t pg_atomic_cas(volatile slock_t *lock, slock_t with,
slock_t cmp);
#define TAS(a) (pg_atomic_cas((a), 1, 0) != 0)
#endif
#ifdef _MSC_VER
typedef LONG slock_t;

View File

@ -63,8 +63,6 @@ pgxs_kv = {
'DLSUFFIX': dlsuffix,
'EXEEXT': exesuffix,
'SUN_STUDIO_CC': 'no', # not supported so far
# want the chosen option, rather than the library
'with_ssl' : ssl_library,
'with_uuid': uuidopt,
@ -179,7 +177,7 @@ pgxs_empty = [
'WANTED_LANGUAGES',
# Not needed because we don't build the server / PLs with the generated makefile
'LIBOBJS', 'PG_CRC32C_OBJS', 'TAS',
'LIBOBJS', 'PG_CRC32C_OBJS',
'PG_TEST_EXTRA',
'DTRACEFLAGS', # only server has dtrace probes

View File

@ -14,26 +14,3 @@ CFLAGS_SL="-fPIC"
# If --enable-profiling is specified, we need -DLINUX_PROFILE
PLATFORM_PROFILE_FLAGS="-DLINUX_PROFILE"
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

View File

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

View File

@ -114,7 +114,6 @@ do
test "$f" = src/include/port/atomics/generic.h && continue
test "$f" = src/include/port/atomics/generic-gcc.h && continue
test "$f" = src/include/port/atomics/generic-msvc.h && continue
test "$f" = src/include/port/atomics/generic-sunpro.h && continue
# sepgsql.h depends on headers that aren't there on most platforms.
test "$f" = contrib/sepgsql/sepgsql.h && continue