[#7055] More on VC++ 2005 — Austin Ziegler <halostatue@...>

Okay. I've got Ruby compiling. I'm attempting to get everything in

17 messages 2006/01/05
[#7058] Re: More on VC++ 2005 — nobuyoshi nakada <nobuyoshi.nakada@...> 2006/01/06

Hi,

[#7084] mathn: ugly warnings — hadmut@... (Hadmut Danisch)

Hi,

22 messages 2006/01/10
[#7097] Re: mathn: ugly warnings — Daniel Berger <Daniel.Berger@...> 2006/01/10

Hadmut Danisch wrote:

[#7098] Design contracts and refactoring (was Re: mathn: ugly warnings) — mathew <meta@...> 2006/01/10

Daniel Berger wrote:

[#7118] Re: Design contracts and refactoring (was Re: mathn: ugly warnings) — mathew <meta@...> 2006/01/12

*Dean Wampler *<deanwampler gmail.com> writes:

[#7226] Fwd: Re: Question about massive API changes — "Sean E. Russell" <ser@...>

Hello,

23 messages 2006/01/28
[#7228] Re: Question about massive API changes — Caleb Tennis <caleb@...> 2006/01/28

>

[PATCH] solaris 10 isinf and ruby_setenv fixes

From: ville.mattila@...
Date: 2006-01-13 12:56:10 UTC
List: ruby-core #7138
Hello,

 Here is a patch that fixes two issues for me.
 1. The isinf is not regognized by autoconf library guesser, so it gets
undefined and
      the missing/isinf.c is used, which will get compilation error.
      Solution is to force isinf to defined and -lm to be added to LIBS
when solaris is configured.

 2.  ruby_setenv will cause random memory corruption. The solaris 10 man
setnv:
" ....
  If the application modifies environ or the pointers to which
     it  points,  the  behavior  of  setenv()  is  undefined. The
     setenv() function updates the  list  of  pointers  to  which
     environ points.
 ...
"
   Solution is to define HAVE_DO_NOT_MODIFY_ENVIRON and compile both
   solaris 10 and cygwin same way.

  I have tested this with on solaris 10 x86_64 with sun studio 11 compiler.
 The cygwin change is trivial but I haven't tested it.


The patch is attached.

(See attached file: solaris_10_env_isinf.patch)

Attachments (1)

solaris_10_env_isinf.patch (1.5 KB, text/x-diff)
Index: configure.in
===================================================================
RCS file: /src/ruby/configure.in,v
retrieving revision 1.212.2.40
diff -u -r1.212.2.40 configure.in
--- configure.in	24 Nov 2005 12:07:18 -0000	1.212.2.40
+++ configure.in	13 Jan 2006 12:44:35 -0000
@@ -398,6 +398,10 @@
 		;;
 superux*)     ac_cv_func_setitimer=no
               ;;
+solaris*2.10)  ac_cv_func_isinf=yes
+               LIBS="-lm $LIBS"
+              ;;
+
 *) LIBS="-lm $LIBS";;
 esac
 AC_CHECK_LIB(crypt, crypt)
@@ -1338,11 +1342,19 @@
 	powerpc*)
 	    CFLAGS="$CFLAGS -relax_pointers"
 	    ;;
-	esac
+        esac
 	;;
+   solaris*)
+        os_release=`uname -r | sed -e 's/5\.//g'`
+	if test $os_release -ge 10; then
+	   AC_DEFINE(HAVE_DO_NOT_MODIFY_ENVIRON)
+	fi
+        ;;
+
     cygwin*|mingw*)
 	case "$target_os" in
 	cygwin*)
+    	   AC_DEFINE(HAVE_DO_NOT_MODIFY_ENVIRON)
 	    if test x"$enable_shared" = xyes; then
 		LIBRUBY_SO='cyg$(RUBY_SO_NAME)'${MAJOR}${MINOR}.dll
 		LIBRUBY='lib$(RUBY_SO_NAME).dll.a'
Index: hash.c
===================================================================
RCS file: /src/ruby/hash.c,v
retrieving revision 1.128.2.14
diff -u -r1.128.2.14 hash.c
--- hash.c	19 Jul 2005 08:25:37 -0000	1.128.2.14
+++ hash.c	13 Jan 2006 12:44:36 -0000
@@ -1812,7 +1812,7 @@
      *         RTL's environ global variable directly yet.
      */
     SetEnvironmentVariable(name,value);
-#elif defined __CYGWIN__
+#elif defined HAVE_DO_NOT_MODIFY_ENVIRON
 #undef setenv
 #undef unsetenv
     if (value)

In This Thread

Prev Next