From: KOSAKI Motohiro Date: 2011-06-14T20:45:27+09:00 Subject: [ruby-dev:43804] Re: [ruby-changes:19939] kosaki:r31986 (trunk): * ext/tk/tcltklib.c (lib_eventloop_core): replace CHECK_INTS with 2011年6月12日0:00 Hidetoshi NAGAI : > 永井@知能.九工大です. > > From: KOSAKI Motohiro > Subject: [ruby-dev:43710] Re: [ruby-changes:19939] kosaki:r31986 (trunk): * ext/tk/tcltklib.c (lib_eventloop_core): replace CHECK_INTS with > Date: Sat, 11 Jun 2011 14:41:02 +0900 > Message-ID: >> Macでコンパイルが通らなかったので勝手にコミットしてしまったのですが >> 問題ないか見ていただけないでしょうか? > (snip) >> > Index: ext/tk/tcltklib.c >> > =================================================================== >> > --- ext/tk/tcltklib.c (revision 31985) >> > +++ ext/tk/tcltklib.c (revision 31986) >> > @@ -2530,7 +2530,7 @@ >> > #ifdef RUBY_USE_NATIVE_THREAD >> > /* if (update_flag == 0) CHECK_INTS; */ /*XXXXXXXXXXXXX TODO !!!! */ >> > #else >> > - if (update_flag == 0) CHECK_INTS; >> > + if (update_flag == 0) rb_thread_check_ints(); >> > #endif >> > >> > } > > 問題は ruby 1.9 でありながら RUBY_USE_NATIVE_THREAD が未定義な点です. > extconf.rb で have_func("ruby_native_thread_p", "ruby.h") で > チェックしていて,HAVE_RUBY_NATIVE_THREAD_P が定義されれば > RUBY_USE_NATIVE_THREAD も定義されるはずと思ってました. > > MacOSX って,have_func("ruby_native_thread_p", "ruby.h") は > false になっちゃうんでしょうか? ええと、すくなくとも本日の ruby_native_thread_p() は yesになっていますね。 mkmf.logを下に pasteします。 他に問題があると言っているのではなく、最近のいくつかの修正で挙動が 変わっているようです。ちゃんとbisect出来ていませんが。 現在はこのコミットをrevert しても現在は動きます。よって不適切なコミットなのであれば (文面からはそれっぽいですが)、逆変更コミットをしていただけないでしょうか? また、修正した身に覚えがないということであれば、多少時期が遅くなっても よいのであれば bisect 調査に協力できます。 よろしくお願い致します ーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーー have_func: checking for ruby_native_thread_p() in ruby.h... -------------------- yes "gcc -o conftest -I../../.ext/include/x86_64-darwin10.7.4 -I../.././include -I../.././ext/tk -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wshorten-64-to-32 -Wimplicit-function-declaration -pipe conftest.c -L. -L../.. -L. -lruby-static -lpthread -ldl -lobjc " checked program was: /* begin */ 1: #include "ruby.h" 2: 3: #include 4: 5: /*top*/ 6: int main() {return 0;} 7: int t() { void ((*volatile p)()); p = (void ((*)()))ruby_native_thread_p; return 0; } /* end */ -------------------- have_func: checking for rb_errinfo() in ruby.h... -------------------- yes "gcc -o conftest -I../../.ext/include/x86_64-darwin10.7.4 -I../.././include -I../.././ext/tk -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wshorten-64-to-32 -Wimplicit-function-declaration -pipe conftest.c -L. -L../.. -L. -lruby-static -lpthread -ldl -lobjc " checked program was: /* begin */ 1: #include "ruby.h" 2: 3: #include 4: 5: /*top*/ 6: int main() {return 0;} 7: int t() { void ((*volatile p)()); p = (void ((*)()))rb_errinfo; return 0; } /* end */ -------------------- have_func: checking for rb_safe_level() in ruby.h... -------------------- yes "gcc -o conftest -I../../.ext/include/x86_64-darwin10.7.4 -I../.././include -I../.././ext/tk -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wshorten-64-to-32 -Wimplicit-function-declaration -pipe conftest.c -L. -L../.. -L. -lruby-static -lpthread -ldl -lobjc " checked program was: /* begin */ 1: #include "ruby.h" 2: 3: #include 4: 5: /*top*/ 6: int main() {return 0;} 7: int t() { void ((*volatile p)()); p = (void ((*)()))rb_safe_level; return 0; } /* end */ -------------------- have_func: checking for rb_hash_lookup() in ruby.h... -------------------- yes "gcc -o conftest -I../../.ext/include/x86_64-darwin10.7.4 -I../.././include -I../.././ext/tk -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wshorten-64-to-32 -Wimplicit-function-declaration -pipe conftest.c -L. -L../.. -L. -lruby-static -lpthread -ldl -lobjc " checked program was: /* begin */ 1: #include "ruby.h" 2: 3: #include 4: 5: /*top*/ 6: int main() {return 0;} 7: int t() { void ((*volatile p)()); p = (void ((*)()))rb_hash_lookup; return 0; } /* end */ -------------------- have_func: checking for rb_proc_new() in ruby.h... -------------------- yes "gcc -o conftest -I../../.ext/include/x86_64-darwin10.7.4 -I../.././include -I../.././ext/tk -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wshorten-64-to-32 -Wimplicit-function-declaration -pipe conftest.c -L. -L../.. -L. -lruby-static -lpthread -ldl -lobjc " checked program was: /* begin */ 1: #include "ruby.h" 2: 3: #include 4: 5: /*top*/ 6: int main() {return 0;} 7: int t() { void ((*volatile p)()); p = (void ((*)()))rb_proc_new; return 0; } /* end */ -------------------- have_func: checking for rb_obj_untrust() in ruby.h... -------------------- yes "gcc -o conftest -I../../.ext/include/x86_64-darwin10.7.4 -I../.././include -I../.././ext/tk -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wshorten-64-to-32 -Wimplicit-function-declaration -pipe conftest.c -L. -L../.. -L. -lruby-static -lpthread -ldl -lobjc " checked program was: /* begin */ 1: #include "ruby.h" 2: 3: #include 4: 5: /*top*/ 6: int main() {return 0;} 7: int t() { void ((*volatile p)()); p = (void ((*)()))rb_obj_untrust; return 0; } /* end */ -------------------- have_func: checking for rb_obj_taint() in ruby.h... -------------------- yes "gcc -o conftest -I../../.ext/include/x86_64-darwin10.7.4 -I../.././include -I../.././ext/tk -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wshorten-64-to-32 -Wimplicit-function-declaration -pipe conftest.c -L. -L../.. -L. -lruby-static -lpthread -ldl -lobjc " checked program was: /* begin */ 1: #include "ruby.h" 2: 3: #include 4: 5: /*top*/ 6: int main() {return 0;} 7: int t() { void ((*volatile p)()); p = (void ((*)()))rb_obj_taint; return 0; } /* end */ -------------------- have_func: checking for rb_set_safe_level_force() in ruby.h... -------------------- yes "gcc -o conftest -I../../.ext/include/x86_64-darwin10.7.4 -I../.././include -I../.././ext/tk -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wshorten-64-to-32 -Wimplicit-function-declaration -pipe conftest.c -L. -L../.. -L. -lruby-static -lpthread -ldl -lobjc " checked program was: /* begin */ 1: #include "ruby.h" 2: 3: #include 4: 5: /*top*/ 6: int main() {return 0;} 7: int t() { void ((*volatile p)()); p = (void ((*)()))rb_set_safe_level_force; return 0; } /* end */ -------------------- have_func: checking for rb_sourcefile() in ruby.h... -------------------- yes "gcc -o conftest -I../../.ext/include/x86_64-darwin10.7.4 -I../.././include -I../.././ext/tk -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wshorten-64-to-32 -Wimplicit-function-declaration -pipe conftest.c -L. -L../.. -L. -lruby-static -lpthread -ldl -lobjc " checked program was: /* begin */ 1: #include "ruby.h" 2: 3: #include 4: 5: /*top*/ 6: int main() {return 0;} 7: int t() { void ((*volatile p)()); p = (void ((*)()))rb_sourcefile; return 0; } /* end */ -------------------- have_struct_member: checking for struct RArray.ptr in ruby.h... -------------------- no "gcc -I../../.ext/include/x86_64-darwin10.7.4 -I../.././include -I../.././ext/tk -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wshorten-64-to-32 -Wimplicit-function-declaration -pipe -c conftest.c" conftest.c:7: error: ‘struct RArray’ has no member named ‘ptr’ checked program was: /* begin */ 1: #include "ruby.h" 2: 3: #include 4: 5: /*top*/ 6: int main() {return 0;} 7: int s = (char *)&((struct RArray*)0)->ptr - (char *)0; /* end */ -------------------- have_struct_member: checking for struct RArray.len in ruby.h... -------------------- no "gcc -I../../.ext/include/x86_64-darwin10.7.4 -I../.././include -I../.././ext/tk -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wshorten-64-to-32 -Wimplicit-function-declaration -pipe -c conftest.c" conftest.c:7: error: ‘struct RArray’ has no member named ‘len’ checked program was: /* begin */ 1: #include "ruby.h" 2: 3: #include 4: 5: /*top*/ 6: int main() {return 0;} 7: int s = (char *)&((struct RArray*)0)->len - (char *)0; /* end */ -------------------- have_library: checking for t_open() in -lnsl... -------------------- no "gcc -o conftest -I../../.ext/include/x86_64-darwin10.7.4 -I../.././include -I../.././ext/tk -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wshorten-64-to-32 -Wimplicit-function-declaration -pipe conftest.c -L. -L../.. -L. -lruby-static -lnsl -lpthread -ldl -lobjc " conftest.c: In function ‘t’: conftest.c:5: error: ‘t_open’ undeclared (first use in this function) conftest.c:5: error: (Each undeclared identifier is reported only once conftest.c:5: error: for each function it appears in.) checked program was: /* begin */ 1: #include "ruby.h" 2: 3: /*top*/ 4: int main() {return 0;} 5: int t() { void ((*volatile p)()); p = (void ((*)()))t_open; return 0; } /* end */ "gcc -o conftest -I../../.ext/include/x86_64-darwin10.7.4 -I../.././include -I../.././ext/tk -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wshorten-64-to-32 -Wimplicit-function-declaration -pipe conftest.c -L. -L../.. -L. -lruby-static -lnsl -lpthread -ldl -lobjc " conftest.c: In function ‘t’: conftest.c:5: warning: implicit declaration of function ‘t_open’ ld: library not found for -lnsl collect2: ld returned 1 exit status checked program was: /* begin */ 1: #include "ruby.h" 2: 3: /*top*/ 4: int main() {return 0;} 5: int t() { t_open(); return 0; } /* end */ -------------------- have_library: checking for socket() in -lsocket... -------------------- no "gcc -o conftest -I../../.ext/include/x86_64-darwin10.7.4 -I../.././include -I../.././ext/tk -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wshorten-64-to-32 -Wimplicit-function-declaration -pipe conftest.c -L. -L../.. -L. -lruby-static -lsocket -lpthread -ldl -lobjc " conftest.c: In function ‘t’: conftest.c:5: error: ‘socket’ undeclared (first use in this function) conftest.c:5: error: (Each undeclared identifier is reported only once conftest.c:5: error: for each function it appears in.) checked program was: /* begin */ 1: #include "ruby.h" 2: 3: /*top*/ 4: int main() {return 0;} 5: int t() { void ((*volatile p)()); p = (void ((*)()))socket; return 0; } /* end */ "gcc -o conftest -I../../.ext/include/x86_64-darwin10.7.4 -I../.././include -I../.././ext/tk -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wshorten-64-to-32 -Wimplicit-function-declaration -pipe conftest.c -L. -L../.. -L. -lruby-static -lsocket -lpthread -ldl -lobjc " conftest.c: In function ‘t’: conftest.c:5: warning: implicit declaration of function ‘socket’ ld: library not found for -lsocket collect2: ld returned 1 exit status checked program was: /* begin */ 1: #include "ruby.h" 2: 3: /*top*/ 4: int main() {return 0;} 5: int t() { socket(); return 0; } /* end */ -------------------- have_library: checking for dlopen() in -ldl... -------------------- yes "gcc -o conftest -I../../.ext/include/x86_64-darwin10.7.4 -I../.././include -I../.././ext/tk -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wshorten-64-to-32 -Wimplicit-function-declaration -pipe conftest.c -L. -L../.. -L. -lruby-static -ldl -lpthread -ldl -lobjc " conftest.c: In function ‘t’: conftest.c:5: error: ‘dlopen’ undeclared (first use in this function) conftest.c:5: error: (Each undeclared identifier is reported only once conftest.c:5: error: for each function it appears in.) checked program was: /* begin */ 1: #include "ruby.h" 2: 3: /*top*/ 4: int main() {return 0;} 5: int t() { void ((*volatile p)()); p = (void ((*)()))dlopen; return 0; } /* end */ "gcc -o conftest -I../../.ext/include/x86_64-darwin10.7.4 -I../.././include -I../.././ext/tk -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wshorten-64-to-32 -Wimplicit-function-declaration -pipe conftest.c -L. -L../.. -L. -lruby-static -ldl -lpthread -ldl -lobjc " conftest.c: In function ‘t’: conftest.c:5: warning: implicit declaration of function ‘dlopen’ checked program was: /* begin */ 1: #include "ruby.h" 2: 3: /*top*/ 4: int main() {return 0;} 5: int t() { dlopen(); return 0; } /* end */ -------------------- have_library: checking for log() in -lm... -------------------- yes "gcc -o conftest -I../../.ext/include/x86_64-darwin10.7.4 -I../.././include -I../.././ext/tk -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wshorten-64-to-32 -Wimplicit-function-declaration -pipe conftest.c -L. -L../.. -L. -ldl -lruby-static -lm -ldl -lpthread -ldl -lobjc " checked program was: /* begin */ 1: #include "ruby.h" 2: 3: #include 4: 5: /*top*/ 6: int main() {return 0;} 7: int t() { void ((*volatile p)()); p = (void ((*)()))log; return 0; } /* end */ -------------------- "gcc -I../../.ext/include/x86_64-darwin10.7.4 -I../.././include -I../.././ext/tk -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wshorten-64-to-32 -Wimplicit-function-declaration -pipe -c conftest.c" checked program was: /* begin */ 1: #include "ruby.h" 2: 3: #include "ruby.h" 4: /*top*/ 5: #ifndef HAVE_NATIVETHREAD 6: # error 7: >>>>>> HAVE_NATIVETHREAD undefined <<<<<< 8: #endif /* end */