Bug#1063937: glibc: Please add workaround to fix posix_spawn() on sparc64

John Paul Adrian Glaubitz <[email protected]>
Newsgroups gmane.linux.debian.ports.sparc
Message-ID <170798186070.2905455.6565576657055952029.reportbug__26573.8868549064$1707982422$gmane$org@nofan.physik.fu-berlin.de>
Source: glibc
Version: 2.37-15
Severity: important
Tags: patch
User: [email protected]
Usertags: sparc64
X-Debbugs-Cc: [email protected],[email protected],[email protected]

Hello,

there is currently a nasty bug on sparc64 that breaks posix_spawn() [1]
and potentially any package that uses gcc since libiberty switched to
using posix_spawn() with gcc-14.

The attached patch comes from Michael Karcher (CC'ed) and unbreaks
posix_spawn() so that gcc works again without posix_spawn() failing
with "Bad Address".

Since this patch is just a workaround and we're not even sure whether
the bug is in the kernel or glibc, it's not been pushed upstream yet.

Adrian

> [1] https://lore.kernel.org/sparclinux/fe5cc47167430007560501aabb28ba154985b661.camel@physik.fu-berlin.de

--
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer
`. `'   Physicist
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913
fix_posix_spawn.diff (text/plain, 596 B)
--- glibc-2.37.orig/sysdeps/unix/sysv/linux/sparc/sparc32/clone.S
+++ glibc-2.37/sysdeps/unix/sysv/linux/sparc/sparc32/clone.S
@@ -28,6 +28,9 @@
 	.text
 ENTRY (__clone)
 	save	%sp,-96,%sp
+	save	%sp,-96,%sp
+	flushw
+	restore
 	cfi_def_cfa_register(%fp)
 	cfi_window_save
 	cfi_register(%o7, %i7)
--- glibc-2.37.orig/sysdeps/unix/sysv/linux/sparc/sparc64/clone.S
+++ glibc-2.37/sysdeps/unix/sysv/linux/sparc/sparc64/clone.S
@@ -32,6 +32,9 @@
 
 ENTRY (__clone)
 	save	%sp, -192, %sp
+	save	%sp, -192, %sp
+	flushw
+	restore
 	cfi_def_cfa_register(%fp)
 	cfi_window_save
 	cfi_register(%o7, %i7)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.