public inbox for libc-hacker@sourceware.org
 help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@redhat.com>
To: Ulrich Drepper <drepper@redhat.com>
Cc: Glibc hackers <libc-hacker@sources.redhat.com>,
	davem@redhat.com, tcallawa@redhat.com
Subject: [PATCH] sparc64 glibc fixes
Date: Fri, 06 Jan 2006 17:58:00 -0000	[thread overview]
Message-ID: <20060106175837.GR4625@sunsite.mff.cuni.cz> (raw)

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

             reply	other threads:[~2006-01-06 17:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-01-06 17:58 Jakub Jelinek [this message]
2006-01-06 22:57 ` Ulrich Drepper

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060106175837.GR4625@sunsite.mff.cuni.cz \
    --to=jakub@redhat.com \
    --cc=davem@redhat.com \
    --cc=drepper@redhat.com \
    --cc=libc-hacker@sources.redhat.com \
    --cc=tcallawa@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).