ruby-changes:50195
From: k0kubun <ko1@a...>
Date: Thu, 8 Feb 2018 22:54:43 +0900 (JST)
Subject: [ruby-changes:50195] k0kubun:r62313 (trunk): Export some missing symbols for MJIT
k0kubun 2018-02-08 22:54:37 +0900 (Thu, 08 Feb 2018) New Revision: 62313 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=62313 Log: Export some missing symbols for MJIT tool/ruby_vm/views/_insn_name_info.erb: on Linux, rb_vm_insn_name_offset was needed to compile with --jit-debug (Usually --jit-debug requires more symbols than the situation without --jit-debug because -O2 skips some functions to compile). vm.c: when running transform_mjit_header.rb with --jit-wait, rb_source_location_cstr was repoted to be missing. string.c: ditto, for rb_str_eql numeric.c: ditto, for rb_float_eql Modified files: trunk/include/ruby/defines.h trunk/numeric.c trunk/string.c trunk/tool/ruby_vm/views/_insn_name_info.erb trunk/vm.c Index: string.c =================================================================== --- string.c (revision 62312) +++ string.c (revision 62313) @@ -3263,7 +3263,7 @@ rb_str_equal(VALUE str1, VALUE str2) https://github.com/ruby/ruby/blob/trunk/string.c#L3263 * Two strings are equal if they have the same length and content. */ -VALUE +MJIT_FUNC_EXPORTED VALUE rb_str_eql(VALUE str1, VALUE str2) { if (str1 == str2) return Qtrue; Index: include/ruby/defines.h =================================================================== --- include/ruby/defines.h (revision 62312) +++ include/ruby/defines.h (revision 62313) @@ -270,9 +270,11 @@ void xfree(void*); https://github.com/ruby/ruby/blob/trunk/include/ruby/defines.h#L270 #define RUBY_FUNC_EXPORTED #endif -/* MJIT_FUNC_EXPORTED is used for functions which are exported only for MJIT +/* These macros are used for functions which are exported only for MJIT and NOT ensured to be exported in future versions. */ #define MJIT_FUNC_EXPORTED RUBY_FUNC_EXPORTED +#define MJIT_SYMBOL_EXPORT_BEGIN RUBY_SYMBOL_EXPORT_BEGIN +#define MJIT_SYMBOL_EXPORT_END RUBY_SYMBOL_EXPORT_END #ifndef RUBY_EXTERN #define RUBY_EXTERN extern Index: numeric.c =================================================================== --- numeric.c (revision 62312) +++ numeric.c (revision 62313) @@ -1603,7 +1603,7 @@ flo_le(VALUE x, VALUE y) https://github.com/ruby/ruby/blob/trunk/numeric.c#L1603 * so an implementation-dependent value is returned. */ -VALUE +MJIT_FUNC_EXPORTED VALUE rb_float_eql(VALUE x, VALUE y) { if (RB_TYPE_P(y, T_FLOAT)) { Index: vm.c =================================================================== --- vm.c (revision 62312) +++ vm.c (revision 62313) @@ -1302,7 +1302,7 @@ rb_source_location(int *pline) https://github.com/ruby/ruby/blob/trunk/vm.c#L1302 } } -const char * +MJIT_FUNC_EXPORTED const char * rb_source_location_cstr(int *pline) { VALUE path = rb_source_location(pline); Index: tool/ruby_vm/views/_insn_name_info.erb =================================================================== --- tool/ruby_vm/views/_insn_name_info.erb (revision 62312) +++ tool/ruby_vm/views/_insn_name_info.erb (revision 62313) @@ -13,7 +13,9 @@ https://github.com/ruby/ruby/blob/trunk/tool/ruby_vm/views/_insn_name_info.erb#L13 % CONSTFUNC(MAYBE_UNUSED(static const char *insn_name(VALUE insn))); extern const char *rb_vm_insn_name_info; +MJIT_SYMBOL_EXPORT_BEGIN extern const unsigned short rb_vm_insn_name_offset[]; +MJIT_SYMBOL_EXPORT_END #ifdef RUBY_VM_INSNS_INFO const unsigned short rb_vm_insn_name_offset[] = { -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/