From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27088 invoked by alias); 6 Jan 2006 17:58:52 -0000 Received: (qmail 27072 invoked by uid 22791); 6 Jan 2006 17:58:51 -0000 X-Spam-Check-By: sourceware.org Received: from sunsite.ms.mff.cuni.cz (HELO sunsite.mff.cuni.cz) (195.113.15.26) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 06 Jan 2006 17:58:47 +0000 Received: from sunsite.mff.cuni.cz (sunsite.mff.cuni.cz [127.0.0.1]) by sunsite.mff.cuni.cz (8.13.1/8.13.1) with ESMTP id k06HwblK001362; Fri, 6 Jan 2006 18:58:37 +0100 Received: (from jakub@localhost) by sunsite.mff.cuni.cz (8.13.1/8.13.1/Submit) id k06HwbY0001361; Fri, 6 Jan 2006 18:58:37 +0100 Date: Fri, 06 Jan 2006 17:58:00 -0000 From: Jakub Jelinek To: Ulrich Drepper Cc: Glibc hackers , davem@redhat.com, tcallawa@redhat.com Subject: [PATCH] sparc64 glibc fixes Message-ID: <20060106175837.GR4625@sunsite.mff.cuni.cz> Reply-To: Jakub Jelinek Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.1i Mailing-List: contact libc-hacker-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-hacker-owner@sourceware.org X-SW-Source: 2006-01/txt/msg00026.txt.bz2 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 * 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 , 1997. @@ -25,6 +26,7 @@ #ifdef IS_IN_rtld # include /* Defines RTLD_PRIVATE_ERRNO. */ #endif +#include #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 , 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 <&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 < conftest.s <