public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 0/4] Multiple sparc fixes
@ 2024-01-18 16:02 Adhemerval Zanella
  2024-01-18 16:02 ` [PATCH 1/4] Use --disable-default-pie for sparc in build-many-glibcs.py Adhemerval Zanella
                   ` (3 more replies)
  0 siblings, 4 replies; 11+ messages in thread
From: Adhemerval Zanella @ 2024-01-18 16:02 UTC (permalink / raw)
  To: libc-alpha

This patchset fixes multiple issues on sparc64 and sparcv9.

Adhemerval Zanella (4):
  Use --disable-default-pie for sparc in build-many-glibcs.py
  sparc: Remove 64 bit check on sparc32 wordsize (BZ 27574)
  sparc64: Remove unwind information from signal return stubs [BZ#31244]
  sparc: Fix sparc64 memmove length comparison (BZ 31266)

 scripts/build-many-glibcs.py                        | 10 ++++++----
 sysdeps/sparc/sparc32/bits/wordsize.h               | 13 ++++---------
 sysdeps/sparc/sparc64/memmove.S                     |  2 +-
 .../unix/sysv/linux/sparc/sparc64/sigreturn_stub.S  |  7 +++++--
 4 files changed, 16 insertions(+), 16 deletions(-)

-- 
2.34.1


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

* [PATCH 1/4] Use --disable-default-pie for sparc in build-many-glibcs.py
  2024-01-18 16:02 [PATCH 0/4] Multiple sparc fixes Adhemerval Zanella
@ 2024-01-18 16:02 ` Adhemerval Zanella
  2024-01-18 20:57   ` Andreas K. Huettel
  2024-01-18 16:02 ` [PATCH 2/4] sparc: Remove 64 bit check on sparc32 wordsize (BZ 27574) Adhemerval Zanella
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 11+ messages in thread
From: Adhemerval Zanella @ 2024-01-18 16:02 UTC (permalink / raw)
  To: libc-alpha

The staticcally built binaries fails without this option [1].

Checked on sparc64-linux-gnu and sparcv9-linux-gnu.

[1] https://sourceware.org/bugzilla/show_bug.cgi?id=29575
---
 scripts/build-many-glibcs.py | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/scripts/build-many-glibcs.py b/scripts/build-many-glibcs.py
index 9cdf3e682f..1967615df7 100755
--- a/scripts/build-many-glibcs.py
+++ b/scripts/build-many-glibcs.py
@@ -436,18 +436,20 @@ class Context(object):
                         gcc_cfg=['--without-fp'])
         self.add_config(arch='sparc64',
                         os_name='linux-gnu',
-                        glibcs=[{},
-                                {'arch': 'sparcv9',
+                        glibcs=[{'cfg' : ['--disable-default-pie']},
+                                {'cfg' : ['--disable-default-pie'],
+                                 'arch': 'sparcv9',
                                  'ccopts': '-m32 -mlong-double-128 -mcpu=v9'}],
                         extra_glibcs=[{'variant': 'leon3',
+                                       'cfg' : ['--disable-default-pie'],
                                        'arch' : 'sparcv8',
                                        'ccopts' : '-m32 -mlong-double-128 -mcpu=leon3'},
                                       {'variant': 'disable-multi-arch',
-                                       'cfg': ['--disable-multi-arch']},
+                                       'cfg': ['--disable-multi-arch', '--disable-default-pie']},
                                       {'variant': 'disable-multi-arch',
                                        'arch': 'sparcv9',
                                        'ccopts': '-m32 -mlong-double-128 -mcpu=v9',
-                                       'cfg': ['--disable-multi-arch']}])
+                                       'cfg': ['--disable-multi-arch', '--disable-default-pie']}])
         self.add_config(arch='x86_64',
                         os_name='linux-gnu',
                         gcc_cfg=['--with-multilib-list=m64,m32,mx32'],
-- 
2.34.1


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

* [PATCH 2/4] sparc: Remove 64 bit check on sparc32 wordsize (BZ 27574)
  2024-01-18 16:02 [PATCH 0/4] Multiple sparc fixes Adhemerval Zanella
  2024-01-18 16:02 ` [PATCH 1/4] Use --disable-default-pie for sparc in build-many-glibcs.py Adhemerval Zanella
@ 2024-01-18 16:02 ` Adhemerval Zanella
  2024-01-22 13:14   ` Andreas Schwab
  2024-01-18 16:02 ` [PATCH 3/4] sparc64: Remove unwind information from signal return stubs [BZ#31244] Adhemerval Zanella
  2024-01-18 16:02 ` [PATCH 4/4] sparc: Fix sparc64 memmove length comparison (BZ 31266) Adhemerval Zanella
  3 siblings, 1 reply; 11+ messages in thread
From: Adhemerval Zanella @ 2024-01-18 16:02 UTC (permalink / raw)
  To: libc-alpha

The sparc32 is always 32 bits.

Checked on sparcv9-linux-gnu.
---
 sysdeps/sparc/sparc32/bits/wordsize.h | 13 ++++---------
 1 file changed, 4 insertions(+), 9 deletions(-)

diff --git a/sysdeps/sparc/sparc32/bits/wordsize.h b/sysdeps/sparc/sparc32/bits/wordsize.h
index 2f66f10d72..4bbd2e63b4 100644
--- a/sysdeps/sparc/sparc32/bits/wordsize.h
+++ b/sysdeps/sparc/sparc32/bits/wordsize.h
@@ -1,11 +1,6 @@
 /* Determine the wordsize from the preprocessor defines.  */
 
-#if defined __arch64__ || defined __sparcv9
-# define __WORDSIZE	64
-# define __WORDSIZE_TIME64_COMPAT32	1
-#else
-# define __WORDSIZE	32
-# define __WORDSIZE_TIME64_COMPAT32	0
-# define __WORDSIZE32_SIZE_ULONG	0
-# define __WORDSIZE32_PTRDIFF_LONG	0
-#endif
+#define __WORDSIZE	32
+#define __WORDSIZE_TIME64_COMPAT32	0
+#define __WORDSIZE32_SIZE_ULONG	0
+#define __WORDSIZE32_PTRDIFF_LONG	0
-- 
2.34.1


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

* [PATCH 3/4] sparc64: Remove unwind information from signal return stubs [BZ#31244]
  2024-01-18 16:02 [PATCH 0/4] Multiple sparc fixes Adhemerval Zanella
  2024-01-18 16:02 ` [PATCH 1/4] Use --disable-default-pie for sparc in build-many-glibcs.py Adhemerval Zanella
  2024-01-18 16:02 ` [PATCH 2/4] sparc: Remove 64 bit check on sparc32 wordsize (BZ 27574) Adhemerval Zanella
@ 2024-01-18 16:02 ` Adhemerval Zanella
  2024-01-18 16:02 ` [PATCH 4/4] sparc: Fix sparc64 memmove length comparison (BZ 31266) Adhemerval Zanella
  3 siblings, 0 replies; 11+ messages in thread
From: Adhemerval Zanella @ 2024-01-18 16:02 UTC (permalink / raw)
  To: libc-alpha

Similar to sparc32 fix, remove the unwind information on the signal
return stubs.  This fixes the regressions:

FAIL: nptl/tst-cancel24-static
FAIL: nptl/tst-cond8-static
FAIL: nptl/tst-mutex8-static
FAIL: nptl/tst-mutexpi8-static
FAIL: nptl/tst-mutexpi9

On sparc64-linux-gnu.
---
 sysdeps/unix/sysv/linux/sparc/sparc64/sigreturn_stub.S | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/sigreturn_stub.S b/sysdeps/unix/sysv/linux/sparc/sparc64/sigreturn_stub.S
index 12af289375..8c9fbbf22e 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc64/sigreturn_stub.S
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/sigreturn_stub.S
@@ -23,7 +23,10 @@
 
    [1] https://lkml.org/lkml/2016/5/27/465  */
 
-ENTRY (__rt_sigreturn_stub)
+	nop
+	nop
+
+ENTRY_NOCFI (__rt_sigreturn_stub)
 	mov	__NR_rt_sigreturn, %g1
 	ta	0x6d
-END (__rt_sigreturn_stub)
+END_NOCFI (__rt_sigreturn_stub)
-- 
2.34.1


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

* [PATCH 4/4] sparc: Fix sparc64 memmove length comparison (BZ 31266)
  2024-01-18 16:02 [PATCH 0/4] Multiple sparc fixes Adhemerval Zanella
                   ` (2 preceding siblings ...)
  2024-01-18 16:02 ` [PATCH 3/4] sparc64: Remove unwind information from signal return stubs [BZ#31244] Adhemerval Zanella
@ 2024-01-18 16:02 ` Adhemerval Zanella
  3 siblings, 0 replies; 11+ messages in thread
From: Adhemerval Zanella @ 2024-01-18 16:02 UTC (permalink / raw)
  To: libc-alpha

The small counts copy bytes comparsion should be unsigned (as the
memmove size argument).  It fixes string/tst-memmove-overflow on
sparcv9, where the input size triggers an invalid code path.

Checked on sparc64-linux-gnu and sparcv9-linux-gnu.
---
 sysdeps/sparc/sparc64/memmove.S | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sysdeps/sparc/sparc64/memmove.S b/sysdeps/sparc/sparc64/memmove.S
index 8803a03d4e..f14b09afaf 100644
--- a/sysdeps/sparc/sparc64/memmove.S
+++ b/sysdeps/sparc/sparc64/memmove.S
@@ -38,7 +38,7 @@ ENTRY(memmove)
 /*
  * normal, copy forwards
  */
-2:	ble	%XCC, .Ldbytecp
+2:	bleu	%XCC, .Ldbytecp
 	 andcc	%o1, 3, %o5	/* is src word aligned  */
 	bz,pn	%icc, .Laldst
 	 cmp	%o5, 2		/* is src half-word aligned  */
-- 
2.34.1


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

* Re: [PATCH 1/4] Use --disable-default-pie for sparc in build-many-glibcs.py
  2024-01-18 16:02 ` [PATCH 1/4] Use --disable-default-pie for sparc in build-many-glibcs.py Adhemerval Zanella
@ 2024-01-18 20:57   ` Andreas K. Huettel
  2024-01-19 14:01     ` Adhemerval Zanella Netto
  0 siblings, 1 reply; 11+ messages in thread
From: Andreas K. Huettel @ 2024-01-18 20:57 UTC (permalink / raw)
  To: libc-alpha; +Cc: Adhemerval Zanella

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

Am Donnerstag, 18. Januar 2024, 17:02:25 CET schrieb Adhemerval Zanella:
> The staticcally built binaries fails without this option [1].
> 
> Checked on sparc64-linux-gnu and sparcv9-linux-gnu.
> 
> [1] https://sourceware.org/bugzilla/show_bug.cgi?id=29575
> ---

WFM, but how about making this switch then default later 
at least in the release branch?
 
(i.e. what use is configuring something that doesnt work)

-- 
Andreas K. Hüttel
dilfridge@gentoo.org
Gentoo Linux developer 
(council, comrel, toolchain, base-system, perl, libreoffice)
https://wiki.gentoo.org/wiki/User:Dilfridge

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [PATCH 1/4] Use --disable-default-pie for sparc in build-many-glibcs.py
  2024-01-18 20:57   ` Andreas K. Huettel
@ 2024-01-19 14:01     ` Adhemerval Zanella Netto
  2024-01-19 19:43       ` Andreas K. Huettel
  0 siblings, 1 reply; 11+ messages in thread
From: Adhemerval Zanella Netto @ 2024-01-19 14:01 UTC (permalink / raw)
  To: Andreas K. Huettel, libc-alpha



On 18/01/24 17:57, Andreas K. Huettel wrote:
> Am Donnerstag, 18. Januar 2024, 17:02:25 CET schrieb Adhemerval Zanella:
>> The staticcally built binaries fails without this option [1].
>>
>> Checked on sparc64-linux-gnu and sparcv9-linux-gnu.
>>
>> [1] https://sourceware.org/bugzilla/show_bug.cgi?id=29575
>> ---
> 
> WFM, but how about making this switch then default later 
> at least in the release branch?
>  
> (i.e. what use is configuring something that doesnt work)
> 

Hum, are you suggesting to disable --enable-default-pie for sparc? If so,
this is on my plan, I think there is other architectures that might be
affected by it. I spend some time trying to fix BZ#29575, but I got lost
on the internal machinery and flags required.

Besides this, I would also like to install the other sparc patches.
They fixes some regression that I have been seeing over the releases.

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

* Re: [PATCH 1/4] Use --disable-default-pie for sparc in build-many-glibcs.py
  2024-01-19 14:01     ` Adhemerval Zanella Netto
@ 2024-01-19 19:43       ` Andreas K. Huettel
  0 siblings, 0 replies; 11+ messages in thread
From: Andreas K. Huettel @ 2024-01-19 19:43 UTC (permalink / raw)
  To: libc-alpha, Adhemerval Zanella Netto

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

> > Am Donnerstag, 18. Januar 2024, 17:02:25 CET schrieb Adhemerval Zanella:
> >> The staticcally built binaries fails without this option [1].
> >>
> >> Checked on sparc64-linux-gnu and sparcv9-linux-gnu.
> >>
> >> [1] https://sourceware.org/bugzilla/show_bug.cgi?id=29575
> >> ---
> > 
> > WFM, but how about making this switch then default later 
> > at least in the release branch?
> >  
> > (i.e. what use is configuring something that doesnt work)
> 
> Hum, are you suggesting to disable --enable-default-pie for sparc? If so,
> this is on my plan, I think there is other architectures that might be
> affected by it.

Yes, that's what I meant.

> I spend some time trying to fix BZ#29575, but I got lost
> on the internal machinery and flags required.
> 
> Besides this, I would also like to install the other sparc patches.
> They fixes some regression that I have been seeing over the releases.

Makes sense.

Best -A

-- 
Andreas K. Hüttel
dilfridge@gentoo.org
Gentoo Linux developer 
(council, comrel, toolchain, base-system, perl, libreoffice)
https://wiki.gentoo.org/wiki/User:Dilfridge

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [PATCH 2/4] sparc: Remove 64 bit check on sparc32 wordsize (BZ 27574)
  2024-01-18 16:02 ` [PATCH 2/4] sparc: Remove 64 bit check on sparc32 wordsize (BZ 27574) Adhemerval Zanella
@ 2024-01-22 13:14   ` Andreas Schwab
  2024-01-22 13:27     ` Adhemerval Zanella Netto
  0 siblings, 1 reply; 11+ messages in thread
From: Andreas Schwab @ 2024-01-22 13:14 UTC (permalink / raw)
  To: Adhemerval Zanella; +Cc: libc-alpha

On Jan 18 2024, Adhemerval Zanella wrote:

> The sparc32 is always 32 bits.

I think the point is that you can share the header with gcc -m64 (when
the default is -m32), ie. a 32-bit system on a 64-bit capable kernel.

-- 
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."

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

* Re: [PATCH 2/4] sparc: Remove 64 bit check on sparc32 wordsize (BZ 27574)
  2024-01-22 13:14   ` Andreas Schwab
@ 2024-01-22 13:27     ` Adhemerval Zanella Netto
  2024-01-22 13:56       ` Andreas Schwab
  0 siblings, 1 reply; 11+ messages in thread
From: Adhemerval Zanella Netto @ 2024-01-22 13:27 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: libc-alpha



On 22/01/24 10:14, Andreas Schwab wrote:
> On Jan 18 2024, Adhemerval Zanella wrote:
> 
>> The sparc32 is always 32 bits.
> 
> I think the point is that you can share the header with gcc -m64 (when
> the default is -m32), ie. a 32-bit system on a 64-bit capable kernel.
> 

But the sysdeps/sparc/sparc32/bits/wordsize.h header is not placed on
the sparc generic path (sysdeps/sparc/), so it is selected only for
32 bits build.

Maybe a further cleanup would to move ./sysdeps/sparc/sparc64/bits/wordsize.h
and remove the __sparcv9 condition for __WORDSIZE equal to 64.

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

* Re: [PATCH 2/4] sparc: Remove 64 bit check on sparc32 wordsize (BZ 27574)
  2024-01-22 13:27     ` Adhemerval Zanella Netto
@ 2024-01-22 13:56       ` Andreas Schwab
  0 siblings, 0 replies; 11+ messages in thread
From: Andreas Schwab @ 2024-01-22 13:56 UTC (permalink / raw)
  To: Adhemerval Zanella Netto; +Cc: libc-alpha

On Jan 22 2024, Adhemerval Zanella Netto wrote:

> On 22/01/24 10:14, Andreas Schwab wrote:
>> On Jan 18 2024, Adhemerval Zanella wrote:
>> 
>>> The sparc32 is always 32 bits.
>> 
>> I think the point is that you can share the header with gcc -m64 (when
>> the default is -m32), ie. a 32-bit system on a 64-bit capable kernel.
>> 
>
> But the sysdeps/sparc/sparc32/bits/wordsize.h header is not placed on
> the sparc generic path (sysdeps/sparc/), so it is selected only for
> 32 bits build.

It's the same as under sysdeps/powerpc.  The installed header is then
generic.

-- 
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."

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

end of thread, other threads:[~2024-01-22 13:56 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-18 16:02 [PATCH 0/4] Multiple sparc fixes Adhemerval Zanella
2024-01-18 16:02 ` [PATCH 1/4] Use --disable-default-pie for sparc in build-many-glibcs.py Adhemerval Zanella
2024-01-18 20:57   ` Andreas K. Huettel
2024-01-19 14:01     ` Adhemerval Zanella Netto
2024-01-19 19:43       ` Andreas K. Huettel
2024-01-18 16:02 ` [PATCH 2/4] sparc: Remove 64 bit check on sparc32 wordsize (BZ 27574) Adhemerval Zanella
2024-01-22 13:14   ` Andreas Schwab
2024-01-22 13:27     ` Adhemerval Zanella Netto
2024-01-22 13:56       ` Andreas Schwab
2024-01-18 16:02 ` [PATCH 3/4] sparc64: Remove unwind information from signal return stubs [BZ#31244] Adhemerval Zanella
2024-01-18 16:02 ` [PATCH 4/4] sparc: Fix sparc64 memmove length comparison (BZ 31266) Adhemerval Zanella

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).