index da40bd6a64755d5fa665ba4668134e10bd5dc7bd..236a59e8536c2ea31a8ac80d8a3808c23a75c893 100644 (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))
index 39c68161ceced86fa398ae5ec20b75f198884f17..22cd866147b9642ec1adb7af5f5f104bfd77e348 100755 (executable)
PKG_CONFIG_PATH
PKG_CONFIG
DLSUFFIX
-TAS
GCC
CPP
CFLAGS_SL
LLVM_CONFIG
AWK
with_llvm
-SUN_STUDIO_CC
ac_ct_CXX
CXXFLAGS
CXX
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"
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
# __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 :
-#
-# 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"
/* 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))
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
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}" ;;
index 066e3976c0aaccf663c6083fd75d2188cd8896aa..e44943aa6fe35dfa8dfaaec0703c155c933d2250 100644 (file)
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
# __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])
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.])
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
index b94aefcd0ca6cc0792ab0bb56676363ce587cc2c..3778efc83ebfa52a4a305b0c141f6d55c4fb283d 100644 (file)
<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>
index a4ad80a67821198db4c2f4a0d2f268e55cb8f20f..593202f4fb2592375e4734a884d5a9fcf2135c59 100644 (file)
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>
<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>
index ab8101d67b26d311a7dd806c819f5a71c382f171..d71c7c8267e799f3d9158aadc74a9906e3df0408 100644 (file)
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))
index 8b1b357beaa0402dca9c3861df035184a88b01dc..0aa389bc7101257e0cd93ba78a9bed5fd391cca9 100644 (file)
CC = @CC@
GCC = @GCC@
-SUN_STUDIO_CC = @SUN_STUDIO_CC@
CXX = @CXX@
CFLAGS = @CFLAGS@
CFLAGS_SL = @CFLAGS_SL@
LIBS += -lws2_32
endif
-# Not really standard libc functions, used by the backend.
-TAS = @TAS@
-
##########################################################################
#
index 47338d99229576bf5cd12ec615ca59470d845120..8613ac01aff6da7f05fa63c461452023858ae2f9 100644 (file)
include $(top_builddir)/src/Makefile.global
OBJS = \
- $(TAS) \
atomics.o \
pg_sema.o \
pg_shmem.o
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
deleted file mode 100644
(file)
index
8e0a096..0000000
+++ /dev/null
-!-------------------------------------------------------------------------
-!
-! 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
deleted file mode 100644
(file)
index
0111ffd..0000000
+++ /dev/null
-/-------------------------------------------------------------------------
-/
-/ 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
index 6cbaf23b855f66904bec806fcfe2a3cddaa28d3e..a5fbc24ddad6ebca365e3053c148fcef09120827 100644 (file)
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
index b580cfa7d3178e839a069064a80809ee425984bd..f303ba0605a403b81b46f2cebc87ffda40056d7f 100644 (file)
* 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
*/
/*
*/
#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)
#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)
* 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 */
* 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)
index 074136fe4c4a88fcee24fcbb7e4430ba0e612d8c..96f1858da972240c949a416927f6db51192be5df 100644 (file)
#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
index 8983dd89d53d7a90e1c07db5dde9abda451a4bea..4ba2ccc05913df35ff0f4ec2e84f55a981dda4cf 100644 (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 */
deleted file mode 100644
(file)
index
09bba0b..0000000
+++ /dev/null
-/*-------------------------------------------------------------------------
- *
- * 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 */
index 8ff40007c7f6a8e1ffabd022951e388209486756..c352361c81d83e568d7136fc1218dab0ae2344a3 100644 (file)
/* 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
index 2f73f9fcf57a25a840addf45d0fa9bc8067954c2..7f8f566bd407f2de7dc1f8a88cdf2124a04d19a7 100644 (file)
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"
#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;
index 54dbc059adac7bb537a2bf13b5cea2c473d0954c..0def244c9011d8512d39fd1cf6918cbc20bf9947 100644 (file)
'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,
'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
index ec3302c4a223fd6f946e952bc589d8684976fa8d..faefe64254a904049c430bb11a5b401e8d62a414 100644 (file)
# 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
index f88b1cdad37f85039eabf288ae6e44c9ac3fc44c..a4d8d38a8f852656b461d023d140d4fbba85f4cd 100644 (file)
# 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"
index 17138a7569e4f2f55a6593be4a5e580a0a48252c..d017490a5386a3ff6088566eabbaa6cd1309242c 100755 (executable)
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