public inbox for libc-hacker@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] sparc64 glibc fixes
@ 2006-01-06 17:58 Jakub Jelinek
  2006-01-06 22:57 ` Ulrich Drepper
  0 siblings, 1 reply; 2+ messages in thread
From: Jakub Jelinek @ 2006-01-06 17:58 UTC (permalink / raw)
  To: Ulrich Drepper; +Cc: Glibc hackers, davem, tcallawa

Hi!

The sysdep.h changes are needed to actually build sparc64 glibc.
configure changes are because the CFI directive test fails for sparc64,
because of the stack bias (.cfi_rel_offset 1, 0) is not biased and
therefore not aligned.
sysdep-cancel.h is the first part of changes to make cancellation
actually work properly on sparc64, fixes some tests, but will
need to build debugging libgcc_s now to study up the remaining
failures.

2006-01-06  Jakub Jelinek  <jakub@redhat.com>

	* sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h: Include tls.h.
	(SYSCALL_ERROR_HANDLER_ENTRY): Use %g4 instead of %g2, to avoid
	the need of .register directive for it.
	* configure.in (libc_cv_asm_cfi_directives): Use CFI rel offset
	2047 instead of 0 in the test on sparc64.
	* configure: Rebuilt.
nptl/
	* sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h (PSEUDO):
	Add cfi directives.

--- libc/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h.jj	2006-01-02 15:48:07.000000000 -0500
+++ libc/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h	2006-01-04 12:40:51.000000000 -0500
@@ -1,4 +1,5 @@
-/* Copyright (C) 1997, 2000, 2002, 2003, 2004 Free Software Foundation, Inc.
+/* Copyright (C) 1997, 2000, 2002, 2003, 2004, 2006
+   Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Richard Henderson <richard@gnu.ai.mit.edu>, 1997.
 
@@ -25,6 +26,7 @@
 #ifdef IS_IN_rtld
 # include <dl-sysdep.h>		/* Defines RTLD_PRIVATE_ERRNO.  */
 #endif
+#include <tls.h>
 
 #undef SYS_ify
 #define SYS_ify(syscall_name) __NR_##syscall_name
@@ -124,10 +126,10 @@ SYSCALL_ERROR_HANDLER_ENTRY(__syscall_er
 #  define SYSCALL_ERROR_HANDLER						\
 SYSCALL_ERROR_HANDLER_ENTRY(__syscall_error_handler)			\
 	sethi	%tie_hi22(SYSCALL_ERROR_ERRNO), %g1;			\
-	sethi	%hi(_GLOBAL_OFFSET_TABLE_), %g2;			\
+	sethi	%hi(_GLOBAL_OFFSET_TABLE_), %g4;			\
 	add	%g1, %tie_lo10(SYSCALL_ERROR_ERRNO), %g1;		\
-	add	%g2, %lo(_GLOBAL_OFFSET_TABLE_), %g2;			\
-	ldx	[%g2 + %g1], %g1, %tie_ldx(SYSCALL_ERROR_ERRNO);	\
+	add	%g4, %lo(_GLOBAL_OFFSET_TABLE_), %g4;			\
+	ldx	[%g4 + %g1], %g1, %tie_ldx(SYSCALL_ERROR_ERRNO);	\
 	st	%o0, [%g7 + %g1], %tie_add(SYSCALL_ERROR_ERRNO);	\
 	jmpl	%o7+8, %g0;						\
 	 mov	-1, %o0;						\
--- libc/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h.jj	2004-07-06 00:25:43.000000000 -0400
+++ libc/nptl/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h	2006-01-06 05:55:54.000000000 -0500
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2003, 2004, 2006 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Jakub Jelinek <jakub@redhat.com>, 2002.
 
@@ -40,7 +40,11 @@ __##syscall_name##_nocancel:						      
 	 nop;								      \
 .size	__##syscall_name##_nocancel,.-__##syscall_name##_nocancel;	      \
 	.subsection 2;							      \
+	cfi_startproc;							      \
 1:	save %sp, -192, %sp;						      \
+	cfi_def_cfa_register (%fp);					      \
+	cfi_window_save;						      \
+	cfi_register (%o7, %i7);					      \
 	CENABLE;							      \
 	 nop;								      \
 	mov %o0, %l0;							      \
@@ -53,6 +57,7 @@ __##syscall_name##_nocancel:						      
 	 mov %l0, %o0;							      \
 	jmpl %i7 + 8, %g0;						      \
 	 restore %g0, %l1, %o0;						      \
+	cfi_endproc;							      \
 	.previous;							      \
 	SYSCALL_ERROR_HANDLER						      \
 	SYSCALL_ERROR_HANDLER2
--- libc/configure.in.jj	2006-01-04 01:24:42.000000000 -0500
+++ libc/configure.in	2006-01-06 06:01:47.000000000 -0500
@@ -1676,13 +1676,17 @@ elif test $libc_cv_asm_weakext_directive
 fi
 
 AC_CACHE_CHECK(whether CFI directives are supported, libc_cv_asm_cfi_directives, [dnl
+case $machine in
+  sparc/sparc64*) cfi_offset=2047;;
+  *) cfi_offset=0;;
+esac
 cat > conftest.s <<EOF
         .text
         .type   func,%function
 func:
         .cfi_startproc
 	.cfi_remember_state
-	.cfi_rel_offset 1, 0
+	.cfi_rel_offset 1, $cfi_offset
         .cfi_endproc
 EOF
 if AC_TRY_COMMAND(${CC-cc} $ASFLAGS -c conftest.s 1>&AS_MESSAGE_LOG_FD); then
--- libc/configure.jj	2006-01-04 10:33:34.000000000 -0500
+++ libc/configure	2006-01-06 06:02:03.000000000 -0500
@@ -6135,13 +6135,17 @@ echo $ECHO_N "checking whether CFI direc
 if test "${libc_cv_asm_cfi_directives+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat > conftest.s <<EOF
+  case $machine in
+  sparc/sparc64*) cfi_offset=2047;;
+  *) cfi_offset=0;;
+esac
+cat > conftest.s <<EOF
         .text
         .type   func,%function
 func:
         .cfi_startproc
 	.cfi_remember_state
-	.cfi_rel_offset 1, 0
+	.cfi_rel_offset 1, $cfi_offset
         .cfi_endproc
 EOF
 if { ac_try='${CC-cc} $ASFLAGS -c conftest.s 1>&5'

	Jakub

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

* Re: [PATCH] sparc64 glibc fixes
  2006-01-06 17:58 [PATCH] sparc64 glibc fixes Jakub Jelinek
@ 2006-01-06 22:57 ` Ulrich Drepper
  0 siblings, 0 replies; 2+ messages in thread
From: Ulrich Drepper @ 2006-01-06 22:57 UTC (permalink / raw)
  To: Jakub Jelinek; +Cc: Glibc hackers, davem, tcallawa

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

Applied.

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


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 251 bytes --]

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

end of thread, other threads:[~2006-01-06 22:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-01-06 17:58 [PATCH] sparc64 glibc fixes Jakub Jelinek
2006-01-06 22:57 ` 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).