[1/2] ruby: Use arm32 for coroutines on 32bit-arm

Submitted by Khem Raj on March 9, 2020, 11:44 p.m. | Patch ID: 170929

Details

Message ID 20200309234454.1387958-1-raj.khem@gmail.com
State New
Headers show

Commit Message

Khem Raj March 9, 2020, 11:44 p.m.
in 2.7 [2] ruby enabled ucontext for coroutines on arm32 but it does not
work for musl since it uses glibc specific functions e.g.
getcontext/swapcontext/swapcontext also see [1]

This patch reverts back to using arm32 implementation for coroutines on
arm

[1] https://bugs.ruby-lang.org/issues/16455#change-83442
[2] https://github.com/ruby/ruby/commit/6c6bf9ffcbfeb8be9d9c342e7604b74ec819e88a#diff-7fccec8474e2184cd2518046bf39d54cL10

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

Patch hide | download patch | download mbox

diff --git a/meta/recipes-devtools/ruby/ruby_2.7.0.bb b/meta/recipes-devtools/ruby/ruby_2.7.0.bb
index 268b4bebd9..884bb0ef44 100644
--- a/meta/recipes-devtools/ruby/ruby_2.7.0.bb
+++ b/meta/recipes-devtools/ruby/ruby_2.7.0.bb
@@ -25,6 +25,8 @@  EXTRA_OECONF = "\
     --with-pkg-config=pkg-config \
 "
 
+EXTRA_OECONF_append_arm_libc-musl = " --with-coroutine=arm32"
+
 do_install() {
     oe_runmake 'DESTDIR=${D}' install
 }

Comments

Andre McCurdy March 9, 2020, 11:52 p.m.
On Mon, Mar 9, 2020 at 4:44 PM Khem Raj <raj.khem@gmail.com> wrote:
>
> in 2.7 [2] ruby enabled ucontext for coroutines on arm32 but it does not
> work for musl since it uses glibc specific functions e.g.
> getcontext/swapcontext/swapcontext also see [1]
>
> This patch reverts back to using arm32 implementation for coroutines on
> arm
>
> [1] https://bugs.ruby-lang.org/issues/16455#change-83442
> [2] https://github.com/ruby/ruby/commit/6c6bf9ffcbfeb8be9d9c342e7604b74ec819e88a#diff-7fccec8474e2184cd2518046bf39d54cL10
>
> Signed-off-by: Khem Raj <raj.khem@gmail.com>
> ---
>  meta/recipes-devtools/ruby/ruby_2.7.0.bb | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/meta/recipes-devtools/ruby/ruby_2.7.0.bb b/meta/recipes-devtools/ruby/ruby_2.7.0.bb
> index 268b4bebd9..884bb0ef44 100644
> --- a/meta/recipes-devtools/ruby/ruby_2.7.0.bb
> +++ b/meta/recipes-devtools/ruby/ruby_2.7.0.bb
> @@ -25,6 +25,8 @@ EXTRA_OECONF = "\
>      --with-pkg-config=pkg-config \
>  "
>
> +EXTRA_OECONF_append_arm_libc-musl = " --with-coroutine=arm32"

Generally any _arm over-ride should either be duplicated for _armeb
too (or the commit message should explain why the over-ride is
specific to little endian ARM only).

