[m-rev.] for review: solaris 2.10 things
Peter Wang
wangp at students.cs.mu.oz.au
Tue Aug 8 20:44:34 AEST 2006
The error message that I get on mundara when thread-local storage is
enabled is this, when it's trying to build the shared runtime library:
ld: fatal: relocation error: R_SPARC_TLS_IE_HI22: file
mercury_builtin_types.o: symbol MR_thread_engine_base: relocation
illegal when building a shared object
Looks like the __thread extension requires -fpic, but then that causes
some problems with global register usage.
Peter
Estimated hours taken: 1
Branches: main
configure.in:
Set `link_static_opt' to blank for Solaris 2.10, which no longer ships
static versions of system libraries.
Don't use deprecated flags `SOLARIS_THREADS' and `_SOLARIS_PTHREADS'
as these cause redefined flags warnings.
Disable use of thread-local storage on Solaris to avoid a linker
problem when creating shared objects.
Initialise `ENABLE_BOEHM_PARALLEL_MARK' to blank.
boehm_gc/include/gc.h:
Fix implicit type and missing prototype warnings in the definition of
`GC_INIT' for Solaris.
Index: configure.in
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/configure.in,v
retrieving revision 1.461
diff -u -r1.461 configure.in
--- configure.in 7 Aug 2006 06:21:29 -0000 1.461
+++ configure.in 8 Aug 2006 09:38:25 -0000
@@ -190,6 +190,7 @@
case "$host" in
i386-pc-solaris2.8) link_static_opt= ;;
+ *solaris2.10) link_static_opt= ;;
*powerpc*apple*darwin*) link_static_opt= ;;
*) link_static_opt="--linkage static" ;;
esac
@@ -2481,10 +2482,11 @@
LDFLAGS_FOR_THREADS=
LD_LIBFLAGS_FOR_THREADS=
ENABLE_BOEHM_THREAD_LOCAL_ALLOC=
+ENABLE_BOEHM_PARALLEL_MARK=
case "$host" in
*solaris*)
- CFLAGS_FOR_THREADS="-DMR_THREAD_SAFE -DSOLARIS_THREADS \
- -D_SOLARIS_PTHREADS -DGC_SOLARIS_PTHREADS -D_REENTRANT"
+ CFLAGS_FOR_THREADS="-DMR_THREAD_SAFE \
+ -DGC_SOLARIS_PTHREADS -D_REENTRANT"
THREAD_LIBS="-lpthread -ldl"
;;
@@ -2586,8 +2588,14 @@
)
AC_MSG_RESULT($mercury_cv_thread_local_storage)
+# Thread-local storage is disabled on Solaris as there is a linker problem
+# with shared objects and TLS.
+
if test "$mercury_cv_thread_local_storage" = yes; then
- AC_DEFINE(MR_THREAD_LOCAL_STORAGE)
+ case "$host" in
+ *-solaris2.*) ;;
+ *) AC_DEFINE(MR_THREAD_LOCAL_STORAGE) ;;
+ esac
fi
#-----------------------------------------------------------------------------#
Index: boehm_gc/include/gc.h
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/boehm_gc/include/gc.h,v
retrieving revision 1.15
diff -u -r1.15 gc.h
--- boehm_gc/include/gc.h 5 Sep 2005 06:49:04 -0000 1.15
+++ boehm_gc/include/gc.h 3 Aug 2006 13:05:00 -0000
@@ -944,7 +944,8 @@
* from the statically loaded program section.
* This circumvents a Solaris 2.X (X<=4) linker bug.
*/
-# define GC_INIT() { extern end, etext; \
+# define GC_INIT() { extern void GC_noop(); \
+ extern int end, etext; \
GC_noop(&end, &etext); }
#else
# if defined(__CYGWIN32__) || defined (_AIX)
--------------------------------------------------------------------------
mercury-reviews mailing list
Post messages to: mercury-reviews at csse.unimelb.edu.au
Administrative Queries: owner-mercury-reviews at csse.unimelb.edu.au
Subscriptions: mercury-reviews-request at csse.unimelb.edu.au
--------------------------------------------------------------------------
More information about the reviews
mailing list