public inbox for libc-hacker@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] SH: Fix the last nptl test failure
@ 2004-04-13 12:54 Kaz Kojima
  2004-04-16 19:15 ` Ulrich Drepper
  0 siblings, 1 reply; 4+ messages in thread
From: Kaz Kojima @ 2004-04-13 12:54 UTC (permalink / raw)
  To: libc-hacker

Hi,

I've found that the hand-crafted frame info for pthread_cond_wait.S
and pthread_cond_timedwait.S cause the failure of nptl/tst-cancel17
on SH.  The attached patch fixes that.  It also enables TLS configuration
because now all nptl tests are ok on this target with the appropriate
compiler.

Regards,
	kaz
--
ChangeLog:
2004-04-13  Kaz Kojima  <kkojima@rr.iij4u.or.jp>

	* sysdeps/sh/elf/configure.in: New.
	* sysdeps/sh/elf/configure: Generated.

nptl/ChangeLog:
2004-04-13  Kaz Kojima  <kkojima@rr.iij4u.or.jp>

	* sysv/linux/sh/pthread_cond_wait.S: Remove unneeded frame info.
	* sysv/linux/sh/pthread_cond_timedwait.S: Likewise.

diff -u3prN ORIG/libc/nptl/sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S LOCAL/libc/nptl/sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S
--- ORIG/libc/nptl/sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S	Sat Mar 20 15:24:29 2004
+++ LOCAL/libc/nptl/sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S	Tue Apr 13 11:20:33 2004
@@ -604,53 +604,6 @@ __condvar_tw_cleanup:
 	.ualong	.Lalloc-.Lpush_pr
 	.byte	0xe
 	.uleb128 92
-	.byte	0x4
-	.ualong	.Lfree-.Lalloc
-	.byte	0xe
-	.uleb128 28
-	.byte	0x4
-	.ualong	.Lpop_pr-.Lfree
-	.byte	0xe
-	.uleb128 24
-	.byte	0xd1
-	.byte	0x4
-	.ualong	.Lpop_r13-.Lpop_pr
-	.byte	0xe
-	.uleb128 20
-	.byte	0xcd
-	.byte	0x4
-	.ualong	.Lpop_r12-.Lpop_r13
-	.byte	0xe
-	.uleb128 16
-	.byte	0xcc
-	.byte	0x4
-	.ualong	.Lpop_r11-.Lpop_r12
-	.byte	0xe
-	.uleb128 12
-	.byte	0xcb
-	.byte	0x4
-	.ualong	.Lpop_r10-.Lpop_r11
-	.byte	0xe
-	.uleb128 8
-	.byte	0xca
-	.byte	0x4
-	.ualong	.Lpop_r9-.Lpop_r10
-	.byte	0xe
-	.uleb128 4
-	.byte	0xc9
-	.byte	0x4
-	.ualong	.Lpop_r8-.Lpop_r9
-	.byte	0xe
-	.uleb128 0
-	.byte	0xc8
-	.byte	0x4
-	.ualong	.LSblSTART-.Lpop_r8
-	.byte	0xe
-	.uleb128 72
-	.byte	0x4
-	.ualong	.LSblEND-.LSblSTART
-	.byte	0xe
-	.uleb128 72
 	.align	2
 .LENDFDE:
 
diff -u3prN ORIG/libc/nptl/sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S LOCAL/libc/nptl/sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S
--- ORIG/libc/nptl/sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S	Sat Mar 20 15:24:30 2004
+++ LOCAL/libc/nptl/sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S	Tue Apr 13 11:20:33 2004
@@ -524,48 +524,6 @@ __condvar_w_cleanup:
 	.ualong	.Lalloc-.Lpush_pr
 	.byte	0xe
 	.uleb128 72
-	.byte	0x4
-	.ualong	.Lfree-.Lalloc
-	.byte	0xe
-	.uleb128 24
-	.byte	0x4
-	.ualong	.Lpop_pr-.Lfree
-	.byte	0xe
-	.uleb128 20
-	.byte	0xd1
-	.byte	0x4
-	.ualong	.Lpop_r12-.Lpop_pr
-	.byte	0xe
-	.uleb128 16
-	.byte	0xcc
-	.byte	0x4
-	.ualong	.Lpop_r11-.Lpop_r12
-	.byte	0xe
-	.uleb128 12
-	.byte	0xcb
-	.byte	0x4
-	.ualong	.Lpop_r10-.Lpop_r11
-	.byte	0xe
-	.uleb128 8
-	.byte	0xca
-	.byte	0x4
-	.ualong	.Lpop_r9-.Lpop_r10
-	.byte	0xe
-	.uleb128 4
-	.byte	0xc9
-	.byte	0x4
-	.ualong	.Lpop_r8-.Lpop_r9
-	.byte	0xe
-	.uleb128 0
-	.byte	0xc8
-	.byte	0x4
-	.ualong	.LSblSTART-.Lpop_r8
-	.byte	0xe
-	.uleb128 72
-	.byte	0x4
-	.ualong	.LSblEND-.LSblSTART
-	.byte	0xe
-	.uleb128 72
 	.align	2
 .LENDFDE:
 
diff -u3prN ORIG/libc/sysdeps/sh/elf/configure LOCAL/libc/sysdeps/sh/elf/configure
--- ORIG/libc/sysdeps/sh/elf/configure	Thu Jan  1 09:00:00 1970
+++ LOCAL/libc/sysdeps/sh/elf/configure	Tue Apr 13 11:20:33 2004
@@ -0,0 +1,47 @@
+# This file is generated from configure.in by Autoconf.  DO NOT EDIT!
+ # Local configure fragment for sysdeps/sh/elf.
+
+if test "$usetls" != no; then
+# Check for support of thread-local storage handling in assembler and
+# linker.
+echo "$as_me:$LINENO: checking for SH TLS support" >&5
+echo $ECHO_N "checking for sh TLS support... $ECHO_C" >&6
+if test "${libc_cv_sh_tls+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat > conftest.S <<\EOF
+	.section ".tdata", "awT", @progbits
+foo:	.long	25
+	.text
+	.long	foo@TLSGD
+	.long	foo@TLSLDM
+	.long	foo@DTPOFF
+	.long	foo@GOTTPOFF
+	.long	foo@TPOFF
+EOF
+if { ac_try='${CC-cc} -S $CFLAGS conftest.S 1>&5'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  libc_cv_sh_tls=yes
+else
+  libc_cv_sh_tls=no
+fi
+rm -f conftest*
+fi
+echo "$as_me:$LINENO: result: $libc_cv_sh_tls" >&5
+echo "${ECHO_T}$libc_cv_sh_tls" >&6
+if test $libc_cv_sh_tls = yes; then
+  cat >>confdefs.h <<\_ACEOF
+#define HAVE_TLS_SUPPORT 1
+_ACEOF
+
+fi
+fi
+
+cat >>confdefs.h <<\_ACEOF
+#define PI_STATIC_AND_HIDDEN 1
+_ACEOF
+
diff -u3prN ORIG/libc/sysdeps/sh/elf/configure.in LOCAL/libc/sysdeps/sh/elf/configure.in
--- ORIG/libc/sysdeps/sh/elf/configure.in	Thu Jan  1 09:00:00 1970
+++ LOCAL/libc/sysdeps/sh/elf/configure.in	Tue Apr 13 11:20:33 2004
@@ -0,0 +1,32 @@
+GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
+# Local configure fragment for sysdeps/sh/elf.
+
+if test "$usetls" != no; then
+# Check for support of thread-local storage handling in assembler and
+# linker.
+AC_CACHE_CHECK(for SH TLS support, libc_cv_sh_tls, [dnl
+cat > conftest.S <<\EOF
+	.section ".tdata", "awT", @progbits
+foo:	.long	25
+	.text
+	.long	foo@TLSGD
+	.long	foo@TLSLDM
+	.long	foo@DTPOFF
+	.long	foo@GOTTPOFF
+	.long	foo@TPOFF
+EOF
+dnl
+if AC_TRY_COMMAND(${CC-cc} -S $CFLAGS conftest.S 1>&AS_MESSAGE_LOG_FD); then
+  libc_cv_sh_tls=yes
+else
+  libc_cv_sh_tls=no
+fi
+rm -f conftest*])
+if test $libc_cv_sh_tls = yes; then
+  AC_DEFINE(HAVE_TLS_SUPPORT)
+fi
+fi
+
+dnl It is always possible to access static and hidden symbols in an
+dnl position independent way.
+AC_DEFINE(PI_STATIC_AND_HIDDEN)

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

* Re: [PATCH] SH: Fix the last nptl test failure
  2004-04-13 12:54 [PATCH] SH: Fix the last nptl test failure Kaz Kojima
@ 2004-04-16 19:15 ` Ulrich Drepper
  2004-04-16 22:23   ` Kaz Kojima
  0 siblings, 1 reply; 4+ messages in thread
From: Ulrich Drepper @ 2004-04-16 19:15 UTC (permalink / raw)
  To: Kaz Kojima; +Cc: libc-hacker

Kaz Kojima wrote:

> 	* sysv/linux/sh/pthread_cond_wait.S: Remove unneeded frame info.
> 	* sysv/linux/sh/pthread_cond_timedwait.S: Likewise.

You removed the unwind data, but not the labels which have been
introduces for that.  Please remove then and generate a new patch.

-- 
➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Mountain View, CA ❖

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

* Re: [PATCH] SH: Fix the last nptl test failure
  2004-04-16 19:15 ` Ulrich Drepper
