diff: fix for SunOS4.x problem

Fergus Henderson fjh at cs.mu.oz.au
Wed Oct 8 03:28:37 AEST 1997


Fix a problem that broke the SunOS 4.x port.

configure.in:
runtime/conf.h.in:
	For SunOS 4.x, define MR_BARFS_ON_ASM_TYPE_DIRECTIVE.

runtime/goto.h:
	Use `.type' asm directives on sparcs only if
	MR_BARFS_ON_ASM_TYPE_DIRECTIVE is not defined.

cvs diff  configure.in runtime/conf.h.in runtime/goto.h
Index: configure.in
===================================================================
RCS file: /home/staff/zs/imp/mercury/configure.in,v
retrieving revision 1.110
diff -u -r1.110 configure.in
--- configure.in	1997/10/02 02:53:42	1.110
+++ configure.in	1997/10/07 17:23:45
@@ -187,7 +187,7 @@
 	fi
 fi
 if test "$MKFIFO" = ""; then
-	AC_MSG_WARN(cannot find a working mkfifo or mknod)
+	AC_MSG_WARN(cannot find a working \`mkfifo' or \`mknod')
 	MKFIFO=none
 fi
 AC_SUBST(MKFIFO)
@@ -256,7 +256,7 @@
 # check the basics of sigaction
 #
 if test "$ac_cv_func_sigaction" = yes; then
-	AC_MSG_CHECKING(for sigaction field name)
+	AC_MSG_CHECKING(for \`sigaction' field name)
 	AC_CACHE_VAL(mercury_cv_sigaction_field,
 	AC_TRY_RUN([
 
@@ -303,7 +303,7 @@
 #
 # check the basics of sigcontext_struct
 #
-AC_MSG_CHECKING(for working sigcontext_struct)
+AC_MSG_CHECKING(for working \`sigcontext_struct')
 AC_CACHE_VAL(mercury_cv_sigcontext_struct,
 mercury_cv_sigcontext_struct=no
 AC_TRY_RUN([
@@ -349,7 +349,7 @@
 	#
 	# check for sigcontext_struct.eip
 	#
-	AC_MSG_CHECKING(for sigcontext_struct pc access at signals)
+	AC_MSG_CHECKING(for \`sigcontext_struct' pc access at signals)
 	AC_CACHE_VAL(mercury_cv_pc_access,
 	mercury_cv_pc_access=no
 	AC_TRY_RUN([
@@ -392,7 +392,7 @@
 	}], [mercury_cv_pc_access=yes], [true], [true]))
 	AC_MSG_RESULT($mercury_cv_pc_access)
 else
-	AC_MSG_CHECKING(for siginfo_t)
+	AC_MSG_CHECKING(for \`siginfo_t')
 	AC_CACHE_VAL(mercury_cv_siginfo_t,
 	mercury_cv_siginfo_t=no
 	AC_TRY_RUN([
@@ -448,7 +448,7 @@
 		AC_DEFINE(HAVE_SIGINFO_T)
 		AC_DEFINE(HAVE_SIGINFO)
 
-		AC_MSG_CHECKING(for siginfo pc access at signals)
+		AC_MSG_CHECKING(for \`siginfo' pc access at signals)
 		AC_CACHE_VAL(mercury_cv_pc_access,
 		mercury_cv_pc_access=no
 		AC_TRY_RUN([
@@ -623,7 +623,7 @@
 WORD_TYPE=$mercury_cv_word_type
 AC_SUBST(WORD_TYPE)
 #-----------------------------------------------------------------------------#
-AC_MSG_CHECKING(for the number of low tag bits)
+AC_MSG_CHECKING(the number of low tag bits available)
 AC_CACHE_VAL(mercury_cv_low_tag_bits,
 	AC_TRY_RUN([
 	#include <stdio.h>
@@ -1293,6 +1293,22 @@
 AC_SUBST(NUM_REAL_R_TEMPS)
 AC_SUBST(HAVE_DELAY_SLOT)
 
+#-----------------------------------------------------------------------------#
+AC_MSG_CHECKING(whether the assembler barfs on .type)
+AC_CACHE_VAL(mercury_cv_barfs_on_asm_type_directive, [
+	case "$host" in
+		*-sunos4.*)
+			mercury_cv_barfs_on_asm_type_directive=yes
+			;;
+		*)
+			mercury_cv_barfs_on_asm_type_directive=no
+			;;
+	esac
+])
+AC_MSG_RESULT($mercury_cv_barfs_on_asm_type_directive)
+if test $mercury_cv_barfs_on_asm_type_directive = "yes"; then
+	AC_DEFINE(MR_BARFS_ON_ASM_TYPE_DIRECTIVE)
+fi
 #-----------------------------------------------------------------------------#
 AC_MSG_CHECKING(whether Mercury supports shared libraries on this system)
 # We ought to use $target here rather than $host - but we don't
Index: runtime/conf.h.in
===================================================================
RCS file: /home/staff/zs/imp/mercury/runtime/conf.h.in,v
retrieving revision 1.22
diff -u -r1.22 conf.h.in
--- conf.h.in	1997/10/02 02:46:00	1.22
+++ conf.h.in	1997/10/07 16:52:06
@@ -187,4 +187,10 @@
 */
 #undef USE_DLLS
 
+/*
+** For SPARC systems, does `as' barf if we use `.type' in inline asm?
+** (True for SunOS 4.x.)
+*/
+#undef MR_BARFS_ON_ASM_TYPE_DIRECTIVE
+
 #endif /* CONF_H */
Index: runtime/goto.h
===================================================================
RCS file: /home/staff/zs/imp/mercury/runtime/goto.h,v
retrieving revision 1.32
diff -u -r1.32 goto.h
--- goto.h	1997/08/28 17:52:18	1.32
+++ goto.h	1997/10/07 16:51:13
@@ -248,8 +248,10 @@
   ** to get confused, and we end up jumping into the data section.
   ** Hence the `.type' directive below.
   */
-  #define INLINE_ASM_ENTRY_LABEL_TYPE(label) \
+  #ifndef MR_BARFS_ON_ASM_TYPE_DIRECTIVE
+    #define INLINE_ASM_ENTRY_LABEL_TYPE(label) \
 	"	.type _entry_" stringify(label) ",#function\n"
+  #endif
 
 #endif
 
-- 
Fergus Henderson <fjh at cs.mu.oz.au>   |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>   |  of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3         |     -- the last words of T. S. Garp.



More information about the developers mailing list