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

ruby-changes:52730

From: k0kubun <ko1@a...>
Date: Sun, 7 Oct 2018 23:00:10 +0900 (JST)
Subject: [ruby-changes:52730] k0kubun:r64942 (trunk): include/ruby/intern.h: don't modify MJIT_FUNC_EXPORTED

k0kubun	2018-10-07 23:00:04 +0900 (Sun, 07 Oct 2018)

  New Revision: 64942

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

  Log:
    include/ruby/intern.h: don't modify MJIT_FUNC_EXPORTED
    
    on most of platforms except mswin.
    
    Changing it to static was needed for mswin because it doesn't use
    transform_mjit_header, but for platforms that use it, it causes link
    error like:
    
    /usr/bin/ld: /tmp/_ruby_mjit_p21652u0.o: relocation R_X86_64_PC32 against undefined symbol `rb_vm_search_method_slowpath' can not be used when making a shared object; recompile with -fPIC
    /usr/bin/ld: final link failed: Bad value
    collect2: error: ld returned 1 exit status
    
    include/ruby/defines.h: MJIT_FUNC_EXPORTED moved to intern.h

  Modified files:
    trunk/include/ruby/defines.h
    trunk/include/ruby/intern.h
Index: include/ruby/defines.h
===================================================================
--- include/ruby/defines.h	(revision 64941)
+++ include/ruby/defines.h	(revision 64942)
@@ -361,6 +361,11 @@ ruby_xrealloc2_with_location(void *ptr, https://github.com/ruby/ruby/blob/trunk/include/ruby/defines.h#L361
 #define MJIT_SYMBOL_EXPORT_BEGIN RUBY_SYMBOL_EXPORT_BEGIN
 #define MJIT_SYMBOL_EXPORT_END RUBY_SYMBOL_EXPORT_END
 
+#if defined(MJIT_HEADER) && defined(_MSC_VER)
+# undef MJIT_FUNC_EXPORTED
+# define MJIT_FUNC_EXPORTED static
+#endif
+
 #ifndef RUBY_EXTERN
 #define RUBY_EXTERN extern
 #endif
Index: include/ruby/intern.h
===================================================================
--- include/ruby/intern.h	(revision 64941)
+++ include/ruby/intern.h	(revision 64942)
@@ -36,12 +36,9 @@ extern "C" { https://github.com/ruby/ruby/blob/trunk/include/ruby/intern.h#L36
 
 /* On mswin, MJIT header transformation can't be used since cl.exe can't output
    preprocessed output preserving macros. So this `MJIT_STATIC` is needed
-   to force non-static function to static on MJIT header to avoid symbol conflict.
-   `MJIT_FUNC_EXPORTED` is also changed to `static` on MJIT header for the same reason. */
+   to force non-static function to static on MJIT header to avoid symbol conflict. */
 #ifdef MJIT_HEADER
 # define MJIT_STATIC static
-# undef MJIT_FUNC_EXPORTED
-# define MJIT_FUNC_EXPORTED static
 #else
 # define MJIT_STATIC
 #endif

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

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