>  do_install() {
>      oe_runmake 'DESTDIR=${D}' install
>  }
> --
> 2.25.1
>
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core
Khem Raj March 10, 2020, 12:33 a.m.
On 3/9/20 4:52 PM, Andre McCurdy wrote:
> On Mon, Mar 9, 2020 at 4:44 PM Khem Raj <raj.khem@gmail.com> wrote:
>>
>> in 2.7 [2] ruby enabled ucontext for coroutines on arm32 but it does not
>> work for musl since it uses glibc specific functions e.g.
>> getcontext/swapcontext/swapcontext also see [1]
>>
>> This patch reverts back to using arm32 implementation for coroutines on
>> arm
>>
>> [1] https://bugs.ruby-lang.org/issues/16455#change-83442
>> [2] https://github.com/ruby/ruby/commit/6c6bf9ffcbfeb8be9d9c342e7604b74ec819e88a#diff-7fccec8474e2184cd2518046bf39d54cL10
>>
>> Signed-off-by: Khem Raj <raj.khem@gmail.com>
>> ---
>>  meta/recipes-devtools/ruby/ruby_2.7.0.bb | 2 ++
>>  1 file changed, 2 insertions(+)
>>
>> diff --git a/meta/recipes-devtools/ruby/ruby_2.7.0.bb b/meta/recipes-devtools/ruby/ruby_2.7.0.bb
>> index 268b4bebd9..884bb0ef44 100644
>> --- a/meta/recipes-devtools/ruby/ruby_2.7.0.bb
>> +++ b/meta/recipes-devtools/ruby/ruby_2.7.0.bb
>> @@ -25,6 +25,8 @@ EXTRA_OECONF = "\
>>      --with-pkg-config=pkg-config \
>>  "
>>
>> +EXTRA_OECONF_append_arm_libc-musl = " --with-coroutine=arm32"
> 
> Generally any _arm over-ride should either be duplicated for _armeb
> too (or the commit message should explain why the over-ride is
> specific to little endian ARM only).

its just that I did not test it on armeb, and its assembly piece which
would need some testing on BE before it is enabled.

> 
>>  do_install() {
>>      oe_runmake 'DESTDIR=${D}' install
>>  }
>> --
>> 2.25.1
>>
>> --
>> _______________________________________________
>> Openembedded-core mailing list
>> Openembedded-core@lists.openembedded.org
>> http://lists.openembedded.org/mailman/listinfo/openembedded-core
Andre McCurdy March 10, 2020, 1:11 a.m.
On Mon, Mar 9, 2020 at 5:33 PM Khem Raj <raj.khem@gmail.com> wrote:
>
> On 3/9/20 4:52 PM, Andre McCurdy wrote:
> > On Mon, Mar 9, 2020 at 4:44 PM Khem Raj <raj.khem@gmail.com> wrote:
> >>
> >> in 2.7 [2] ruby enabled ucontext for coroutines on arm32 but it does not
> >> work for musl since it uses glibc specific functions e.g.
> >> getcontext/swapcontext/swapcontext also see [1]
> >>
> >> This patch reverts back to using arm32 implementation for coroutines on
> >> arm
> >>
> >> [1] https://bugs.ruby-lang.org/issues/16455#change-83442
> >> [2] https://github.com/ruby/ruby/commit/6c6bf9ffcbfeb8be9d9c342e7604b74ec819e88a#diff-7fccec8474e2184cd2518046bf39d54cL10
> >>
> >> Signed-off-by: Khem Raj <raj.khem@gmail.com>
> >> ---
> >>  meta/recipes-devtools/ruby/ruby_2.7.0.bb | 2 ++
> >>  1 file changed, 2 insertions(+)
> >>
> >> diff --git a/meta/recipes-devtools/ruby/ruby_2.7.0.bb b/meta/recipes-devtools/ruby/ruby_2.7.0.bb
> >> index 268b4bebd9..884bb0ef44 100644
> >> --- a/meta/recipes-devtools/ruby/ruby_2.7.0.bb
> >> +++ b/meta/recipes-devtools/ruby/ruby_2.7.0.bb
> >> @@ -25,6 +25,8 @@ EXTRA_OECONF = "\
> >>      --with-pkg-config=pkg-config \
> >>  "
> >>
> >> +EXTRA_OECONF_append_arm_libc-musl = " --with-coroutine=arm32"
> >
> > Generally any _arm over-ride should either be duplicated for _armeb
> > too (or the commit message should explain why the over-ride is
> > specific to little endian ARM only).
>
> its just that I did not test it on armeb, and its assembly piece which
> would need some testing on BE before it is enabled.

The default should be to keep arm and armeb in sync, unless there's a
clear reason not to. If you want to test big endian ARM then that's
great, but if you don't then just keeping the two targets in sync is
better than leaving big endian ARM unfixed _and_ untested.

> >>  do_install() {> >>      oe_runmake 'DESTDIR=${D}' install
> >>  }
> >> --
> >> 2.25.1
> >>
> >> --
> >> _______________________________________________
> >> Openembedded-core mailing list
> >> Openembedded-core@lists.openembedded.org
> >> http://lists.openembedded.org/mailman/listinfo/openembedded-core
>