diff options
author | 2003-09-28 23:46:25 +0000 | |
---|---|---|
committer | 2003-09-28 23:46:25 +0000 | |
commit | 0e81c22d9a7f5116744fae195e5f9a0b3a2a3a7c (patch) | |
tree | 8312268a17906e00f33afcd88404bf20c3fd3e16 /sys-libs | |
parent | Update snapshot to 20030927 and NPTL to 0.60. Add a few patches (diff) | |
download | gentoo-2-0e81c22d9a7f5116744fae195e5f9a0b3a2a3a7c.tar.gz gentoo-2-0e81c22d9a7f5116744fae195e5f9a0b3a2a3a7c.tar.bz2 gentoo-2-0e81c22d9a7f5116744fae195e5f9a0b3a2a3a7c.zip |
Update snapshot to 20030927 and NPTL to 0.60. Add a few patches
from Kumba <kumba@gentoo.org> for mips.
Diffstat (limited to 'sys-libs')
-rw-r--r-- | sys-libs/glibc/ChangeLog | 13 | ||||
-rw-r--r-- | sys-libs/glibc/Manifest | 6 | ||||
-rw-r--r-- | sys-libs/glibc/files/2.3.2/glibc-2.3.2-ia64-LOAD_ARGS-fixup.patch | 96 | ||||
-rw-r--r-- | sys-libs/glibc/files/2.3.2/glibc-2.3.2-mips-add-n32-n64-sysdep-cancel.patch | 153 | ||||
-rw-r--r-- | sys-libs/glibc/files/2.3.2/glibc-2.3.2-mips-configure-for-n64-symver.patch | 20 | ||||
-rw-r--r-- | sys-libs/glibc/files/2.3.2/glibc-2.3.2-mips-fix-n32-n64-sysdep-headers.patch | 132 | ||||
-rw-r--r-- | sys-libs/glibc/files/2.3.2/glibc-2.3.2-mips-pread-linux2.5.patch | 137 | ||||
-rw-r--r-- | sys-libs/glibc/files/digest-glibc-2.3.2-r6 | 4 | ||||
-rw-r--r-- | sys-libs/glibc/glibc-2.3.2-r5.ebuild | 62 | ||||
-rw-r--r-- | sys-libs/glibc/glibc-2.3.2-r6.ebuild | 591 |
10 files changed, 1167 insertions, 47 deletions
diff --git a/sys-libs/glibc/ChangeLog b/sys-libs/glibc/ChangeLog index 8b9126252dc4..c8238f90ce01 100644 --- a/sys-libs/glibc/ChangeLog +++ b/sys-libs/glibc/ChangeLog @@ -1,6 +1,17 @@ # ChangeLog for sys-libs/glibc # Copyright 2002-2003 Gentoo Technologies, Inc.; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sys-libs/glibc/ChangeLog,v 1.83 2003/09/20 20:23:40 azarah Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-libs/glibc/ChangeLog,v 1.84 2003/09/28 23:46:06 azarah Exp $ + +*glibc-2.3.2-r6 (28 Sep 2003) + + 28 Sep 2003; Martin Schlemmer <azarah@gentoo.org> glibc-2.3.2-r5.ebuild, + glibc-2.3.2-r6.ebuild, files/2.3.2/glibc-2.3.2-ia64-LOAD_ARGS-fixup.patch, + files/2.3.2/glibc-2.3.2-mips-add-n32-n64-sysdep-cancel.patch, + files/2.3.2/glibc-2.3.2-mips-configure-for-n64-symver.patch, + files/2.3.2/glibc-2.3.2-mips-fix-n32-n64-sysdep-headers.patch, + files/2.3.2/glibc-2.3.2-mips-pread-linux2.5.patch: + Update snapshot to 20030927 and NPTL to 0.60. Add a few patches from Kumba + <kumba@gentoo.org> for mips. *glibc-2.3.2-r5 (20 Sep 2003) diff --git a/sys-libs/glibc/Manifest b/sys-libs/glibc/Manifest index 3eeac6b93952..5eb36e93898c 100644 --- a/sys-libs/glibc/Manifest +++ b/sys-libs/glibc/Manifest @@ -1,11 +1,11 @@ MD5 faecaafd64455df8f1a0b21b657581a3 glibc-2.3.2-r2.ebuild 17616 MD5 ec652c5641efa40df96db52e3b00f91e glibc-2.2.5-r8.ebuild 9682 MD5 89f63166320e4607f935b2930c3b45d9 glibc-2.3.2-r3.ebuild 17330 -MD5 33bf64b282ce7c18478a5db51e4c0192 ChangeLog 17221 +MD5 27dbe76e0be4041b10f0c9c70d523fd2 ChangeLog 17221 MD5 bbd9fe3118554c69975335a9743a7746 glibc-2.3.2-r1.ebuild 16405 MD5 1e8074131f0afe3b08b9c2b07eccd001 glibc-2.3.2-r4.ebuild 17343 -MD5 1e7c2fc3cad174fbfbfa68cfc79999fd glibc-2.3.2-r6.ebuild 16985 -MD5 fc73918f6968b228fea64ba500ea14bc glibc-2.3.2-r5.ebuild 16984 +MD5 fc0c714dfaa387e87777068f47ed8833 glibc-2.3.2-r6.ebuild 16985 +MD5 4ed49e594e024c91fcc2a74385a7fab4 glibc-2.3.2-r5.ebuild 16984 MD5 911665b60e1101be73f4b3213131abf5 glibc-2.3.1-r4.ebuild 10287 MD5 2013443f5192d4b999953ba4248d288c files/nscd.conf 1158 MD5 82be016c42c7cc353ee563fcbcbc4769 files/nscd 840 diff --git a/sys-libs/glibc/files/2.3.2/glibc-2.3.2-ia64-LOAD_ARGS-fixup.patch b/sys-libs/glibc/files/2.3.2/glibc-2.3.2-ia64-LOAD_ARGS-fixup.patch new file mode 100644 index 000000000000..a4f49c29080d --- /dev/null +++ b/sys-libs/glibc/files/2.3.2/glibc-2.3.2-ia64-LOAD_ARGS-fixup.patch @@ -0,0 +1,96 @@ +From libc-alpha-return-13560-listarch-libc-alpha=sources dot redhat dot com at sources dot redhat dot com Wed Sep 24 06:27:22 2003 +Return-Path: <libc-alpha-return-13560-listarch-libc-alpha=sources dot redhat dot com at sources dot redhat dot com> +Delivered-To: listarch-libc-alpha at sources dot redhat dot com +Received: (qmail 23856 invoked by alias); 24 Sep 2003 06:27:20 -0000 +Mailing-List: contact libc-alpha-help at sources dot redhat dot com; run by ezmlm +Precedence: bulk +List-Subscribe: <mailto:libc-alpha-subscribe at sources dot redhat dot com> +List-Archive: <http://sources.redhat.com/ml/libc-alpha/> +List-Post: <mailto:libc-alpha at sources dot redhat dot com> +List-Help: <mailto:libc-alpha-help at sources dot redhat dot com>, <http://sources dot redhat dot com/ml/#faqs> +Sender: libc-alpha-owner at sources dot redhat dot com +Delivered-To: mailing list libc-alpha at sources dot redhat dot com +Received: (qmail 23847 invoked from network); 24 Sep 2003 06:27:16 -0000 +Received: from unknown (HELO sccrmhc11.comcast.net) (204.127.202.55) + by sources dot redhat dot com with SMTP; 24 Sep 2003 06:27:16 -0000 +Received: from lucon.org ([12.234.88.5]) + by comcast dot net (sccrmhc11) with ESMTP + id <2003092406271601100ok1f3e>; Wed, 24 Sep 2003 06:27:16 +0000 +Received: by lucon.org (Postfix, from userid 1000) + id 6B4D02C828; Tue, 23 Sep 2003 23:27:11 -0700 (PDT) +Date: Tue, 23 Sep 2003 23:27:11 -0700 +From: "H dot J dot Lu" <hjl at lucon dot org> +To: Richard Henderson <rth at twiddle dot net> +Cc: GNU C Library <libc-alpha at sources dot redhat dot com>, + linux ia64 kernel <linux-ia64 at vger dot kernel dot org> +Subject: PATCH: Re: Inefficient ia64 system call implementation in glibc +Message-ID: <20030924062711.GA860@lucon.org> +References: <20030919163218.GA21480@lucon.org> <20030921210434.GA2280@twiddle.net> <20030922193918.GA1141@lucon.org> <20030922232123.GA17271@twiddle.net> +Mime-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +Content-Disposition: inline +In-Reply-To: <20030922232123 dot GA17271 at twiddle dot net> +User-Agent: Mutt/1.4.1i + +On Mon, Sep 22, 2003 at 04:21:23PM -0700, Richard Henderson wrote: +> On Mon, Sep 22, 2003 at 12:39:18PM -0700, H. J. Lu wrote: +> > Can I get char * from char [300]? +> +> x+0 would work in this case; I'd guess it'd work for most of the +> cases that syscalls need to handle. +> + +This patch works for me. + + +H.J. +--- +2003-09-22 H.J. Lu <hongjiu.lu@intel.com> + + * sysdeps/unix/sysv/linux/ia64/sysdep.h (LOAD_ARGS_1): Use + __typeof ((outX) + 0) instead of long. + (LOAD_ARGS_2): Likewise. + (LOAD_ARGS_3): Likewise. + (LOAD_ARGS_4): Likewise. + (LOAD_ARGS_5): Likewise. + (LOAD_ARGS_6): Likewise. + +--- sysdeps/unix/sysv/linux/ia64/sysdep.h.inline 2003-08-21 07:05:30.000000000 -0700 ++++ sysdeps/unix/sysv/linux/ia64/sysdep.h 2003-09-23 11:04:02.000000000 -0700 +@@ -191,23 +191,23 @@ + #define INTERNAL_SYSCALL_ERRNO(val, err) (val) + + #define LOAD_ARGS_0() do { } while (0) +-#define LOAD_ARGS_1(out0) \ +- register long _out0 asm ("out0") = (long) (out0); \ ++#define LOAD_ARGS_1(out0) \ ++ register __typeof ((out0) + 0) _out0 asm ("out0") = (out0); \ + LOAD_ARGS_0 () +-#define LOAD_ARGS_2(out0, out1) \ +- register long _out1 asm ("out1") = (long) (out1); \ ++#define LOAD_ARGS_2(out0, out1) \ ++ register __typeof ((out1) + 0) _out1 asm ("out1") = (out1); \ + LOAD_ARGS_1 (out0) +-#define LOAD_ARGS_3(out0, out1, out2) \ +- register long _out2 asm ("out2") = (long) (out2); \ ++#define LOAD_ARGS_3(out0, out1, out2) \ ++ register __typeof ((out2) + 0) _out2 asm ("out2") = (out2); \ + LOAD_ARGS_2 (out0, out1) +-#define LOAD_ARGS_4(out0, out1, out2, out3) \ +- register long _out3 asm ("out3") = (long) (out3); \ ++#define LOAD_ARGS_4(out0, out1, out2, out3) \ ++ register __typeof ((out3) + 0) _out3 asm ("out3") = (out3); \ + LOAD_ARGS_3 (out0, out1, out2) +-#define LOAD_ARGS_5(out0, out1, out2, out3, out4) \ +- register long _out4 asm ("out4") = (long) (out4); \ ++#define LOAD_ARGS_5(out0, out1, out2, out3, out4) \ ++ register __typeof ((out4) + 0) _out4 asm ("out4") = (out4); \ + LOAD_ARGS_4 (out0, out1, out2, out3) +-#define LOAD_ARGS_6(out0, out1, out2, out3, out4, out5) \ +- register long _out5 asm ("out5") = (long) (out5); \ ++#define LOAD_ARGS_6(out0, out1, out2, out3, out4, out5) \ ++ register __typeof ((out5) + 0) _out5 asm ("out5") = (out5); \ + LOAD_ARGS_5 (out0, out1, out2, out3, out4) + + #define ASM_OUTARGS_0 + diff --git a/sys-libs/glibc/files/2.3.2/glibc-2.3.2-mips-add-n32-n64-sysdep-cancel.patch b/sys-libs/glibc/files/2.3.2/glibc-2.3.2-mips-add-n32-n64-sysdep-cancel.patch new file mode 100644 index 000000000000..5d204c25b83e --- /dev/null +++ b/sys-libs/glibc/files/2.3.2/glibc-2.3.2-mips-add-n32-n64-sysdep-cancel.patch @@ -0,0 +1,153 @@ +2003-09-10 Chris Demetriou <cgd@broadcom.com> + + * sysdeps/unix/sysv/linux/mips/mips64/sysdep-cancel.h: New file. + +Index: linuxthreads/sysdeps/unix/sysv/linux/mips/mips64/sysdep-cancel.h +--- /dev/null Wed Sep 10 15:45:19 2003 ++++ linuxthreads/sysdeps/unix/sysv/linux/mips/mips64/sysdep-cancel.h Wed Sep 10 15:45:14 2003 +@@ -0,0 +1,145 @@ ++/* Copyright (C) 2003 Free Software Foundation, Inc. ++ This file is part of the GNU C Library. ++ Contributed by Chris Demetriou of Broadcom Corporation, ++ based on work by Guido Guenther <agx@sigxcpu.org>. ++ ++ The GNU C Library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. ++ ++ The GNU C Library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with the GNU C Library; if not, write to the Free ++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ++ 02111-1307 USA. */ ++ ++#include <sysdep.h> ++#ifndef __ASSEMBLER__ ++# include <linuxthreads/internals.h> ++#endif ++#include <sys/asm.h> ++ ++#if !defined NOT_IN_libc || defined IS_IN_libpthread || defined IS_IN_librt ++ ++#ifdef __PIC__ ++# undef PSEUDO ++# define PSEUDO(name, syscall_name, args) \ ++ .align 2; \ ++ 99: \ ++ PTR_LA t9,__syscall_error; \ ++ /* manual cpreturn. */ \ ++ REG_L gp, STKOFF_GP(sp); \ ++ RESTORESTK ; \ ++ jr t9; \ ++ ENTRY (name) \ ++ SAVESTK ; \ ++ .cpsetup t9, STKOFF_GP, name ; \ ++ .set reorder; \ ++ SINGLE_THREAD_P(t0); \ ++ bne zero, t0, L(pseudo_cancel); \ ++ .set noreorder; \ ++ li v0, SYS_ify(syscall_name); \ ++ syscall; \ ++ .set reorder; \ ++ bne a3, zero, SYSCALL_ERROR_LABEL; \ ++ /* manual cpreturn. */ \ ++ REG_L gp, STKOFF_GP(sp); \ ++ RESTORESTK ; \ ++ ret; \ ++ L(pseudo_cancel): \ ++ REG_S ra, STKOFF_RA(sp); \ ++ PUSHARGS_##args; /* save syscall args */ \ ++ CENABLE; \ ++ REG_S v0, STKOFF_SVMSK(sp); /* save mask */ \ ++ POPARGS_##args; /* restore syscall args */ \ ++ .set noreorder; \ ++ li v0, SYS_ify (syscall_name); \ ++ syscall; \ ++ .set reorder; \ ++ REG_S v0, STKOFF_SC_V0(sp); /* save syscall result */ \ ++ REG_S a3, STKOFF_SC_ERR(sp); /* save syscall error flag */ \ ++ REG_L a0, STKOFF_SVMSK(sp); /* pass mask as arg1 */ \ ++ CDISABLE; \ ++ REG_L a3, STKOFF_SC_ERR(sp); /* restore syscall error flag */ \ ++ REG_L ra, STKOFF_RA(sp); /* restore return address */ \ ++ REG_L v0, STKOFF_SC_V0(sp); /* restore syscall result */ \ ++ bne a3, zero, SYSCALL_ERROR_LABEL; \ ++ /* manual cpreturn. */ \ ++ REG_L gp, STKOFF_GP(sp); \ ++ RESTORESTK ; \ ++ L(pseudo_end): ++#endif ++ ++# define PUSHARGS_0 /* nothing to do */ ++# define PUSHARGS_1 PUSHARGS_0 REG_S a0, STKOFF_A0(sp); ++# define PUSHARGS_2 PUSHARGS_1 REG_S a1, STKOFF_A1(sp); ++# define PUSHARGS_3 PUSHARGS_2 REG_S a2, STKOFF_A2(sp); ++# define PUSHARGS_4 PUSHARGS_3 REG_S a3, STKOFF_A3(sp); ++# define PUSHARGS_5 PUSHARGS_4 REG_S a4, STKOFF_A4(sp); ++# define PUSHARGS_6 PUSHARGS_5 REG_S a5, STKOFF_A5(sp); ++ ++# define POPARGS_0 /* nothing to do */ ++# define POPARGS_1 POPARGS_0 REG_L a0, STKOFF_A0(sp); ++# define POPARGS_2 POPARGS_1 REG_L a1, STKOFF_A1(sp); ++# define POPARGS_3 POPARGS_2 REG_L a2, STKOFF_A2(sp); ++# define POPARGS_4 POPARGS_3 REG_L a3, STKOFF_A3(sp); ++# define POPARGS_5 POPARGS_4 REG_L a4, STKOFF_A4(sp); ++# define POPARGS_6 POPARGS_5 REG_L a5, STKOFF_A5(sp); ++ ++/* Save an even number of slots. Should be 0 if an even number of slots ++ are used below, or SZREG if an odd number are used. */ ++# define STK_PAD SZREG ++ ++/* Place values that we are more likely to use later in this sequence, i.e. ++ closer to the SP at function entry. If you do that, the are more ++ likely to already be in your d-cache. */ ++# define STKOFF_A5 (STK_PAD) ++# define STKOFF_A4 (STKOFF_A5 + SZREG) ++# define STKOFF_A3 (STKOFF_A4 + SZREG) ++# define STKOFF_A2 (STKOFF_A3 + SZREG) /* MT and more args. */ ++# define STKOFF_A1 (STKOFF_A2 + SZREG) /* MT and 2 args. */ ++# define STKOFF_A0 (STKOFF_A1 + SZREG) /* MT and 1 arg. */ ++# define STKOFF_RA (STKOFF_A0 + SZREG) /* Used if MT. */ ++# define STKOFF_SC_V0 (STKOFF_RA + SZREG) /* Used if MT. */ ++# define STKOFF_SC_ERR (STKOFF_SC_V0 + SZREG) /* Used if MT. */ ++# define STKOFF_SVMSK (STKOFF_SC_ERR + SZREG) /* Used if MT. */ ++# define STKOFF_GP (STKOFF_SVMSK + SZREG) /* Always used. */ ++ ++# define STKSPACE (STKOFF_GP + SZREG) ++# define SAVESTK PTR_SUBU sp, STKSPACE ++# define RESTORESTK PTR_ADDU sp, STKSPACE ++ ++# ifdef IS_IN_libpthread ++# define CENABLE PTR_LA t9, __pthread_enable_asynccancel; jalr t9; ++# define CDISABLE PTR_LA t9, __pthread_disable_asynccancel; jalr t9; ++# define __local_multiple_threads __pthread_multiple_threads ++# else ++# define CENABLE PTR_LA t9, __libc_enable_asynccancel; jalr t9; ++# define CDISABLE PTR_LA t9, __libc_disable_asynccancel; jalr t9; ++# define __local_multiple_threads __libc_multiple_threads ++# endif ++ ++# if !defined NOT_IN_libc ++# define __local_multiple_threads __libc_multiple_threads ++# else ++# define __local_multiple_threads __pthread_multiple_threads ++# endif ++ ++# ifndef __ASSEMBLER__ ++extern int __local_multiple_threads attribute_hidden; ++# define SINGLE_THREAD_P __builtin_expect (__local_multiple_threads == 0, 1) ++# else ++# define SINGLE_THREAD_P(reg) lw reg, __local_multiple_threads ++#endif ++ ++#elif !defined __ASSEMBLER__ ++ ++/* This code should never be used but we define it anyhow. */ ++# define SINGLE_THREAD_P (1) ++ ++#endif diff --git a/sys-libs/glibc/files/2.3.2/glibc-2.3.2-mips-configure-for-n64-symver.patch b/sys-libs/glibc/files/2.3.2/glibc-2.3.2-mips-configure-for-n64-symver.patch new file mode 100644 index 000000000000..4ed4cd2c3be6 --- /dev/null +++ b/sys-libs/glibc/files/2.3.2/glibc-2.3.2-mips-configure-for-n64-symver.patch @@ -0,0 +1,20 @@ +2003-07-17 Guido Guenther <agx@sigxcpu.org> + + * configure.in: pass $CFLAGS to ld --version-script test + +Index: configure.in +=================================================================== +RCS file: /cvs/glibc/libc/configure.in,v +retrieving revision 1.401 +diff -u -r1.401 configure.in +--- configure.in 3 Jul 2003 21:03:56 -0000 1.401 ++++ configure.in 16 Jul 2003 18:35:18 -0000 +@@ -1051,7 +1051,7 @@ + global: sym; + } VERS_1; + EOF +- if ${CC-cc} -c $ASFLAGS conftest.s 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then ++ if ${CC-cc} -c $ASFLAGS $CFLAGS conftest.s 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then + if AC_TRY_COMMAND([${CC-cc} $CFLAGS $LDFLAGS -shared + -o conftest.so conftest.o + -nostartfiles -nostdlib diff --git a/sys-libs/glibc/files/2.3.2/glibc-2.3.2-mips-fix-n32-n64-sysdep-headers.patch b/sys-libs/glibc/files/2.3.2/glibc-2.3.2-mips-fix-n32-n64-sysdep-headers.patch new file mode 100644 index 000000000000..ba186224f789 --- /dev/null +++ b/sys-libs/glibc/files/2.3.2/glibc-2.3.2-mips-fix-n32-n64-sysdep-headers.patch @@ -0,0 +1,132 @@ +2003-09-10 Chris Demetriou <cgd@broadcom.com> + + * sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h: Remove + "#if 0" surrounding most of contents. + (SYSCALL_ERROR_LABEL): Define. + (__SYSCALL_CLOBBERS): Add $10. + (internal_syscall7): Remove. + * sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h: Likewise. + + +Index: sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h +--- sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h Fri Aug 15 19:35:02 2003 ++++ sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h Wed Sep 10 11:00:07 2003 +@@ -33,9 +33,16 @@ + # define SYS_ify(syscall_name) __NR_N32_/**/syscall_name + #endif + ++#ifdef __ASSEMBLER__ + +-#ifndef __ASSEMBLER__ +-#if 0 /* untested */ ++/* We don't want the label for the error handler to be visible in the symbol ++ table when we define it here. */ ++#ifdef __PIC__ ++# define SYSCALL_ERROR_LABEL 99b ++#endif ++ ++#else /* ! __ASSEMBLER__ */ ++ + /* Define a macro which expands into the inline wrapper code for a system + call. */ + #undef INLINE_SYSCALL +@@ -227,37 +234,8 @@ + } \ + _sys_result; \ + }) +- +-#define internal_syscall7(name, err, arg1, arg2, arg3, arg4, arg5, arg6, arg7)\ +-({ \ +- long _sys_result; \ +- \ +- { \ +- register long long __v0 asm("$2"); \ +- register long long __a0 asm("$4") = (long long) arg1; \ +- register long long __a1 asm("$5") = (long long) arg2; \ +- register long long __a2 asm("$6") = (long long) arg3; \ +- register long long __a3 asm("$7") = (long long) arg4; \ +- register long long __a4 asm("$8") = (long long) arg5; \ +- register long long __a5 asm("$9") = (long long) arg6; \ +- register long long __a6 asm("$10") = (long long) arg7; \ +- __asm__ volatile ( \ +- ".set\tnoreorder\n\t" \ +- "li\t$2, %5\t\t\t# " #name "\n\t" \ +- "syscall\n\t" \ +- ".set\treorder" \ +- : "=r" (__v0), "+r" (__a3) \ +- : "r" (__a0), "r" (__a1), "r" (__a2), "i" (SYS_ify(name)), \ +- "r" (__a4), "r" (__a5), "r" (__a6) \ +- : __SYSCALL_CLOBBERS); \ +- err = __a3; \ +- _sys_result = __v0; \ +- } \ +- _sys_result; \ +-}) + +-#define __SYSCALL_CLOBBERS "$1", "$3", "$11", "$12", "$13", "$14", "$15", "$24", "$25" +-#endif /* untested */ ++#define __SYSCALL_CLOBBERS "$1", "$3", "$10", "$11", "$12", "$13", "$14", "$15", "$24", "$25" + #endif /* __ASSEMBLER__ */ + + #endif /* linux/mips/sysdep.h */ +Index: sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h +--- sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h Fri Aug 15 19:35:02 2003 ++++ sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h Wed Sep 10 11:00:07 2003 +@@ -33,9 +33,16 @@ + # define SYS_ify(syscall_name) __NR_N64_/**/syscall_name + #endif + ++#ifdef __ASSEMBLER__ + +-#ifndef __ASSEMBLER__ +-#if 0 /* untested */ ++/* We don't want the label for the error handler to be visible in the symbol ++ table when we define it here. */ ++#ifdef __PIC__ ++# define SYSCALL_ERROR_LABEL 99b ++#endif ++ ++#else /* ! __ASSEMBLER__ */ ++ + /* Define a macro which expands into the inline wrapper code for a system + call. */ + #undef INLINE_SYSCALL +@@ -227,37 +234,8 @@ + } \ + _sys_result; \ + }) +- +-#define internal_syscall7(name, err, arg1, arg2, arg3, arg4, arg5, arg6, arg7)\ +-({ \ +- long _sys_result; \ +- \ +- { \ +- register long __v0 asm("$2"); \ +- register long __a0 asm("$4") = (long) arg1; \ +- register long __a1 asm("$5") = (long) arg2; \ +- register long __a2 asm("$6") = (long) arg3; \ +- register long __a3 asm("$7") = (long) arg4; \ +- register long __a4 asm("$8") = (long) arg5; \ +- register long __a5 asm("$9") = (long) arg6; \ +- register long __a6 asm("$10") = (long) arg7; \ +- __asm__ volatile ( \ +- ".set\tnoreorder\n\t" \ +- "li\t$2, %5\t\t\t# " #name "\n\t" \ +- "syscall\n\t" \ +- ".set\treorder" \ +- : "=r" (__v0), "+r" (__a3) \ +- : "r" (__a0), "r" (__a1), "r" (__a2), "i" (SYS_ify(name)), \ +- "r" (__a4), "r" (__a5), "r" (__a6) \ +- : __SYSCALL_CLOBBERS); \ +- err = __a3; \ +- _sys_result = __v0; \ +- } \ +- _sys_result; \ +-}) + +-#define __SYSCALL_CLOBBERS "$1", "$3", "$11", "$12", "$13", "$14", "$15", "$24", "$25" +-#endif /* untested */ ++#define __SYSCALL_CLOBBERS "$1", "$3", "$10", "$11", "$12", "$13", "$14", "$15", "$24", "$25" + #endif /* __ASSEMBLER__ */ + + #endif /* linux/mips/sysdep.h */ diff --git a/sys-libs/glibc/files/2.3.2/glibc-2.3.2-mips-pread-linux2.5.patch b/sys-libs/glibc/files/2.3.2/glibc-2.3.2-mips-pread-linux2.5.patch new file mode 100644 index 000000000000..cb2d67464b32 --- /dev/null +++ b/sys-libs/glibc/files/2.3.2/glibc-2.3.2-mips-pread-linux2.5.patch @@ -0,0 +1,137 @@ +2003-05-30 Guido Guenther <agx@sigxcpu.org> + + * sysdeps/unix/sysv/linux/mips/pread.c: include <stddef.h> + * sysdeps/unix/sysv/linux/mips/pread.c: handle __NR_N32_pread64, + __NR_O32_pread64 and __NR__N64_pread64. + * sysdeps/unix/sysv/linux/mips/pread64.c: likewise. + * sysdeps/unix/sysv/linux/mips/pwrite.c: handle __NR_N32_pwrite64, + __NR_O32_pwrite64 and __NR__N64_pwrite64. + * sysdeps/unix/sysv/linux/mips/pwrite64.c: likewise. + +Index: sysdeps/unix/sysv/linux/mips//pread.c +=================================================================== +RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/mips/pread.c,v +retrieving revision 1.11 +diff -u -p -u -r1.11 pread.c +--- sysdeps/unix/sysv/linux/mips//pread.c 30 May 2003 17:41:46 -0000 1.11 ++++ sysdeps/unix/sysv/linux/mips//pread.c 23 Jul 2003 11:49:51 -0000 +@@ -33,6 +34,24 @@ + # error "__NR_pread and __NR_pread64 both defined???" + # endif + # define __NR_pread __NR_pread64 ++#endif ++#ifdef __NR_O32_pread64 /* Newer kernels renamed but it's the same. */ ++# ifdef __NR_O32_pread ++# error "__NR_O32_pread and __NR_O32_pread64 both defined???" ++# endif ++# define __NR_O32_pread __NR_O32_pread64 ++#endif ++#ifdef __NR_N32_pread64 /* Newer kernels renamed but it's the same. */ ++# ifdef __NR_N32_pread ++# error "__NR_N32_pread and __NR_N32_pread64 both defined???" ++# endif ++# define __NR_N32_pread __NR_N32_pread64 ++#endif ++#ifdef __NR_N64_pread64 /* Newer kernels renamed but it's the same. */ ++# ifdef __NR_N64_pread ++# error "__NR_N64_pread and __NR_N64_pread64 both defined???" ++# endif ++# define __NR_N64_pread __NR_N64_pread64 + #endif + + #if defined __NR_pread || __ASSUME_PREAD_SYSCALL > 0 +Index: sysdeps/unix/sysv/linux/mips//pread64.c +=================================================================== +RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/mips/pread64.c,v +retrieving revision 1.11 +diff -u -p -u -r1.11 pread64.c +--- sysdeps/unix/sysv/linux/mips//pread64.c 30 May 2003 17:41:46 -0000 1.11 ++++ sysdeps/unix/sysv/linux/mips//pread64.c 23 Jul 2003 11:49:51 -0000 +@@ -33,6 +33,24 @@ + # endif + # define __NR_pread __NR_pread64 + #endif ++#ifdef __NR_O32_pread64 /* Newer kernels renamed but it's the same. */ ++# ifdef __NR_O32_pread ++# error "__NR_O32_pread and __NR_O32_pread64 both defined???" ++# endif ++# define __NR_O32_pread __NR_O32_pread64 ++#endif ++#ifdef __NR_N32_pread64 /* Newer kernels renamed but it's the same. */ ++# ifdef __NR_N32_pread ++# error "__NR_N32_pread and __NR_N32_pread64 both defined???" ++# endif ++# define __NR_N32_pread __NR_N32_pread64 ++#endif ++#ifdef __NR_N64_pread64 /* Newer kernels renamed but it's the same. */ ++# ifdef __NR_N64_pread ++# error "__NR_N64_pread and __NR_N64_pread64 both defined???" ++# endif ++# define __NR_N64_pread __NR_N64_pread64 ++#endif + + #if defined __NR_pread || __ASSUME_PREAD_SYSCALL > 0 + +Index: sysdeps/unix/sysv/linux/mips//pwrite.c +=================================================================== +RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/mips/pwrite.c,v +retrieving revision 1.11 +diff -u -p -u -r1.11 pwrite.c +--- sysdeps/unix/sysv/linux/mips//pwrite.c 30 May 2003 17:41:46 -0000 1.11 ++++ sysdeps/unix/sysv/linux/mips//pwrite.c 23 Jul 2003 11:49:51 -0000 +@@ -34,6 +34,24 @@ + # endif + # define __NR_pwrite __NR_pwrite64 + #endif ++#ifdef __NR_O32_pwrite64 /* Newer kernels renamed but it's the same. */ ++# ifdef __NR_O32_pwrite ++# error "__NR_O32_pwrite and __NR_O32_pwrite64 both defined???" ++# endif ++# define __NR_O32_pwrite __NR_O32_pwrite64 ++#endif ++#ifdef __NR_N32_pwrite64 /* Newer kernels renamed but it's the same. */ ++# ifdef __NR_N32_pwrite ++# error "__NR_N32_pwrite and __NR_N32_pwrite64 both defined???" ++# endif ++# define __NR_N32_pwrite __NR_N32_pwrite64 ++#endif ++#ifdef __NR_N64_pwrite64 /* Newer kernels renamed but it's the same. */ ++# ifdef __NR_N64_pwrite ++# error "__NR_N64_pwrite and __NR_N64_pwrite64 both defined???" ++# endif ++# define __NR_N64_pwrite __NR_N64_pwrite64 ++#endif + + #if defined __NR_pwrite || __ASSUME_PWRITE_SYSCALL > 0 + +Index: sysdeps/unix/sysv/linux/mips//pwrite64.c +=================================================================== +RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/mips/pwrite64.c,v +retrieving revision 1.12 +diff -u -p -u -r1.12 pwrite64.c +--- sysdeps/unix/sysv/linux/mips//pwrite64.c 30 May 2003 17:41:46 -0000 1.12 ++++ sysdeps/unix/sysv/linux/mips//pwrite64.c 23 Jul 2003 11:49:51 -0000 +@@ -33,6 +33,24 @@ + # endif + # define __NR_pwrite __NR_pwrite64 + #endif ++#ifdef __NR_O32_pwrite64 /* Newer kernels renamed but it's the same. */ ++# ifdef __NR_O32_pwrite ++# error "__NR_O32_pwrite and __NR_O32_pwrite64 both defined???" ++# endif ++# define __NR_O32_pwrite __NR_O32_pwrite64 ++#endif ++#ifdef __NR_N32_pwrite64 /* Newer kernels renamed but it's the same. */ ++# ifdef __NR_N32_pwrite ++# error "__NR_N32_pwrite and __NR_N32_pwrite64 both defined???" ++# endif ++# define __NR_N32_pwrite __NR_N32_pwrite64 ++#endif ++#ifdef __NR_N64_pwrite64 /* Newer kernels renamed but it's the same. */ ++# ifdef __NR_N64_pwrite ++# error "__NR_N64_pwrite and __NR_N64_pwrite64 both defined???" ++# endif ++# define __NR_N64_pwrite __NR_N64_pwrite64 ++#endif + + #if defined __NR_pwrite || __ASSUME_PWRITE_SYSCALL > 0 diff --git a/sys-libs/glibc/files/digest-glibc-2.3.2-r6 b/sys-libs/glibc/files/digest-glibc-2.3.2-r6 new file mode 100644 index 000000000000..b411638b98cb --- /dev/null +++ b/sys-libs/glibc/files/digest-glibc-2.3.2-r6 @@ -0,0 +1,4 @@ +MD5 ede969aad568f48083e413384f20753c glibc-2.3.2.tar.bz2 13377170 +MD5 894b8969cfbdf787c73e139782167607 glibc-linuxthreads-2.3.2.tar.bz2 216310 +MD5 00fcdcc3fa532de1631ce0e78d755c5e nptl-0.60.tar.bz2 224135 +MD5 9e591662ef600ca786963ee4622d3b98 glibc-2.3.2-branch-update-20030927.patch.bz2 1245627 diff --git a/sys-libs/glibc/glibc-2.3.2-r5.ebuild b/sys-libs/glibc/glibc-2.3.2-r5.ebuild index b8897384be30..b6fa114bc333 100644 --- a/sys-libs/glibc/glibc-2.3.2-r5.ebuild +++ b/sys-libs/glibc/glibc-2.3.2-r5.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2003 Gentoo Technologies, Inc. # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-libs/glibc/glibc-2.3.2-r5.ebuild,v 1.1 2003/09/20 20:23:40 azarah Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-libs/glibc/glibc-2.3.2-r5.ebuild,v 1.2 2003/09/28 23:46:06 azarah Exp $ IUSE="nls pic build nptl" @@ -75,38 +75,6 @@ RDEPEND="virtual/os-headers PROVIDE="virtual/glibc" -# Convert a string type kernel version (2.4.0) to an int (132096) -# for easy compairing or versions ... -KV_to_int() { - [ -z "$1" ] && return 1 - - local KV="`echo $1 | \ - awk '{ tmp = $0; gsub(/^[0-9\.]*/, "", tmp); sub(tmp, ""); print }'`" - local KV_MAJOR="`echo "${KV}" | cut -d. -f1`" - local KV_MINOR="`echo "${KV}" | cut -d. -f2`" - local KV_MICRO="`echo "${KV}" | cut -d. -f3`" - local KV_int="$((KV_MAJOR * 65536 + KV_MINOR * 256 + KV_MICRO))" - - # We make version 2.2.0 the minimum version we will handle as - # a sanity check ... if its less, we fail ... - if [ "${KV_int}" -ge "131584" ] - then - echo "${KV_int}" - - return 0 - else - return 1 - fi -} - -get_KV() { - local KV="`uname -r`" - - echo "`KV_to_int ${KV}`" - - return $? -} - # Try to get a kernel source tree with version equal or greater # than $1. We basically just try a few default locations. The # version need to be that which KV_to_int() returns ... @@ -346,13 +314,6 @@ src_unpack() { # cd ${S}; epatch ${FILESDIR}/${PV}/${P}-fix-omitted-operand-in-mathinline_h.patch - if [ "${ARCH}" = "sparc" ] - then - # Fix sparc compile issues. - # <kumba@gentoo.org> - cd ${S}; epatch ${FILESDIR}/${PV}/${P}-cispeed-cospeed-fix.patch - fi - # A few patches only for the MIPS platform. Descriptions of what they # do can be found in the patch headers. # <tuxus@gentoo.org> thx <dragon@gentoo.org> (11 Jan 2003) @@ -360,12 +321,13 @@ src_unpack() { if [ "${ARCH}" = "mips" ] then cd ${S} - epatch ${FILESDIR}/2.3.1/${PN}-2.3.1-elf-machine-rela-mips.patch - epatch ${FILESDIR}/2.3.1/${PN}-2.3.1-exit-syscall-mips.patch epatch ${FILESDIR}/2.3.1/${PN}-2.3.1-fpu-cw-mips.patch - epatch ${FILESDIR}/2.3.1/${PN}-2.3.1-inline-syscall-mips.patch epatch ${FILESDIR}/2.3.1/${PN}-2.3.1-libgcc-compat-mips.patch epatch ${FILESDIR}/2.3.1/${PN}-2.3.1-librt-mips.patch + epatch ${FILESDIR}/2.3.2/${P}-mips-add-n32-n64-sysdep-cancel.patch + epatch ${FILESDIR}/2.3.2/${P}-mips-configure-for-n64-symver.patch + epatch ${FILESDIR}/2.3.2/${P}-mips-fix-n32-n64-sysdep-headers.patch + epatch ${FILESDIR}/2.3.2/${P}-mips-pread-linux2.5.patch fi if [ "${ARCH}" = "alpha" ] @@ -380,6 +342,20 @@ src_unpack() { then cd ${S}; epatch ${FILESDIR}/2.3.2/${P}-amd64-nomultilib.patch fi + + if [ "${ARCH}" = "ia64" ] + then + # The basically problem is glibc doesn't store information about + # what the kernel interface is so that it can't efficiently set up + # parameters for system calls. This patch from H.J. Lu fixes it: + # + # http://sources.redhat.com/ml/libc-alpha/2003-09/msg00165.html + # + cd ${S}; epatch ${FILESDIR}/2.3.2/${P}-ia64-LOAD_ARGS-fixup.patch + fi + + # Fix permissions on some of the scripts + chmod u+x ${S}/scripts/*.sh } setup_flags() { diff --git a/sys-libs/glibc/glibc-2.3.2-r6.ebuild b/sys-libs/glibc/glibc-2.3.2-r6.ebuild new file mode 100644 index 000000000000..397731b71db7 --- /dev/null +++ b/sys-libs/glibc/glibc-2.3.2-r6.ebuild @@ -0,0 +1,591 @@ +# Copyright 1999-2003 Gentoo Technologies, Inc. +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-libs/glibc/glibc-2.3.2-r6.ebuild,v 1.1 2003/09/28 23:46:06 azarah Exp $ + +IUSE="nls pic build nptl" + +inherit eutils flag-o-matic gcc + +filter-flags "-fomit-frame-pointer -malign-double" + +# Recently there has been a lot of stability problem in Gentoo-land. Many +# things can be the cause to this, but I believe that it is due to gcc3 +# still having issues with optimizations, or with it not filtering bad +# combinations (protecting the user maybe from himeself) yet. +# +# This can clearly be seen in large builds like glibc, where too aggressive +# CFLAGS cause the tests to fail miserbly. +# +# Quote from Nick Jones <carpaski@gentoo.org>, who in my opinion +# knows what he is talking about: +# +# People really shouldn't force code-specific options on... It's a +# bad idea. The -march options aren't just to look pretty. They enable +# options that are sensible (and include sse,mmx,3dnow when apropriate). +# +# The next command strips CFLAGS and CXXFLAGS from nearly all flags. If +# you do not like it, comment it, but do not bugreport if you run into +# problems. +# +# <azarah@gentoo.org> (13 Oct 2002) +strip-flags + +# Lock glibc at -O2 -- linuxthreads needs it and we want to be conservative here +export CFLAGS="${CFLAGS//-O?} -O2" +export CXXFLAGS="${CFLAGS}" + +NPTL_VER="0.60" + +BRANCH_UPDATE="20030927" + +# Minimum kernel version for --enable-kernel +export MIN_KV="2.4.1" +# Minimum kernel version for enabling TLS and NPTL ... +# NOTE: do not change this if you do not know what +# you are doing ! +export MIN_NPTL_KV="2.6.0" + +MY_PV="${PV/_}" +S="${WORKDIR}/${P%_*}" +DESCRIPTION="GNU libc6 (also called glibc2) C library" +SRC_URI="http://ftp.gnu.org/gnu/glibc/glibc-${MY_PV}.tar.bz2 + ftp://sources.redhat.com/pub/glibc/snapshots/glibc-${MY_PV}.tar.bz2 + http://ftp.gnu.org/gnu/glibc/glibc-linuxthreads-${MY_PV}.tar.bz2 + ftp://sources.redhat.com/pub/glibc/snapshots/glibc-linuxthreads-${MY_PV}.tar.bz2 + nptl? ( http://people.redhat.com/drepper/nptl/nptl-${NPTL_VER}.tar.bz2 ) + mirror://gentoo/${P}-branch-update-${BRANCH_UPDATE}.patch.bz2" +HOMEPAGE="http://www.gnu.org/software/libc/libc.html" + +KEYWORDS="-*" +# Is 99% compadible, just some .a's bork +SLOT="2.2" +LICENSE="LGPL-2" + +# We need new cleanup attribute support from gcc for NPTL among things ... +DEPEND=">=sys-devel/gcc-3.2.3-r1 + nptl? ( >=sys-devel/gcc-3.3.1-r1 ) + >=sys-devel/binutils-2.14.90.0.6-r1 + virtual/os-headers + nls? ( sys-devel/gettext )" + +RDEPEND="virtual/os-headers + sys-apps/baselayout + nls? ( sys-devel/gettext )" + +PROVIDE="virtual/glibc" + + +# Try to get a kernel source tree with version equal or greater +# than $1. We basically just try a few default locations. The +# version need to be that which KV_to_int() returns ... +get_KHV() { + local headers= + + [ -z "$1" ] && return 1 + + # - First check if linux-headers are installed (or symlink + # to current kernel ...) + # - Ok, do we have access to the current kernel's headers ? + # - Last option ... maybe its a weird bootstrap with /lib + # binded to the chroot ... + + # We do not really support more than 2 arguments ... + if [ -n "$2" ] + then + headers="$2" + else + # We try to find the current kernel's headers first, + # as we would rather build against linux 2.5 headers ... + headers="/lib/modules/`uname -r`/build/include \ + ${ROOT}/lib/modules/`uname -r`/build/include \ + /usr/src/linux/include \ + ${ROOT}/usr/src/linux/include \ + ${ROOT}/usr/include" + fi + + for x in ${headers} + do + local header="${x}/linux/version.h" + + if [ -f ${header} ] + then + + local version="`grep 'LINUX_VERSION_CODE' ${header} | \ + sed -e 's:^.*LINUX_VERSION_CODE[[:space:]]*::'`" + + if [ "${version}" -ge "$1" ] + then + echo "${x}" + + return 0 + fi + fi + done + + return 1 +} + +use_nptl() { + # Enable NPTL support if: + # - We have 'nptl' in USE + # - We have linux-2.5 or later kernel (should prob check for 2.4.20 ...) + if [ -n "`use nptl`" -a "`get_KV`" -ge "`KV_to_int ${MIN_NPTL_KV}`" ] + then + # Enable NPTL support if: + # - We have 'x86' in USE and: + # - a CHOST of "i486-pc-linux-gnu" + # - a CHOST of "i586-pc-linux-gnu" + # - a CHOST of "i686-pc-linux-gnu" + # - Or we have 'alpha' in USE + # - Or we have 'amd64' in USE + # - Or we have 'mips' in USE + # - Or we have 'ppc' in USE + case ${ARCH} in + "x86") + if [ "${CHOST/-*}" = "i486" -o \ + "${CHOST/-*}" = "i586" -o \ + "${CHOST/-*}" = "i686" ] + then + return 0 + fi + ;; + "alpha"|"amd64"|"mips"|"ppc") + return 0 + ;; + *) + return 1 + ;; + esac + fi + + return 1 +} + +pkg_setup() { + # We need gcc 3.2 or later ... + if [ "`gcc-major-version`" -ne "3" -o "`gcc-minor-version`" -lt "2" ] + then + echo + eerror "As of glibc-2.3, gcc-3.2 or later is needed" + eerror "for the build to succeed." + die "GCC too old" + fi + + echo + + if use_nptl + then + # The use_nptl should have already taken care of kernel version, + # arch and CHOST, so now just check if we can find suitable kernel + # source tree or headers .... + einfon "Checking for sufficient version kernel headers ... " + if ! get_KHV "`KV_to_int ${MIN_NPTL_KV}`" &> /dev/null + then + echo "no" + echo + eerror "Could not find a kernel source tree or headers with" + eerror "version ${MIN_NPTL_KV} or later! Please correct this" + eerror "and try again." + die "Insufficient kernel headers present!" + else + echo "yes" + fi + fi + + if [ "$(KV_to_int $(uname -r))" -gt "`KV_to_int '2.5.68'`" ] + then + local KERNEL_HEADERS="$(get_KHV "`KV_to_int ${MIN_NPTL_KV}`")" + + einfon "Checking kernel headers for broken sysctl.h ... " + if ! gcc -I"${KERNEL_HEADERS}" \ + -c ${FILESDIR}/test-sysctl_h.c -o ${T}/test1.o &> /dev/null + then + echo "yes" + echo + eerror "Your version of:" + echo + eerror " ${KERNEL_HEADERS}/linux/sysctl.h" + echo + eerror "is broken (from a user space perspective). Please apply" + eerror "the following patch:" + echo + eerror "*******************************************************" + cat ${FILESDIR}/fix-sysctl_h.patch + eerror "*******************************************************" + die "Broken linux/sysctl.h header included in kernel sources!" + else + echo "no" + fi + fi + + if use_nptl + then + einfon "Checking gcc for __thread support ... " + if ! gcc -c ${FILESDIR}/test-__thread.c -o ${T}/test2.o &> /dev/null + then + echo "no" + echo + eerror "Could not find a gcc that supports the __thread directive!" + eerror "please update to gcc-3.2.2-r1 or later, and try again." + die "No __thread support in gcc!" + else + echo "yes" + fi + + echo + + elif use nptl &> /dev/null + then + # Just tell the user not to expect too much ... + ewarn "You have \"nptl\" in your USE, but your kernel version or" + ewarn "architecture does not support it!" + fi +} + +src_unpack() { + + unpack glibc-${MY_PV}.tar.bz2 + + # Extract pre-made man pages. Otherwise we need perl, which is a no-no. + mkdir -p ${S}/man; cd ${S}/man + use_nptl || tar xjf ${FILESDIR}/glibc-manpages-${MY_PV}.tar.bz2 + + cd ${S} + # Extract our threads package ... + if use_nptl + then + unpack nptl-${NPTL_VER}.tar.bz2 + + elif [ -z "${BRANCH_UPDATE}" ] + then + # The branch update have this already included ... + unpack glibc-linuxthreads-${MY_PV}.tar.bz2 + fi + + if [ -n "${BRANCH_UPDATE}" ] + then + epatch ${DISTDIR}/${P}-branch-update-${BRANCH_UPDATE}.patch.bz2 + fi + + if use_nptl + then + epatch ${FILESDIR}/2.3.2/${P}-redhat-nptl-fixes.patch + else + epatch ${FILESDIR}/2.3.2/${P}-redhat-linuxthreads-fixes.patch + fi + + # This next patch fixes a test that will timeout due to ReiserFS' slow handling of sparse files +# cd ${S}/io; epatch ${FILESDIR}/glibc-2.2.2-test-lfs-timeout.patch + + # This add back glibc 2.2 compadibility. See bug #8766 and #9586 for more info, + # and also: + # + # http://lists.debian.org/debian-glibc/2002/debian-glibc-200210/msg00093.html + # + # We should think about remoing it in the future after things have settled. + # + # Thanks to Jan Gutter <jangutter@tuks.co.za> for reporting it. + # + # <azarah@gentoo.org> (26 Oct 2002). + cd ${S}; epatch ${FILESDIR}/2.3.1/${PN}-2.3.1-ctype-compat-v3.patch + + # One more compat issue which breaks sun-jdk-1.3.1. See bug #8766 for more + # info, and also: + # + # http://sources.redhat.com/ml/libc-alpha/2002-04/msg00143.html + # + # Thanks to Jan Gutter <jangutter@tuks.co.za> for reporting it. + # + # <azarah@gentoo.org> (30 Oct 2002). + cd ${S}; epatch ${FILESDIR}/2.3.1/${PN}-2.3.1-libc_wait-compat.patch + + # One more compat issue ... libc_stack_end is missing from ld.so. + # Got this one from diffing redhat glibc tarball .. would help if + # they used patches and not modified tarball ... + # + # <azarah@gentoo.org> (7 Nov 2002). +# cd ${S}; epatch ${FILESDIR}/2.3.1/${PN}-2.3.1-stack_end-compat.patch + + # The mathinline.h header omits the middle term of a ?: expression. This + # is a gcc extension, but since the ISO standard forbids it, it's a + # GLIBC bug (bug #27142). See also: + # + # http://bugs.gentoo.org/show_bug.cgi?id=27142 + # + cd ${S}; epatch ${FILESDIR}/${PV}/${P}-fix-omitted-operand-in-mathinline_h.patch + + # A few patches only for the MIPS platform. Descriptions of what they + # do can be found in the patch headers. + # <tuxus@gentoo.org> thx <dragon@gentoo.org> (11 Jan 2003) + # <kumba@gentoo.org> remove tst-rndseek-mips & ulps-mips patches + if [ "${ARCH}" = "mips" ] + then + cd ${S} + epatch ${FILESDIR}/2.3.1/${PN}-2.3.1-fpu-cw-mips.patch + epatch ${FILESDIR}/2.3.1/${PN}-2.3.1-libgcc-compat-mips.patch + epatch ${FILESDIR}/2.3.1/${PN}-2.3.1-librt-mips.patch + epatch ${FILESDIR}/2.3.2/${P}-mips-add-n32-n64-sysdep-cancel.patch + epatch ${FILESDIR}/2.3.2/${P}-mips-configure-for-n64-symver.patch + epatch ${FILESDIR}/2.3.2/${P}-mips-fix-n32-n64-sysdep-headers.patch + epatch ${FILESDIR}/2.3.2/${P}-mips-pread-linux2.5.patch + fi + + if [ "${ARCH}" = "alpha" ] + then + # Fix compatability with compaq compilers by ifdef'ing out some + # 2.3.2 additions. + # <taviso@gentoo.org> (14 Jun 2003). + cd ${S}; epatch ${FILESDIR}/2.3.2/${P}-decc-compaq.patch + fi + + if [ "${ARCH}" = "amd64" ] + then + cd ${S}; epatch ${FILESDIR}/2.3.2/${P}-amd64-nomultilib.patch + fi + + if [ "${ARCH}" = "ia64" ] + then + # The basically problem is glibc doesn't store information about + # what the kernel interface is so that it can't efficiently set up + # parameters for system calls. This patch from H.J. Lu fixes it: + # + # http://sources.redhat.com/ml/libc-alpha/2003-09/msg00165.html + # + cd ${S}; epatch ${FILESDIR}/2.3.2/${P}-ia64-LOAD_ARGS-fixup.patch + fi + + # Fix permissions on some of the scripts + chmod u+x ${S}/scripts/*.sh +} + +setup_flags() { + # -freorder-blocks for all but ia64 s390 s390x + use ppc || append-flags "-freorder-blocks" + + # Sparc/Sparc64 support + if [ -n "`use sparc`" ] + then + + # Both sparc and sparc64 can use -fcall-used-g6. -g7 is bad, though. + replace-flags "-fcall-used-g7" "" + append-flags "-fcall-used-g6" + + # Sparc64 Only support... + if [ "${PROFILE_ARCH}" = "sparc64" ] + then + + # Get rid of -mcpu options, the CHOST will fix this up + replace-flags "-mcpu=ultrasparc" "" + replace-flags "-mcpu=v9" "" + + # Get rid of flags known to fail + replace-flags "-mvis" "" + + # Setup the CHOST properly to insure "sparcv9" + # This passes -mcpu=ultrasparc -Wa,-Av9a to the compiler + export CHOST="${CHOST/sparc/sparcv9}" + fi + fi +} + +src_compile() { + local myconf= + local myconf_nptl= + + setup_flags + + # These should not be set, else the + # zoneinfo do not always get installed ... + unset LANGUAGE LANG LC_ALL + + use nls || myconf="${myconf} --disable-nls" + + if use_nptl + then + local kernelheaders="$(get_KHV "`KV_to_int ${MIN_NPTL_KV}`")" + + # NTPL and Thread Local Storage support. + myconf="${myconf} --with-tls --with-__thread \ + --enable-add-ons=nptl \ + --enable-kernel=${MIN_NPTL_KV} \ + --with-headers=${kernelheaders}" + else + myconf="${myconf} --without-tls --without-__thread \ + --enable-add-ons=linuxthreads" + + # If we build for the build system we use the kernel headers from the target + # We also now set it without "build" as well, else it might use the + # current kernel's headers, which might just fail (the linux-headers + # package is usually well tested...) +# ( use build || use sparc ) \ +# && myconf="${myconf} --with-headers=${ROOT}usr/include" + myconf="${myconf} --with-headers=${ROOT}usr/include" + + # If kernel version and headers in ${ROOT}/usr/include are ok, + # then enable --enable-kernel=${MIN_KV} ... + if [ "`get_KV`" -ge "`KV_to_int ${MIN_KV}`" -a \ + -n "$(get_KHV "`KV_to_int ${MIN_KV}`" "${ROOT}/usr/include")" ] + then + myconf="${myconf} --enable-kernel=${MIN_KV}" + else + myconf="${myconf} --enable-kernel=2.2.5" + fi + fi + + einfo "Configuring GLIBC..." + rm -rf ${S}/buildhere + mkdir -p ${S}/buildhere + cd ${S}/buildhere + ../configure --build=${CHOST} \ + --host=${CHOST} \ + --with-gd=no \ + --without-cvs \ + --disable-profile \ + --prefix=/usr \ + --mandir=/usr/share/man \ + --infodir=/usr/share/info \ + --libexecdir=/usr/lib/misc \ + ${myconf} || die + + einfo "Building GLIBC..." + cd ${S}/buildhere + make PARALLELMFLAGS="${MAKEOPTS}" || die +# einfo "Doing GLIBC checks..." +# make check +} + +src_install() { + local buildtarget="buildhere" + + setup_flags + + # These should not be set, else the + # zoneinfo do not always get installed ... + unset LANGUAGE LANG LC_ALL + + einfo "Installing GLIBC..." + make PARALLELMFLAGS="${MAKEOPTS}" \ + install_root=${D} \ + install -C ${buildtarget} || die + + # If librt.so is a symlink, change it into linker script (Redhat) + if [ -L "${D}/usr/lib/librt.so" -a "${LIBRT_LINKERSCRIPT}" = "yes" ] + then + local LIBRTSO="`cd ${D}/lib; echo librt.so.*`" + local LIBPTHREADSO="`cd ${D}/lib; echo libpthread.so.*`" + + rm -f ${D}/usr/lib/librt.so + cat > ${D}/usr/lib/librt.so <<EOF +/* GNU ld script + librt.so.1 needs libpthread.so.0 to come before libc.so.6* + in search scope. */ +EOF + grep "OUTPUT_FORMAT" ${D}/usr/lib/libc.so >> ${D}/usr/lib/librt.so + echo "GROUP ( /lib/${LIBPTHREADSO} /lib/${LIBRTSO} )" \ + >> ${D}/usr/lib/librt.so + + for x in ${D}/usr/lib/librt.so.[1-9] + do + [ -L "${x}" ] && rm -f ${x} + done + fi + + if [ -z "`use build`" ] + then + einfo "Installing Info pages..." + make PARALLELMFLAGS="${MAKEOPTS}" \ + install_root=${D} \ + info -C ${buildtarget} || die + + einfo "Installing Locale data..." + make PARALLELMFLAGS="${MAKEOPTS}" \ + install_root=${D} \ + localedata/install-locales -C ${buildtarget} || die + + # Compatibility hack: this locale has vanished from glibc, + # but some other programs are still using it. + keepdir /usr/lib/locale/ru_RU/LC_MESSAGES + + einfo "Installing man pages and docs..." + # Install linuxthreads man pages + use_nptl || { + dodir /usr/share/man/man3 + doman ${S}/man/*.3thr + } + + # Install nscd config file + insinto /etc + doins ${FILESDIR}/nscd.conf + + dodoc BUGS ChangeLog* CONFORMANCE COPYING* FAQ INTERFACE \ + NEWS NOTES PROJECTS README* + else + rm -rf ${D}/usr/share ${D}/usr/lib/gconv + + einfo "Installing Timezone data..." + make PARALLELMFLAGS="${MAKEOPTS}" \ + install_root=${D} \ + timezone/install-others -C ${buildtarget} || die + fi + + if [ "`use pic`" ] + then + find ${S}/${buildtarget}/ -name "soinit.os" -exec cp {} ${D}/lib/soinit.o \; + find ${S}/${buildtarget}/ -name "sofini.os" -exec cp {} ${D}/lib/sofini.o \; + find ${S}/${buildtarget}/ -name "*_pic.a" -exec cp {} ${D}/lib \; + find ${S}/${buildtarget}/ -name "*.map" -exec cp {} ${D}/lib \; + for i in ${D}/lib/*.map + do + mv ${i} ${i%.map}_pic.map + done + fi + + # Is this next line actually needed or does the makefile get it right? + # It previously has 0755 perms which was killing things. + fperms 4755 /usr/lib/misc/pt_chown + + # Currently libraries in /usr/lib/gconv do not get loaded if not + # in search path ... +# insinto /etc/env.d +# doins ${FILESDIR}/03glibc + + rm -f ${D}/etc/ld.so.cache + + # Prevent overwriting of the /etc/localtime symlink. We'll handle the + # creation of the "factory" symlink in pkg_postinst(). + rm -f ${D}/etc/localtime + + # Some things want this, notably ash. + dosym /usr/lib/libbsd-compat.a /usr/lib/libbsd.a +} + +pkg_postinst() { + # Correct me if I am wrong here, but my /etc/localtime is a file + # created by zic .... + # I am thinking that it should only be recreated if no /etc/localtime + # exists, or if it is an invalid symlink. + # + # For invalid symlink: + # -f && -e will fail + # -L will succeed + # + if [ ! -e ${ROOT}/etc/localtime ] + then + echo "Please remember to set your timezone using the zic command." + rm -f ${ROOT}/etc/localtime + ln -s ../usr/share/zoneinfo/Factory ${ROOT}/etc/localtime + fi + + if [ -x ${ROOT}/usr/sbin/iconvconfig ] + then + # Generate fastloading iconv module configuration file. + ${ROOT}/usr/sbin/iconvconfig --prefix=${ROOT} + fi + + # Reload init ... + if [ "${ROOT}" = "/" ] + then + /sbin/init U &> /dev/null + fi +} + |