ruby-changes:51520
From: k0kubun <ko1@a...>
Date: Sat, 23 Jun 2018 16:21:18 +0900 (JST)
Subject: [ruby-changes:51520] k0kubun:r63730 (trunk): mjit.c: initial cygwin support
k0kubun 2018-06-23 16:21:12 +0900 (Sat, 23 Jun 2018) New Revision: 63730 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=63730 Log: mjit.c: initial cygwin support thread_pthread.c: Drop pthread_attr_setscope usage. It seems that, at least on Linux and macOS, PTHREAD_SCOPE_PROCESS is not supported and thus PTHREAD_SCOPE_SYSTEM should be used by default. Let's just stop calling this until we find some platform that needs `pthread_attr_setscope(&attr, PTHREAD_SCOPE_SYSTEM)`. [Misc #14854] From: fd0 (Daisuke Fujimura) Modified files: trunk/mjit.c trunk/thread_pthread.c Index: mjit.c =================================================================== --- mjit.c (revision 63729) +++ mjit.c (revision 63730) @@ -610,7 +610,7 @@ static const char *const CC_DLDFLAGS_ARG https://github.com/ruby/ruby/blob/trunk/mjit.c#L610 MJIT_DLDFLAGS #if defined __GNUC__ && !defined __clang__ "-nostartfiles", -# ifndef _WIN32 +# if !defined(_WIN32) && !defined(__CYGWIN__) "-nodefaultlibs", "-nostdlib", # endif #endif @@ -618,10 +618,12 @@ static const char *const CC_DLDFLAGS_ARG https://github.com/ruby/ruby/blob/trunk/mjit.c#L618 }; static const char *const CC_LIBS[] = { -#ifdef _WIN32 +#if defined(_WIN32) || defined(__CYGWIN__) MJIT_LIBS # if defined __GNUC__ && !defined __clang__ +# if defined(_WIN32) "-lmsvcrt", +# endif "-lgcc", # endif #endif Index: thread_pthread.c =================================================================== --- thread_pthread.c (revision 63729) +++ thread_pthread.c (revision 63730) @@ -1757,7 +1757,6 @@ rb_thread_create_mjit_thread(void (*chil https://github.com/ruby/ruby/blob/trunk/thread_pthread.c#L1757 /* jit_worker thread is not to be joined */ if (pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED) == 0 - && pthread_attr_setscope(&attr, PTHREAD_SCOPE_SYSTEM) == 0 && pthread_create(&worker_pid, &attr, mjit_worker, (void *)worker_func) == 0) { ret = TRUE; } -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/