@ 2004-04-16 22:23   ` Kaz Kojima
  2004-04-17 22:34     ` Ulrich Drepper
  0 siblings, 1 reply; 4+ messages in thread
From: Kaz Kojima @ 2004-04-16 22:23 UTC (permalink / raw)
  To: libc-hacker

Ulrich Drepper <drepper@redhat.com> wrote:
>> 	* sysv/linux/sh/pthread_cond_wait.S: Remove unneeded frame info.
>> 	* sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
> 
> You removed the unwind data, but not the labels which have been
> introduces for that.  Please remove then and generate a new patch.

Definitely.  The attached patch is a revised one.

Regards,
	kaz
--
ChangeLog:
2004-04-16  Kaz Kojima  <kkojima@rr.iij4u.or.jp>

	* sysdeps/sh/elf/configure.in: New.
	* sysdeps/sh/elf/configure: Generated.

nptl/ChangeLog:
2004-04-16  Kaz Kojima  <kkojima@rr.iij4u.or.jp>

	* sysv/linux/sh/pthread_cond_wait.S: Remove unneeded frame info.
	* sysv/linux/sh/pthread_cond_timedwait.S: Likewise.

diff -u3prN ORIG/libc/nptl/sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S LOCAL/libc/nptl/sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S
--- ORIG/libc/nptl/sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S	Sat Mar 20 15:24:29 2004
+++ LOCAL/libc/nptl/sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S	Sat Apr 17 06:32:16 2004
@@ -264,22 +264,14 @@ __pthread_cond_timedwait:
 
 18:	
 	add	#64, r15
