All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ruby: Do not use ucontext implementation for coroutines on musl/riscv
@ 2021-02-18  3:52 Khem Raj
  2021-02-18 11:23 ` [OE-core] " Konrad Weihmann
  0 siblings, 1 reply; 3+ messages in thread
From: Khem Raj @ 2021-02-18  3:52 UTC (permalink / raw)
  To: openembedded-core; +Cc: Khem Raj

The coroutine implementation in ruby has either arch specific
implementations or it falls back to slower ucontext API based
implementation assuming libc will provide the needed APIs, however musl
does not implement ucontext APIs like glibc, therefore fallback is to
use libucontext library on musl. However, libucontext is not ported to
riscv yet. which means on musl/riscv ruby is unbuildable, however a
third option is to use copy implementation for coroutines, which will be
not as good performance-wise, but it will do the job, therefore for now
use copy implementation for rv32/rv64 when using musl

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 meta/recipes-devtools/ruby/ruby_3.0.0.bb | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/meta/recipes-devtools/ruby/ruby_3.0.0.bb b/meta/recipes-devtools/ruby/ruby_3.0.0.bb
index 5e143ee87f..28e12c3cd7 100644
--- a/meta/recipes-devtools/ruby/ruby_3.0.0.bb
+++ b/meta/recipes-devtools/ruby/ruby_3.0.0.bb
@@ -32,6 +32,13 @@ EXTRA_OECONF_append_libc-musl = "\
     ac_cv_func_isinf=yes \
 "
 
+EXTRA_OECONF_append_libc-musl_riscv64 = "\
+    --with-coroutine=copy \
+"
+EXTRA_OECONF_append_libc-musl_riscv32 = "\
+    --with-coroutine=copy \
+"
+
 do_install() {
     oe_runmake 'DESTDIR=${D}' install
 }
-- 
2.30.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [OE-core] [PATCH] ruby: Do not use ucontext implementation for coroutines on musl/riscv
  2021-02-18  3:52 [PATCH] ruby: Do not use ucontext implementation for coroutines on musl/riscv Khem Raj
@ 2021-02-18 11:23 ` Konrad Weihmann
  2021-02-18 15:36   ` Khem Raj
  0 siblings, 1 reply; 3+ messages in thread
From: Konrad Weihmann @ 2021-02-18 11:23 UTC (permalink / raw)
  To: openembedded-core, Khem Raj

I think I saw something similar on x86 builds (or was it arm32, don't 
remember) - so it might be worth discussing to make this setting the 
default and configurable to the user - thoughts?

On 18.02.21 04:52, Khem Raj wrote:
> The coroutine implementation in ruby has either arch specific
> implementations or it falls back to slower ucontext API based
> implementation assuming libc will provide the needed APIs, however musl
> does not implement ucontext APIs like glibc, therefore fallback is to
> use libucontext library on musl. However, libucontext is not ported to
> riscv yet. which means on musl/riscv ruby is unbuildable, however a
> third option is to use copy implementation for coroutines, which will be
> not as good performance-wise, but it will do the job, therefore for now
> use copy implementation for rv32/rv64 when using musl
> 
> Signed-off-by: Khem Raj <raj.khem@gmail.com>
> ---
>   meta/recipes-devtools/ruby/ruby_3.0.0.bb | 7 +++++++
>   1 file changed, 7 insertions(+)
> 
> diff --git a/meta/recipes-devtools/ruby/ruby_3.0.0.bb b/meta/recipes-devtools/ruby/ruby_3.0.0.bb
> index 5e143ee87f..28e12c3cd7 100644
> --- a/meta/recipes-devtools/ruby/ruby_3.0.0.bb
> +++ b/meta/recipes-devtools/ruby/ruby_3.0.0.bb
> @@ -32,6 +32,13 @@ EXTRA_OECONF_append_libc-musl = "\
>       ac_cv_func_isinf=yes \
>   "
>   
> +EXTRA_OECONF_append_libc-musl_riscv64 = "\
> +    --with-coroutine=copy \
> +"
> +EXTRA_OECONF_append_libc-musl_riscv32 = "\
> +    --with-coroutine=copy \
> +"
> +
>   do_install() {
>       oe_runmake 'DESTDIR=${D}' install
>   }
> 
> 
> 
> 
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [OE-core] [PATCH] ruby: Do not use ucontext implementation for coroutines on musl/riscv
  2021-02-18 11:23 ` [OE-core] " Konrad Weihmann
@ 2021-02-18 15:36   ` Khem Raj
  0 siblings, 0 replies; 3+ messages in thread
From: Khem Raj @ 2021-02-18 15:36 UTC (permalink / raw)
  To: Konrad Weihmann; +Cc: openembedded-core

[-- Attachment #1: Type: text/plain, Size: 1973 bytes --]

I don’t think it should be default since other options if implemented will
perform better so it’s a last resort solution so I would suggest to use it
only where it’s needed

On Thu, Feb 18, 2021 at 3:23 AM Konrad Weihmann <kweihmann@outlook.com>
wrote:

> I think I saw something similar on x86 builds (or was it arm32, don't
> remember) - so it might be worth discussing to make this setting the
> default and configurable to the user - thoughts?
>
> On 18.02.21 04:52, Khem Raj wrote:
> > The coroutine implementation in ruby has either arch specific
> > implementations or it falls back to slower ucontext API based
> > implementation assuming libc will provide the needed APIs, however musl
> > does not implement ucontext APIs like glibc, therefore fallback is to
> > use libucontext library on musl. However, libucontext is not ported to
> > riscv yet. which means on musl/riscv ruby is unbuildable, however a
> > third option is to use copy implementation for coroutines, which will be
> > not as good performance-wise, but it will do the job, therefore for now
> > use copy implementation for rv32/rv64 when using musl
> >
> > Signed-off-by: Khem Raj <raj.khem@gmail.com>
> > ---
> >   meta/recipes-devtools/ruby/ruby_3.0.0.bb | 7 +++++++
> >   1 file changed, 7 insertions(+)
> >
> > diff --git a/meta/recipes-devtools/ruby/ruby_3.0.0.bb
> b/meta/recipes-devtools/ruby/ruby_3.0.0.bb
> > index 5e143ee87f..28e12c3cd7 100644
> > --- a/meta/recipes-devtools/ruby/ruby_3.0.0.bb
> > +++ b/meta/recipes-devtools/ruby/ruby_3.0.0.bb
> > @@ -32,6 +32,13 @@ EXTRA_OECONF_append_libc-musl = "\
> >       ac_cv_func_isinf=yes \
> >   "
> >
> > +EXTRA_OECONF_append_libc-musl_riscv64 = "\
> > +    --with-coroutine=copy \
> > +"
> > +EXTRA_OECONF_append_libc-musl_riscv32 = "\
> > +    --with-coroutine=copy \
> > +"
> > +
> >   do_install() {
> >       oe_runmake 'DESTDIR=${D}' install
> >   }
> >
> >
> >
> > 
> >
>

[-- Attachment #2: Type: text/html, Size: 2916 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-02-18 15:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-18  3:52 [PATCH] ruby: Do not use ucontext implementation for coroutines on musl/riscv Khem Raj
2021-02-18 11:23 ` [OE-core] " Konrad Weihmann
2021-02-18 15:36   ` Khem Raj

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.