[前][次][番号順一覧][スレッド一覧]

ruby-changes:38405

From: nagachika <ko1@a...>
Date: Thu, 14 May 2015 00:48:01 +0900 (JST)
Subject: [ruby-changes:38405] nagachika:r50486 (ruby_2_2): merge revision(s) 50410, 50412, 50413, 50414, 50415, 50416: [Backport #11111]

nagachika	2015-05-14 00:47:39 +0900 (Thu, 14 May 2015)

  New Revision: 50486

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=50486

  Log:
    merge revision(s) 50410,50412,50413,50414,50415,50416: [Backport #11111]
    
    dln.c: use EXPORT_PREFIX
    
    * configure.in (EXPORT_PREFIX): define exported symbol prefix
      string in config.h.
    
    * dln.c (FUNCNAME_PREFIX): use configured EXPORT_PREFIX, not
      hardcoded condition.
    * dln.c (dln_load): check if a different libruby is loaded by the
      extension library, and then bail out to get rid of very frequent
      reported stale bug reports.

  Modified directories:
    branches/ruby_2_2/
  Modified files:
    branches/ruby_2_2/ChangeLog
    branches/ruby_2_2/dln.c
    branches/ruby_2_2/version.h
Index: ruby_2_2/ChangeLog
===================================================================
--- ruby_2_2/ChangeLog	(revision 50485)
+++ ruby_2_2/ChangeLog	(revision 50486)
@@ -1,3 +1,9 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_2/ChangeLog#L1
+Thu May 14 00:39:29 2015  Nobuyoshi Nakada  <nobu@r...>
+
+	* dln.c (dln_load): check if a different libruby is loaded by the
+	  extension library, and then bail out to get rid of very frequent
+	  reported stale bug reports.
+
 Thu May 14 00:29:44 2015  Nobuyoshi Nakada  <nobu@r...>
 
 	* lib/fileutils.rb (FileUtils#mv): show the exact target path in
Index: ruby_2_2/dln.c
===================================================================
--- ruby_2_2/dln.c	(revision 50485)
+++ ruby_2_2/dln.c	(revision 50486)
@@ -106,13 +106,12 @@ dln_loaderror(const char *format, ...) https://github.com/ruby/ruby/blob/trunk/ruby_2_2/dln.c#L106
 # define USE_DLN_DLOPEN
 #endif
 
-#ifndef FUNCNAME_PATTERN
-# if defined(__hp9000s300) || ((defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__)) && !defined(__ELF__)) || defined(__BORLANDC__) || defined(NeXT) || defined(__WATCOMC__) || defined(MACOSX_DYLD)
-#  define FUNCNAME_PREFIX "_Init_"
-# else
-#  define FUNCNAME_PREFIX "Init_"
-# endif
+#if defined(__hp9000s300) || ((defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__)) && !defined(__ELF__)) || defined(__BORLANDC__) || defined(NeXT) || defined(__WATCOMC__) || defined(MACOSX_DYLD)
+# define EXTERNAL_PREFIX "_"
+#else
+# define EXTERNAL_PREFIX ""
 #endif
+#define FUNCNAME_PREFIX EXTERNAL_PREFIX"Init_"
 
 #if defined __CYGWIN__ || defined DOSISH
 #define isdirsep(x) ((x) == '/' || (x) == '\\')
@@ -1330,6 +1329,23 @@ dln_load(const char *file) https://github.com/ruby/ruby/blob/trunk/ruby_2_2/dln.c#L1329
 	    error = dln_strerror();
 	    goto failed;
 	}
+# if defined RUBY_EXPORT
+	{
+	    static const char incompatible[] = "incompatible library version";
+	    void *ex = dlsym(handle, EXTERNAL_PREFIX"ruby_xmalloc");
+	    if (ex && ex != ruby_xmalloc) {
+
+#   if defined __APPLE__
+		/* dlclose() segfaults */
+		rb_fatal("%s - %s", incompatible, file);
+#   else
+		dlclose(handle);
+		error = incompatible;
+		goto failed;
+#   endif
+	    }
+	}
+# endif
 
 	init_fct = (void(*)())(VALUE)dlsym(handle, buf);
 	if (init_fct == NULL) {
Index: ruby_2_2/version.h
===================================================================
--- ruby_2_2/version.h	(revision 50485)
+++ ruby_2_2/version.h	(revision 50486)
@@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_2/version.h#L1
 #define RUBY_VERSION "2.2.3"
 #define RUBY_RELEASE_DATE "2015-05-14"
-#define RUBY_PATCHLEVEL 99
+#define RUBY_PATCHLEVEL 100
 
 #define RUBY_RELEASE_YEAR 2015
 #define RUBY_RELEASE_MONTH 5

Property changes on: ruby_2_2
___________________________________________________________________
Modified: svn:mergeinfo
   Merged /trunk:r50410,50412-50416


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]