From: Nobuyoshi Nakada Date: 2009-04-19T20:12:54+09:00 Subject: [ruby-core:23255] Re: [Bug #1388] cygwin-1.7, gcc4-4.3, and ruby-1.9. make btest #236 test_io.rb Segmentation fault Hi, At Sat, 18 Apr 2009 04:56:10 +0900, neomjp neomjp wrote in [ruby-core:23241]: > * eval_intern.h [CYGWIN]: Remove #ifdef __CYGWIN__ for _setjmp() and _longjmp(). Cygwin-1.7 > has its own definition in /usr/include/machine/setjmp.h . This is the minimally required > patch to make the compilation go through to the end. > -#ifdef __CYGWIN__ > -int _setjmp(), _longjmp(); > -#endif The definitions seem just with extern and arguments, and above declaration doesn't seem conflict with them, what error does occur? > * ruby.c (push_include_cygwin): Use cygwin_conv_path instead of cygwin_conv_to_posix_path > which is deprecated in cygwin-1.7. > * ruby.c (ruby_init_loadpath_safe): Use cygwin_conv_path instead of cygwin_conv_to_posix_path > which is deprecated in cygwin-1.7. > - if (cygwin_conv_to_posix_path(p, rubylib) == 0) > + if (cygwin_conv_path(CCP_WIN_W_TO_POSIX | CCP_RELATIVE, p, rubylib, 1) > + == 0) I suspect it should use CCP_WIN_A_TO_POSIX and sizeof(rubylib) instead of 1, am I wrong? > * strftime.c [CYGWIN]: Cygwin defines _timezone, _daylight, *_tzname[2], and tzname > with dllimport attribute. But defines daylight and timezone without > dllimport attribute. OK. > make: *** No rule to make target `thread_.h', needed by `miniprelude.o'. Stop. > *** ERROR: make failed > > This is because THREAD_MODEL is empty in Makefile. Looking into configure.in, I can see that when > > if test "$rb_with_pthread" = "yes"; > > is false and > > case "$target_os" in > when(cygwin*) > > then THREAD_MODEL gets undefined. (when(mingw*) is true, THREAD_MODEL=win32.) If I compile like > > CC=gcc-4 configure --program-suffix="-19" --disable-pthread > make THREAD_MODEL=w32 Previously, it couldn't work with THREAD_MODEL=win32, maybe something improved with cygwin 1.7? > But include/ruby/ruby.h has > > #define HAVE_NATIVETHREAD > > without any #ifdefs. So the pthread mode check in > ext/tk/extconf.rb always evaluates to be true even when > pthread support is disabled. This should be corrected. If > these issues are corrected, then ruby-1.9 trunk can get > compiled without warnings. OK, I'll fix it. > When I tried make run or make runruby, it failed. make run is supporsed to run your own script, so test.rb is a file which you should make. test-sample is what you want. > But the result of make btest is bad. > > #236 test_io.rb: > at_exit { p :foo } > | c:0004 p:---- s:0010 b:0010 l:000009 d:000009 CFUNC :p > | c:0003 p:0011 s:0006 b:0006 l:000aec d:000005 BLOCK bootstraptest.tmp.rb:2 Segfaults in the at_exit block. I'll investigate it. -- Nobu Nakada