-.Lfree:	
 	lds.l	@r15+, pr
-.Lpop_pr:
 	mov.l	@r15+, r13
-.Lpop_r13:
 	mov.l	@r15+, r12
-.Lpop_r12:
 	mov.l	@r15+, r11
-.Lpop_r11:
 	mov.l	@r15+, r10
-.Lpop_r10:
 	mov.l	@r15+, r9
-.Lpop_r9:
 	rts
 	 mov.l	@r15+, r8
-.Lpop_r8:
 
 .L1k:
 	.word	1000
@@ -296,7 +288,6 @@ __pthread_cond_timedwait:
 	.long	1000000000
 
 1:
-.LSblSTART:
 	/* Initial locking failed.  */
 	mov	r8, r5
 #if cond_lock != 0
@@ -370,7 +361,6 @@ __pthread_cond_timedwait:
 17:
 	bra	18b
 	 mov.l	@(24,r15), r0
-.LSblEND:
 
 	.align	2
 .Lmwait2:
@@ -604,53 +594,6 @@ __condvar_tw_cleanup:
 	.ualong	.Lalloc-.Lpush_pr
 	.byte	0xe
 	.uleb128 92
-	.byte	0x4
-	.ualong	.Lfree-.Lalloc
-	.byte	0xe
-	.uleb128 28
-	.byte	0x4
-	.ualong	.Lpop_pr-.Lfree
-	.byte	0xe
-	.uleb128 24
-	.byte	0xd1
-	.byte	0x4
-	.ualong	.Lpop_r13-.Lpop_pr
-	.byte	0xe
-	.uleb128 20
-	.byte	0xcd
-	.byte	0x4
-	.ualong	.Lpop_r12-.Lpop_r13
-	.byte	0xe
-	.uleb128 16
-	.byte	0xcc
-	.byte	0x4
-	.ualong	.Lpop_r11-.Lpop_r12
-	.byte	0xe
-	.uleb128 12
-	.byte	0xcb
-	.byte	0x4
-	.ualong	.Lpop_r10-.Lpop_r11
-	.byte	0xe
-	.uleb128 8
-	.byte	0xca
-	.byte	0x4
-	.ualong	.Lpop_r9-.Lpop_r10
-	.byte	0xe
-	.uleb128 4
-	.byte	0xc9
-	.byte	0x4
-	.ualong	.Lpop_r8-.Lpop_r9
-	.byte	0xe
-	.uleb128 0
-	.byte	0xc8
-	.byte	0x4
-	.ualong	.LSblSTART-.Lpop_r8
-	.byte	0xe
-	.uleb128 72
-	.byte	0x4
-	.ualong	.LSblEND-.LSblSTART
-	.byte	0xe
-	.uleb128 72
 	.align	2
 .LENDFDE:
 
