summaryrefslogtreecommitdiff
path: root/coroutine
AgeCommit message (Collapse)Author
2020-09-30merge revision(s) ↵nagachika
f96216df8dfd2d1e206150572912289f4dda7386,0091fac1d8de07e86fef8315ba77609bed9dd7f5,04c704c5c967ea9bded6bf645439fe59c7d9f7d6,23655e6de5ee989feb8c65c7061fe9a71579dc54,7cb8904a12c850ee30dcd67817fa2f9dc3fee813,41168f69fbeb32cfc88210911d62e419b8116589,87f6154bb4c67ca77ee353bb1fe25a922036c0e5: [Backport #17202] Remove "All Rights Reserved." from Copyright statement. Patch assembly so that it aligns properly Removed trailing spaces [ci skip] Fix build error on Apple silicon macOS This patch will fix following build error on macOS 11.0 + Xcode 12 beta. ``` $ ./configure $ make V=1 BASERUBY = /Users/watson/.rbenv/shims/ruby --disable=gems CC = clang -fdeclspec LD = ld LDSHARED = clang -fdeclspec -dynamiclib CFLAGS = -O3 -ggdb3 -Wall -Wextra -Werror=deprecated-declarations -Werror=division-by-zero -Werror=implicit-function-declaration -Werror=implicit-int -Werror=misleading-indentation -Werror=pointer-arith -Werror=shorten-64-to-32 -Werror=write-strings -Wmissing-noreturn -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wunused-variable -Werror=extra-tokens -std=gnu99 -pipe XCFLAGS = -D_FORTIFY_SOURCE=2 -fstack-protector-strong -fno-strict-overflow -DRUBY_DEVEL=1 -fvisibility=hidden -DRUBY_EXPORT -fPIE -DCANONICALIZATION_FOR_MATHN -I. -I.ext/include/arm64-darwin20 -I./include -I. -I./enc/unicode/12.1.0 CPPFLAGS = -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT DLDFLAGS = -Wl,-undefined,dynamic_lookup -Wl,-multiply_defined,suppress -fstack-protector-strong -Wl,-pie -framework Security -framework Foundation SOLIBS = -lpthread -ldl -lobjc LANG = ja_JP.UTF-8 LC_ALL = LC_CTYPE = MFLAGS = Apple clang version 12.0.0 (clang-1200.0.22.19) Target: arm64-apple-darwin20.0.0 Thread model: posix InstalledDir: /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin clang -fdeclspec -O3 -ggdb3 -Wall -Wextra -Werror=deprecated-declarations -Werror=division-by-zero -Werror=implicit-function-declaration -Werror=implicit-int -Werror=misleading-indentation -Werror=pointer-arith -Werror=shorten-64-to-32 -Werror=write-strings -Wmissing-noreturn -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wunused-variable -Werror=extra-tokens -std=gnu99 -pipe -D_FORTIFY_SOURCE=2 -fstack-protector-strong -fno-strict-overflow -DRUBY_DEVEL=1 -fvisibility=hidden -DRUBY_EXPORT -fPIE -DCANONICALIZATION_FOR_MATHN -I. -I.ext/include/arm64-darwin20 -I./include -I. -I./enc/unicode/12.1.0 -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -o cont.o -c cont.c In file included from cont.c:19: ./coroutine/ucontext/Context.h:32:5: error: 'getcontext' is deprecated: first deprecated in macOS 10.6 [-Werror,-Wdeprecated-declarations] getcontext(&context->state); ^ /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/ucontext.h:37:6: note: 'getcontext' has been explicitly marked deprecated here int getcontext(ucontext_t *) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_5, __MAC_10_6, __IPHONE_2_0, __IPHONE_2_0) __WATCHOS_PROHIBITED __TVOS_PROHIBITED; ^ In file included from cont.c:19: ./coroutine/ucontext/Context.h:51:5: error: 'makecontext' is deprecated: first deprecated in macOS 10.6 [-Werror,-Wdeprecated-declarations] makecontext(&context->state, (void(*)(void))coroutine_trampoline, 2, (void*)start, (void*)context); ^ /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/ucontext.h:38:6: note: 'makecontext' has been explicitly marked deprecated here void makecontext(ucontext_t *, void (*)(), int, ...) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_5, __MAC_10_6, __IPHONE_2_0, __IPHONE_2_0) __WATCHOS_PROHI... ^ In file included from cont.c:19: ./coroutine/ucontext/Context.h:59:5: error: 'swapcontext' is deprecated: first deprecated in macOS 10.6 [-Werror,-Wdeprecated-declarations] swapcontext(&current->state, &target->state); ^ /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/ucontext.h:40:6: note: 'swapcontext' has been explicitly marked deprecated here int swapcontext(ucontext_t * __restrict, const ucontext_t * __restrict) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_5, __MAC_10_6, __IPHONE_2_0, __IPHONE_... ^ 3 errors generated. make: *** [cont.o] Error 1 ``` Extract correct processor name for ARM64 Macs Prefix export symbol prefix to coroutine_transfer Revert "Revert "[ruby/fiddle] Use ffi_closure_free by default. (#20)"" This reverts commit efd641ffab34e433a8d8a7d78914576f2425aa90. This changeset seems to be needed to suppress a warning on Ubuntu 20.04 https://rubyci.org/logs/rubyci.s3.amazonaws.com/ubuntu/ruby-master/log/20200304T033004Z.log.html.gz ``` closure.c:264:5: warning: 'ffi_prep_closure' is deprecated: use ffi_prep_closure_loc instead [-Wdeprecated-declarations] 264 | result = ffi_prep_closure(pcl, cif, callback, (void *)self); | ^~~~~~ ``` I guess there was a reason why the commit was reverted (maybe some CIs failed?), so try it again.
2019-12-05coroutine/ucontext/Context.c: define __EXTENSIONS__ explicitlyYusuke Endoh
instead of ruby/config.h, per samuel's request. https://github.com/ruby/ruby/commit/dbfd4b780e3914a3f27e92c2248254452bf0fd6b#diff-7fd78c3cc8a19b7e0637502983ec26ff
2019-12-04coroutine/ucontext/Context.c: Include "ruby/config.h" for SolarisYusuke Endoh
getcontext, makecontext, and swapcontext seem to be available only when `__EXTENSION__` is defined on Solaris.
2019-11-05Fix coroutine support on win32Lars Kanis
Ruby master branch currently fails on win32 MINGW at this spec: https://github.com/ruby/spec/blob/master/core/thread/element_set_spec.rb MINGW makes use of setjmp3() implemented in MSVCRT.DLL. This function traverses the SEH list up to a terminating pointer 0xFFFFFFFF. It therefore currently segfaults on NULL. The SEH linked list must be terminated by 0xFFFFFFFF instead of NULL. This fixes the issue mentioned here: https://github.com/ruby/ruby/pull/2279#issuecomment-509508810 Notes: Merged: https://github.com/ruby/ruby/pull/2645
2019-07-19Add assertions to `coroutine_initialize_main`.Samuel Williams
2019-07-19Split assertions to check which one fails.Samuel Williams
2019-07-18Make fiber_pool more conservative on platforms with limited address space.Samuel Williams
We use COROUTINE_LIMITED_ADDRESS_SPACE to select platforms where address space is 32-bits or less. Fiber pool implementation enables more book keeping, and reduces upper limits, in order to minimise address space utilisation.
2019-07-18Stack copying implementation of coroutines.Samuel Williams
2019-07-07Add coroutine context switch for i386-mingw32Lars Kanis
It's essentially a translation of Context.asm from Intel to AT&T syntax.
2019-06-26Restore updated implementation of arm32 coroutine code, but prefer ucontext.Samuel Williams
2019-06-26Revert "coroutine/arm32/Context.S: save/restore the registers via stack"Yusuke Endoh
This reverts commit 6df1814c08df93bbc0b3e7a73649bcf82e126064. It caused a SEGV again: https://rubyci.org/logs/rubyci.s3.amazonaws.com/scw-9d6766/ruby-master/log/20190626T051707Z.fail.html.gz
2019-06-26Add `ucontext` coroutine implementation for generic fallback.Samuel Williams
2019-06-26coroutine/arm32/Context.S: save/restore the registers via stackYusuke Endoh
Retry of 518adcca0a and dbe232e24e
2019-06-25Revert 518adcca0a and dbe232e24eYusuke Endoh
518adcca0a: "Try using arm32 implementation for fibers." dbe232e24e: "Order of arguments might be incorrect in arm32 coroutine implementation." It seems to cause SEGV consistently on Ubuntu armv7l eabihf: https://rubyci.org/logs/rubyci.s3.amazonaws.com/scw-9d6766/ruby-master/log/20190625T081710Z.fail.html.gz https://rubyci.org/logs/rubyci.s3.amazonaws.com/scw-9d6766/ruby-master/log/20190625T111708Z.fail.html.gz
2019-06-25Order of arguments might be incorrect in arm32 coroutine implementation.Samuel Williams
2019-05-17Make COROUTINE_XMM_REGISTERS compile-time only tooNobuyoshi Nakada
2019-05-16Remove unused symbolsNobuyoshi Nakada
2019-05-16Make COROUTINE_REGISTERS compile-time only not to be a global symbolNobuyoshi Nakada
2018-12-11Ensure x86 stack is fortified, fixed #15335.samuel
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66341 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-10Native coroutine implementation for ppc64le Linuxodaira
* configure.ac: enable fiber coroutine for powerpc64le-linux * coroutine/ppc64le/Context.S: coroutine_transfer implementation * coroutine/ppc64le/Context.h: coroutine implementation git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66315 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-28Fix for coroutine/win32/Context.objnobu
* coroutine/win32/Context.asm: old ml version 9 needs CPU directive before `.model` directive. * win32/Makefile.sub: specify object directories to separate Win32 and Win64 targets. Win32 rule was overridden by Win64 rule and just ignored. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66059 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-24Ensure stack is correctly protectedsamuel
See https://bugs.ruby-lang.org/issues/15335 for more details. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65953 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-24Change Makefile rule for assembly to use .S rather than .ssamuel
It is more conventional to use compiler to pre-process and assemble the `.S` file rather than forcing Makefile to use `.s`. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65952 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-24Fix argument order.samuel
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65945 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-20Fix indentation.samuel
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65895 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-20GAS style assembly for win64 (mingw).samuel
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65876 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-20Fix struct usage.samuel
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65872 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-20Fix line endings.samuel
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65869 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-20Initial support for x64-mingw32samuel
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65868 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-20Better (?) support for Windows TIB.samuel
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65867 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-20* expand tabs.svn
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65862 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-20Prefer "static inline" to avoid duplicate symbols.samuel
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65861 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-20Remove trailing whitespace.samuel
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65860 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-20Formatting changes.samuel
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65857 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-20Ensure start function has correct declaration.samuel
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65856 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-20Mark COROUTINE as noreturn.samuel
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65853 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-20Tidy up comments.samuel
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65850 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-20* expand tabs.svn
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65848 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-20Initial effort to support 32-bit Linux.samuel
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65847 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-20Restore return value assignmentsamuel
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65839 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-20Native implementation of coroutines to improve performance of fiberssamuel
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65834 b2dd03c8-39d4-4d8f-98ff-823fe69b080e