Skip to content

Commit ea0cede

Browse files
committed
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) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63730 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
1 parent d62b7e1 commit ea0cede

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

mjit.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -610,18 +610,20 @@ static const char *const CC_DLDFLAGS_ARGS[] = {
610610
MJIT_DLDFLAGS
611611
#if defined __GNUC__ && !defined __clang__
612612
"-nostartfiles",
613-
# ifndef _WIN32
613+
# if !defined(_WIN32) && !defined(__CYGWIN__)
614614
"-nodefaultlibs", "-nostdlib",
615615
# endif
616616
#endif
617617
NULL
618618
};
619619

620620
static const char *const CC_LIBS[] = {
621-
#ifdef _WIN32
621+
#if defined(_WIN32) || defined(__CYGWIN__)
622622
MJIT_LIBS
623623
# if defined __GNUC__ && !defined __clang__
624+
# if defined(_WIN32)
624625
"-lmsvcrt",
626+
# endif
625627
"-lgcc",
626628
# endif
627629
#endif

thread_pthread.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1757,7 +1757,6 @@ rb_thread_create_mjit_thread(void (*child_hook)(void), void (*worker_func)(void)
17571757

17581758
/* jit_worker thread is not to be joined */
17591759
if (pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED) == 0
1760-
&& pthread_attr_setscope(&attr, PTHREAD_SCOPE_SYSTEM) == 0
17611760
&& pthread_create(&worker_pid, &attr, mjit_worker, (void *)worker_func) == 0) {
17621761
ret = TRUE;
17631762
}

0 commit comments

Comments
 (0)