diff -u3prN ORIG/libc/nptl/sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S LOCAL/libc/nptl/sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S
--- ORIG/libc/nptl/sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S	Sat Mar 20 15:24:30 2004
+++ LOCAL/libc/nptl/sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S	Sat Apr 17 06:31:04 2004
@@ -196,20 +196,13 @@ __pthread_cond_wait:
 
 14:
 	add	#48, r15
-.Lfree:	
 	lds.l	@r15+, pr
-.Lpop_pr:
 	mov.l	@r15+, r12
-.Lpop_r12:
 	mov.l	@r15+, r11
-.Lpop_r11:
 	mov.l	@r15+, r10
-.Lpop_r10:
 	mov.l	@r15+, r9
-.Lpop_r9:
 	rts
 	 mov.l	@r15+, r8
-.Lpop_r8:
 
 	.align	2
 .Lmunlock0:
@@ -222,7 +215,6 @@ __pthread_cond_wait:
 	.long	__pthread_mutex_cond_lock-.Lmlocki0b
 
 1:
-.LSblSTART:
 	/* Initial locking failed.  */
 	mov	r8, r5
 #if cond_lock != 0
@@ -296,7 +288,6 @@ __pthread_cond_wait:
 13:
 	bra	14b
 	 mov.l	@(12,r15), r0
-.LSblEND:
 
 	.align	2
 .Lmwait0:
@@ -522,48 +513,6 @@ __condvar_w_cleanup:
 	.uleb128 6
 	.byte	0x4
 	.ualong	.Lalloc-.Lpush_pr
-	.byte	0xe
-	.uleb128 72
-	.byte	0x4
-	.ualong	.Lfree-.Lalloc
-	.byte	0xe
-	.uleb128 24
-	.byte	0x4
-	.ualong	.Lpop_pr-.Lfree
-	.byte	0xe
-	.uleb128 20
-	.byte	0xd1
-	.byte	0x4
-	.ualong	.Lpop_r12-.Lpop_pr
-	.byte	0xe
-	.uleb128 16
-	.byte	0xcc
-	.byte	0x4
-	.ualong	.Lpop_r11-.Lpop_r12
-	.byte	0xe
-	.uleb128 12
-	.byte	0xcb
-	.byte	0x4
-	.ualong	.Lpop_r10-.Lpop_r11
-	.byte	0xe
-	.uleb128 8
-	.byte	0xca
-	.byte	0x4
-	.ualong	.Lpop_r9-.Lpop_r10
-	.byte	0xe
-	.uleb128 4
-	.byte	0xc9
-	.byte	0x4
-	.ualong	.Lpop_r8-.Lpop_r9
-	.byte	0xe
-	.uleb128 0
-	.byte	0xc8
-	.byte	0x4
-	.ualong	.LSblSTART-.Lpop_r8
-	.byte	0xe
-	.uleb128 72
-	.byte	0x4
-	.ualong	.LSblEND-.LSblSTART
 	.byte	0xe
 	.uleb128 72
 	.align	2

