summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2021-01-22 23:41:52 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2021-01-22 23:41:52 +0900
commit07b4b1b1cbafb73c03d04f25c8f3ae6d70975ed5 (patch)
tree34fc936e5c66d0d6a7b877555fc8eef1283fce81
parente34eb58ac71ddac2d90315b35adfb2c0bf880369 (diff)
Support coroutine on universal binary
-rw-r--r--configure.ac3
-rw-r--r--coroutine/universal/Context.S12
-rw-r--r--coroutine/universal/Context.h17
-rw-r--r--template/Makefile.in2
4 files changed, 33 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac
index 65afe5a99b..225a0ec218 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2412,6 +2412,9 @@ AS_CASE([$rb_cv_coroutine], [yes|''], [
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 0000000000..0fd8c01e7f
--- /dev/null
+++ b/coroutine/universal/Context.S
@@ -0,0 +1,12 @@
+#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 0000000000..9a2ef425db
--- /dev/null
+++ b/coroutine/universal/Context.h
@@ -0,0 +1,17 @@
+#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 72e37b512a..a1fd24154b 100644
--- a/template/Makefile.in
+++ b/template/Makefile.in
@@ -217,7 +217,7 @@ AR = @AR@
ARFLAGS = @ARFLAGS@$(empty)
RANLIB = @RANLIB@
AS = @AS@
-ASFLAGS = @ASFLAGS@ $(INCFLAGS)
+ASFLAGS = @ASFLAGS@ $(ARCH_FLAG) $(INCFLAGS)
IFCHANGE = $(tooldir)/ifchange
OBJDUMP = @OBJDUMP@
OBJCOPY = @OBJCOPY@