#At file:///home/os136802/mysql/develop/repo/mysql-6.0-falcon-sparc-ss/
2743 Olav Sandstaa 2008-07-10
Partial fix to Bug#37622 Falcon does not compile on Solaris 9 on SPARC using Sun Studio compiler
Changes to Falcon's configure and build system in order to support Sun Studio's inline templates
for assembly code.
added:
storage/falcon/CompareAndSwapSparc.il
modified:
storage/falcon/Interlock.h
storage/falcon/Makefile.am
storage/falcon/plug.in
per-file messages:
storage/falcon/CompareAndSwapSparc.il
Empty implementations for the two compare and swap functions needed by Interlock.h when
running on SPARC and compiling with Sun Studio compiler.
storage/falcon/Interlock.h
Added definitions and calls to the CAS functions implemented using inline templates with assembly for SPARC and Sun Studio compiler.
storage/falcon/Makefile.am
Support for inline templates for SPARC assembly when compiling with Sun Studio compiler on Solaris 9.
storage/falcon/plug.in
Support for inline templates for SPARC assembly when compiling with Sun Studio compiler
on Solaris 9 on SPARC.
=== added file 'storage/falcon/CompareAndSwapSparc.il'
=== added file 'storage/falcon/CompareAndSwapSparc.il'
--- a/storage/falcon/CompareAndSwapSparc.il 1970-01-01 00:00:00 +0000
+++ b/storage/falcon/CompareAndSwapSparc.il 2008-07-10 09:27:51 +0000
@@ -0,0 +1,12 @@
+
+
+/* Implements inline_cas_uint - empty this far */
+.inline compareswap
+ nop
+.end
+
+
+/* Implements inline_cas_ptr - empty this far */
+.inline compareswapptr
+ nop
+.end
=== modified file 'storage/falcon/Interlock.h'
--- a/storage/falcon/Interlock.h 2008-06-26 22:04:56 +0000
+++ b/storage/falcon/Interlock.h 2008-07-10 09:27:51 +0000
@@ -18,6 +18,12 @@
#if defined(__sparcv8) || defined(__sparcv9) || defined(__sun)
#include <sys/atomic.h>
+
+#if defined(__SunOS_5_9)
+extern "C" int compareswap(volatile int *target, int compare, int exchange);
+extern "C" char compareswapptr(volatile void **target, void *compare, void *exchange);
+#endif /* __SunOS_5_9 */
+
#endif
#define INTERLOCKED_INCREMENT(variable) interlockedIncrement(&variable)
@@ -147,6 +153,10 @@
return (compare == atomic_cas_uint((volatile uint_t *)target, compare, exchange));
#else
# error cas not defined. We need >= Solaris 10
+ /* Not implemented yet - just an example of how to call inline assembly */
+ char ret = compareswap(target, compare, exchange);
+
+ return ret;
#endif
#else
@@ -257,6 +267,10 @@
return (char)(compare == atomic_cas_ptr(target, compare, exchange));
#else
# error cas not defined. We need >= Solaris 10
+ /* Not implemented yet - just an example for calling inline assembly */
+ char ret = compareswapptr(target, compare, exchange);
+
+ return ret;
#endif
#else
=== modified file 'storage/falcon/Makefile.am'
--- a/storage/falcon/Makefile.am 2008-06-19 15:09:45 +0000
+++ b/storage/falcon/Makefile.am 2008-07-10 09:27:51 +0000
@@ -23,7 +23,8 @@
INCLUDES= -I$(top_srcdir)/include -I$(top_builddir)/include \
-I$(top_srcdir)/regex -I$(top_srcdir)/sql \
- -I$(srcdir) -I$(srcdir)/TransformLib @ZLIB_INCLUDES@
+ -I$(srcdir) -I$(srcdir)/TransformLib @ZLIB_INCLUDES@ \
+ @FALCON_SPARC_ASSEMBLY@
falcon_headers= Agent.h Alias.h Application.h \
AsciiBlob.h \
=== modified file 'storage/falcon/plug.in'
--- a/storage/falcon/plug.in 2008-04-23 17:45:42 +0000
+++ b/storage/falcon/plug.in 2008-07-10 09:27:51 +0000
@@ -94,4 +94,20 @@
esac
AC_SUBST([FALCON_CXXFLAGS])
+
+ # When compiling with Sun Studio compiler on SPARC assembly code for
+ # Interlock operations needs to be included. This has been implemented
+ # as "inline templates" in a separate file
+ FALCON_SPARC_ASSEMBLY=""
+ case $host in
+ sparc-sun-solaris2.9)
+ case $CXX_VERSION in
+ *Sun*C++*)
+ FALCON_SPARC_ASSEMBLY="CompareAndSwapSparc.il"
+ ;;
+ esac
+ ;;
+ esac
+
+ AC_SUBST([FALCON_SPARC_ASSEMBLY])
])
| Thread |
|---|
| • bzr commit into mysql-6.0-falcon branch (olav:2743) Bug#37622 | Olav Sandstaa | 10 Jul |