diff -u3prN ORIG/libc/sysdeps/sh/elf/configure LOCAL/libc/sysdeps/sh/elf/configure
--- ORIG/libc/sysdeps/sh/elf/configure	Thu Jan  1 09:00:00 1970
+++ LOCAL/libc/sysdeps/sh/elf/configure	Tue Apr 13 11:20:33 2004
@@ -0,0 +1,47 @@
+# This file is generated from configure.in by Autoconf.  DO NOT EDIT!
+ # Local configure fragment for sysdeps/sh/elf.
+
+if test "$usetls" != no; then
+# Check for support of thread-local storage handling in assembler and
+# linker.
+echo "$as_me:$LINENO: checking for SH TLS support" >&5
+echo $ECHO_N "checking for sh TLS support... $ECHO_C" >&6
+if test "${libc_cv_sh_tls+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat > conftest.S <<\EOF
+	.section ".tdata", "awT", @progbits
+foo:	.long	25
+	.text
+	.long	foo@TLSGD
+	.long	foo@TLSLDM
+	.long	foo@DTPOFF
+	.long	foo@GOTTPOFF
+	.long	foo@TPOFF
+EOF
+if { ac_try='${CC-cc} -S $CFLAGS conftest.S 1>&5'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  libc_cv_sh_tls=yes
+else
+  libc_cv_sh_tls=no
+fi
+rm -f conftest*
+fi
+echo "$as_me:$LINENO: result: $libc_cv_sh_tls" >&5
+echo "${ECHO_T}$libc_cv_sh_tls" >&6
+if test $libc_cv_sh_tls = yes; then
+  cat >>confdefs.h <<\_ACEOF
+#define HAVE_TLS_SUPPORT 1
+_ACEOF
+
+fi
+fi
+
+cat >>confdefs.h <<\_ACEOF
+#define PI_STATIC_AND_HIDDEN 1
+_ACEOF
+
diff -u3prN ORIG/libc/sysdeps/sh/elf/configure.in LOCAL/libc/sysdeps/sh/elf/configure.in
--- ORIG/libc/sysdeps/sh/elf/configure.in	Thu Jan  1 09:00:00 1970
+++ LOCAL/libc/sysdeps/sh/elf/configure.in	Tue Apr 13 11:20:33 2004
@@ -0,0 +1,32 @@
+GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
+# Local configure fragment for sysdeps/sh/elf.
+
+if test "$usetls" != no; then
+# Check for support of thread-local storage handling in assembler and
+# linker.
+AC_CACHE_CHECK(for SH TLS support, libc_cv_sh_tls, [dnl
+cat > conftest.S <<\EOF
+	.section ".tdata", "awT", @progbits
+foo:	.long	25
+	.text
+	.long	foo@TLSGD
+	.long	foo@TLSLDM
+	.long	foo@DTPOFF
+	.long	foo@GOTTPOFF
+	.long	foo@TPOFF
+EOF
+dnl
+if AC_TRY_COMMAND(${CC-cc} -S $CFLAGS conftest.S 1>&AS_MESSAGE_LOG_FD); then
+  libc_cv_sh_tls=yes
+else
+  libc_cv_sh_tls=no
+fi
+rm -f conftest*])
+if test $libc_cv_sh_tls = yes; then
+  AC_DEFINE(HAVE_TLS_SUPPORT)
+fi
+fi
+
+dnl It is always possible to access static and hidden symbols in an
+dnl position independent way.
+AC_DEFINE(PI_STATIC_AND_HIDDEN)

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

* Re: [PATCH] SH: Fix the last nptl test failure
  2004-04-16 22:23   ` Kaz Kojima
@ 2004-04-17 22:34     ` Ulrich Drepper
  0 siblings, 0 replies; 4+ messages in thread
From: Ulrich Drepper @ 2004-04-17 22:34 UTC (permalink / raw)
  To: Kaz Kojima; +Cc: libc-hacker

Applied.

-- 
➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Mountain View, CA ❖

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

end of thread, other threads:[~2004-04-17 22:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-04-13 12:54 [PATCH] SH: Fix the last nptl test failure Kaz Kojima
2004-04-16 19:15 ` Ulrich Drepper
2004-04-16 22:23   ` Kaz Kojima
2004-04-17 22:34     ` Ulrich Drepper

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).