[erlang-patches] [PATCH] 64-bit solaris builds

Paul Fisher <>
Fri Aug 29 00:59:20 CEST 2008


This patch allows 64-bit builds when the target system supports both 
32-bit and 64-bit in the same system environment.  Specifically, this 
works on Solaris 10/Opensolaris, and adjusts the --enable-darwin-64-bit 
configure flag to be simply --enable-64bit so that it can be used for 
the same purpose on both darwin and solaris (building 64-bit target 
environment) without having to introduce another system specific 
configure flag.

This cleanly builds with the following configure command line:

~/bld/otp_src_R12B-3$ CC=gcc ./configure --enable-threads \
--enable-smp-support --enable-kernel-poll --enable-hipe \
--disable-megaco-flex-scanner-drvlineno --without-odbc \
--enable-64bit

on:

~/bld/otp_src_R12B-3$ uname -a
SunOS pfisher-laptop 5.11 snv_94 i86pc i386 i86pc Solaris

This does not fix common_test, which seems to be in its own world, and 
I'll send another patch for that.  For now I just set it to SKIP.



--- otp_src_R12B-3/erts/configure.in	2008-06-10 07:47:31.000000000 -0500
+++ otp_src_R12B-3/erts/configure.in.new	2008-08-28 17:42:13.703840610 -0500
@@ -162,13 +162,13 @@
  ],enable_darwin_universal=no)


-AC_ARG_ENABLE(darwin-64bit,
-[  --enable-darwin-64bit    build 64bit binaries on darwin],
+AC_ARG_ENABLE(-64bit,
+[  --enable-64bit    build 64bit on a system that can run both],
  [ case "$enableval" in
-    no) enable_darwin_64bit=no ;;
-    *)  enable_darwin_64bit=yes ;;
+    no) enable_64bit=no ;;
+    *)  enable_64bit=yes ;;
    esac
-],enable_darwin_64bit=no)
+],enable_64bit=no)


  AC_ARG_ENABLE(fixalloc,
@@ -229,8 +229,8 @@
  dnl check it all before continuing.
  TMPSYS=`uname -s`-`uname -m`
  if test X${enable_darwin_universal} = Xyes; then
-	if test X${enable_darwin_64bit} = Xyes; then
-		AC_MSG_ERROR([--enable-darwin-universal and --enable-darwin-64bit 
mutually exclusive])
+	if test X${enable_64bit} = Xyes; then
+		AC_MSG_ERROR([--enable-darwin-universal and --enable-64bit mutually 
exclusive])
  	fi
  	enable_hipe=no
  	case $CFLAGS in
@@ -248,18 +248,33 @@
  			;;
  	esac
  fi
-if test X${enable_darwin_64bit} = Xyes; then
-	if test X"$TMPSYS" '!=' X"Darwin-i386"; then
-		AC_MSG_ERROR([--enable-darwin-64bit only supported on x86 host])	
-	fi
-	enable_hipe=no
-	case $CFLAGS in
+if test X${enable_64bit} = Xyes; then
+    case $TMPSYS in
+	Darwin-i386)
+	    enable_hipe=no
+	    case $CFLAGS in
  		*-m64*)
  			;;
  		*)
  			CFLAGS="-m64 $CFLAGS"
  			;;
-	esac
+	    esac
+	    ;;
+	SunOS-i86pc)
+	    case $CFLAGS in
+		*-m64*)
+			;;
+		*)
+			CFLAGS="-m64 $CFLAGS"
+			;;
+	    esac
+	    ;;
+	
+	*)
+	    echo "$as_me: error: --enable-64bit only supported on x86 host"
+	    exit 1
+	    ;;
+    esac
  fi


@@ -516,6 +531,17 @@
  			esac
  		fi
  		;;
+	amd64-sol2*)
+		{ echo "$as_me:$LINENO: Adjusting LDFLAGS to cope with 64bit SunOS" >&5
+echo "$as_me: Adjusting LDFLAGS to cope with 64bit SunOS" >&6;}
+		case $LDFLAGS in
+			*-m64*)
+				;;
+			*)
+				LDFLAGS="-m64 $LDFLAGS"
+			;;
+		esac
+		;;
  esac
  	

@@ -2716,7 +2742,19 @@
  		DED_LD_FLAG_RUNTIME_LIBRARY_PATH=
  	;;
  	solaris2*|sysv4*)
+		DED_LD=$CC
  		DED_LDFLAGS="-G"
+		case $CC in
+		     gcc)
+			DED_LDFLAGS="-shared $DED_LDFLAGS"
+			;;
+		esac
+		case $ARCH in
+		    amd64)
+			DED_LDFLAGS="-m64 $DED_LDFLAGS"
+			DED_CFLAGS="-m64 $DED_CFLAGS"
+		        ;;
+		esac
  	;;
  	aix4*)
  		DED_LDFLAGS="-G -bnoentry -bexpall"




--
paul



More information about the erlang-patches mailing list