ruby-changes:64998
From: Nobuyoshi <ko1@a...>
Date: Fri, 22 Jan 2021 23:46:52 +0900 (JST)
Subject: [ruby-changes:64998] 07b4b1b1cb (master): Support coroutine on universal binary
https://git.ruby-lang.org/ruby.git/commit/?id=07b4b1b1cb From 07b4b1b1cbafb73c03d04f25c8f3ae6d70975ed5 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada <nobu@r...> Date: Fri, 22 Jan 2021 23:41:52 +0900 Subject: Support coroutine on universal binary diff --git a/configure.ac b/configure.ac index 65afe5a..225a0ec 100644 --- a/configure.ac +++ b/configure.ac @@ -2412,6 +2412,9 @@ AS_CASE([$rb_cv_coroutine], [yes|''], [ https://github.com/ruby/ruby/blob/trunk/configure.ac#L2412 AC_MSG_CHECKING(native coroutine implementation for ${target_cpu}-${target_os}) rb_cv_coroutine= AS_CASE(["$target_cpu-$target_os"], + [universal-darwin*], [ + rb_cv_coroutine=universal + ], [x*64-darwin*], [ rb_cv_coroutine=amd64 ], diff --git a/coroutine/universal/Context.S b/coroutine/universal/Context.S new file mode 100644 index 0000000..0fd8c01 --- /dev/null +++ b/coroutine/universal/Context.S @@ -0,0 +1,12 @@ https://github.com/ruby/ruby/blob/trunk/coroutine/universal/Context.S#L1 +#if 0 +#elif defined __x86_64__ +# include "coroutine/amd64/Context.S" +#elif defined __i386__ +# include "coroutine/x86/Context.S" +#elif defined __ppc64__ +# include "coroutine/ppc64le/Context.S" +#elif defined __arm64__ +# include "coroutine/arm64/Context.S" +#else +# error "Unsupported CPU" +#endif diff --git a/coroutine/universal/Context.h b/coroutine/universal/Context.h new file mode 100644 index 0000000..9a2ef42 --- /dev/null +++ b/coroutine/universal/Context.h @@ -0,0 +1,17 @@ https://github.com/ruby/ruby/blob/trunk/coroutine/universal/Context.h#L1 +#ifndef COROUTINE_UNIVERSAL_CONTEXT_H +#define COROUTINE_UNIVERSAL_CONTEXT_H 1 + +#if 0 +#elif defined __x86_64__ +# include "coroutine/amd64/Context.h" +#elif defined __i386__ +# include "coroutine/x86/Context.h" +#elif defined __ppc64__ +# include "coroutine/ppc64le/Context.h" +#elif defined __arm64__ +# include "coroutine/arm64/Context.h" +#else +# error "Unsupported CPU" +#endif + +#endif /* COROUTINE_UNIVERSAL_CONTEXT_H */ diff --git a/template/Makefile.in b/template/Makefile.in index 72e37b5..a1fd241 100644 --- a/template/Makefile.in +++ b/template/Makefile.in @@ -217,7 +217,7 @@ AR = @AR@ https://github.com/ruby/ruby/blob/trunk/template/Makefile.in#L217 ARFLAGS = @ARFLAGS@$(empty) RANLIB = @RANLIB@ AS = @AS@ -ASFLAGS = @ASFLAGS@ $(INCFLAGS) +ASFLAGS = @ASFLAGS@ $(ARCH_FLAG) $(INCFLAGS) IFCHANGE = $(tooldir)/ifchange OBJDUMP = @OBJDUMP@ OBJCOPY = @OBJCOPY@ -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/