scripts/build-many-glibcs.py: Switch one Arm target to thumb mode

Message ID 875yxm6x5j.fsf@oldenburg.str.redhat.com
State Committed
Headers
Series scripts/build-many-glibcs.py: Switch one Arm target to thumb mode |

Checks

Context Check Description
dj/TryBot-apply_patch success Patch applied to master at the time it was sent
dj/TryBot-32bit success Build for i686

Commit Message

Florian Weimer July 7, 2021, 2:01 p.m. UTC
  This commit changes arm-linux-gnueabihf-v7a-disable-multi-arch
to use thumb mode.  The choice is somewhat arbitrary, but there
should be at least one thumb mode target.

---
 scripts/build-many-glibcs.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
  

Comments

Szabolcs Nagy July 7, 2021, 2:07 p.m. UTC | #1
The 07/07/2021 16:01, Florian Weimer via Libc-alpha wrote:
> This commit changes arm-linux-gnueabihf-v7a-disable-multi-arch
> to use thumb mode.  The choice is somewhat arbitrary, but there
> should be at least one thumb mode target.
> 

thanks.

Reviewed-by: Szabolcs Nagy <szabolcs.nagy@arm.com>

> ---
>  scripts/build-many-glibcs.py | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/scripts/build-many-glibcs.py b/scripts/build-many-glibcs.py
> index 243323b1ce..6454f67c4a 100755
> --- a/scripts/build-many-glibcs.py
> +++ b/scripts/build-many-glibcs.py
> @@ -189,7 +189,8 @@ class Context(object):
>                          extra_glibcs=[{'variant': 'v7a',
>                                         'ccopts': '-march=armv7-a -mfpu=vfpv3'},
>                                        {'variant': 'v7a-disable-multi-arch',
> -                                       'ccopts': '-march=armv7-a -mfpu=vfpv3',
> +                                       'ccopts':
> +                                       '-mthumb -march=armv7-a -mfpu=vfpv3',
>                                         'cfg': ['--disable-multi-arch']}])
>          self.add_config(arch='armeb',
>                          os_name='linux-gnueabihf',
>
  
Joseph Myers July 7, 2021, 3:07 p.m. UTC | #2
On Wed, 7 Jul 2021, Florian Weimer via Libc-alpha wrote:

> This commit changes arm-linux-gnueabihf-v7a-disable-multi-arch
> to use thumb mode.  The choice is somewhat arbitrary, but there
> should be at least one thumb mode target.

My inclination would be to add a new variant for this rather than changing 
an existing one.
  
Florian Weimer July 7, 2021, 3:15 p.m. UTC | #3
* Joseph Myers:

> On Wed, 7 Jul 2021, Florian Weimer via Libc-alpha wrote:
>
>> This commit changes arm-linux-gnueabihf-v7a-disable-multi-arch
>> to use thumb mode.  The choice is somewhat arbitrary, but there
>> should be at least one thumb mode target.
>
> My inclination would be to add a new variant for this rather than changing 
> an existing one.

Running build-many-glibcs.py isn't free.  We can't test all possible
combinations, and -mthumb is a real gap.

Can we remove another Arm target instead?

If we absolutely have to add a new target, should it be based on
arm-linux-gnueabi?

Thanks,
Florian
  
Joseph Myers July 7, 2021, 3:22 p.m. UTC | #4
On Wed, 7 Jul 2021, Florian Weimer via Libc-alpha wrote:

> * Joseph Myers:
> 
> > On Wed, 7 Jul 2021, Florian Weimer via Libc-alpha wrote:
> >
> >> This commit changes arm-linux-gnueabihf-v7a-disable-multi-arch
> >> to use thumb mode.  The choice is somewhat arbitrary, but there
> >> should be at least one thumb mode target.
> >
> > My inclination would be to add a new variant for this rather than changing 
> > an existing one.
> 
> Running build-many-glibcs.py isn't free.  We can't test all possible
> combinations, and -mthumb is a real gap.

It also makes sense for the -mthumb variant to have that as the only 
difference from another variant (rather than the only -mthumb Arm variant 
also being the only --disable-multi-arch Arm variant).

> If we absolutely have to add a new target, should it be based on
> arm-linux-gnueabi?

Well, it needs to build with at least -march=armv7-a (technically, at 
least v6t2) - building glibc as Thumb-1 rather than Thumb-2 isn't 
supported - so that suggests making it like the arm-linux-gnueabihf-v7a 
variant except for -mthumb added.
  
Florian Weimer July 7, 2021, 3:48 p.m. UTC | #5
* Joseph Myers:

> On Wed, 7 Jul 2021, Florian Weimer via Libc-alpha wrote:
>
>> * Joseph Myers:
>> 
>> > On Wed, 7 Jul 2021, Florian Weimer via Libc-alpha wrote:
>> >
>> >> This commit changes arm-linux-gnueabihf-v7a-disable-multi-arch
>> >> to use thumb mode.  The choice is somewhat arbitrary, but there
>> >> should be at least one thumb mode target.
>> >
>> > My inclination would be to add a new variant for this rather than changing 
>> > an existing one.
>> 
>> Running build-many-glibcs.py isn't free.  We can't test all possible
>> combinations, and -mthumb is a real gap.
>
> It also makes sense for the -mthumb variant to have that as the only 
> difference from another variant (rather than the only -mthumb Arm variant 
> also being the only --disable-multi-arch Arm variant).
>
>> If we absolutely have to add a new target, should it be based on
>> arm-linux-gnueabi?
>
> Well, it needs to build with at least -march=armv7-a (technically, at 
> least v6t2) - building glibc as Thumb-1 rather than Thumb-2 isn't 
> supported - so that suggests making it like the arm-linux-gnueabihf-v7a 
> variant except for -mthumb added.

Like this?  The new target builds with the out-of-line futex wake patch
applied.

Thanks,
Florian

Subject: build-many-glibcs.py: Add glibcs-arm-linux-gnueabihf-thumb

Previously, there was now thumb variant, despite that building
glibc in Thumb-2 mode is supported.

---
 scripts/build-many-glibcs.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/scripts/build-many-glibcs.py b/scripts/build-many-glibcs.py
index 243323b1ce..6643bb6e92 100755
--- a/scripts/build-many-glibcs.py
+++ b/scripts/build-many-glibcs.py
@@ -188,6 +188,9 @@ class Context(object):
                         gcc_cfg=['--with-float=hard', '--with-cpu=arm926ej-s'],
                         extra_glibcs=[{'variant': 'v7a',
                                        'ccopts': '-march=armv7-a -mfpu=vfpv3'},
+                                      {'variant': 'thumb',
+                                       'ccopts':
+                                       '-mthumb -march=armv7-a -mfpu=vfpv3'},
                                       {'variant': 'v7a-disable-multi-arch',
                                        'ccopts': '-march=armv7-a -mfpu=vfpv3',
                                        'cfg': ['--disable-multi-arch']}])
  
Joseph Myers July 7, 2021, 3:52 p.m. UTC | #6
On Wed, 7 Jul 2021, Florian Weimer via Libc-alpha wrote:

> Like this?  The new target builds with the out-of-line futex wake patch
> applied.

Yes.

> Previously, there was now thumb variant, despite that building

s/now thumb/no thumb/
  

Patch

diff --git a/scripts/build-many-glibcs.py b/scripts/build-many-glibcs.py
index 243323b1ce..6454f67c4a 100755
--- a/scripts/build-many-glibcs.py
+++ b/scripts/build-many-glibcs.py
@@ -189,7 +189,8 @@  class Context(object):
                         extra_glibcs=[{'variant': 'v7a',
                                        'ccopts': '-march=armv7-a -mfpu=vfpv3'},
                                       {'variant': 'v7a-disable-multi-arch',
-                                       'ccopts': '-march=armv7-a -mfpu=vfpv3',
+                                       'ccopts':
+                                       '-mthumb -march=armv7-a -mfpu=vfpv3',
                                        'cfg': ['--disable-multi-arch']}])
         self.add_config(arch='armeb',
                         os_name='linux-gnueabihf',