⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 glibc-2.3.2-mips-user.patch

📁 linux下编译交叉工具链的工具源码
💻 PATCH
📖 第 1 页 / 共 2 页
字号:
Retrieved fromhttp://sources.redhat.com/cgi-bin/get-raw-msg?listname=libc-alpha&date=2003-04&msgid=orfzoof4j0.fsf%40free.redhat.lsd.ic.unicamp.brpaths adjusted, and rediffed against glibc-2.3.2(i.e. to compensate for fact thathttp://sources.redhat.com/ml/glibc-cvs/2003-q1/msg01155.htmlis not present)Should fixIn file included from ../sysdeps/unix/sysv/linux/mips/sys/procfs.h:29,                 from ../linuxthreads_db/proc_service.h:20,                 from ../linuxthreads_db/thread_dbP.h:7,                 from ../linuxthreads/descr.h:43,                 from ../linuxthreads/internals.h:29,                 from ../linuxthreads/sysdeps/pthread/bits/libc-lock.h:27,                 from ../sysdeps/generic/ldsodefs.h:38,                 from ../sysdeps/unix/sysv/linux/ldsodefs.h:25,                 from ../sysdeps/mips/elf/ldsodefs.h:25,                 from ../sysdeps/unix/sysv/linux/init-first.c:30:../sysdeps/unix/sysv/linux/mips/sys/user.h:26:21: asm/reg.h: No such file or directoryIn file included from ../sysdeps/unix/sysv/linux/mips/sys/procfs.h:29,                 from ../linuxthreads_db/proc_service.h:20,                 from ../linuxthreads_db/thread_dbP.h:7,                 from ../linuxthreads/descr.h:43,                 from ../linuxthreads/internals.h:29,                 from ../linuxthreads/sysdeps/pthread/bits/libc-lock.h:27,                 from ../sysdeps/generic/ldsodefs.h:38,                 from ../sysdeps/unix/sysv/linux/ldsodefs.h:25,                 from ../sysdeps/mips/elf/ldsodefs.h:25,                 from ../sysdeps/unix/sysv/linux/init-first.c:30:../sysdeps/unix/sysv/linux/mips/sys/user.h:30: error: `EF_SIZE' undeclared here (not in a function)make[2]: *** [mipsel-unknown-linux-gnu/gcc-3.4.0-glibc-2.3.2/build-glibc/csu/init-first.o] Error 1make[2]: Leaving directory `mipsel-unknown-linux-gnu/gcc-3.4.0-glibc-2.3.2/glibc-2.3.2/csu'make[1]: *** [csu/subdir_lib] Error 2make[1]: Leaving directory `mipsel-unknown-linux-gnu/gcc-3.4.0-glibc-2.3.2/glibc-2.3.2'make: *** [all] Error 2From libc-alpha-return-12105-listarch-libc-alpha=sources dot redhat dot com at sources dot redhat dot com Sat Apr 12 09:28:56 2003Return-Path: <libc-alpha-return-12105-listarch-libc-alpha=sources dot redhat dot com at sources dot redhat dot com>Delivered-To: listarch-libc-alpha at sources dot redhat dot comReceived: (qmail 2802 invoked by alias); 12 Apr 2003 09:28:56 -0000Mailing-List: contact libc-alpha-help at sources dot redhat dot com; run by ezmlmPrecedence: bulkList-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 comDelivered-To: mailing list libc-alpha at sources dot redhat dot comReceived: (qmail 2795 invoked from network); 12 Apr 2003 09:28:55 -0000Received: from unknown (HELO lacrosse.corp.redhat.com) (66.187.233.200)  by sources dot redhat dot com with SMTP; 12 Apr 2003 09:28:55 -0000Received: from free.redhat.lsd.ic.unicamp.br (aoliva.cipe.redhat.com [10.0.1.10])	by lacrosse dot corp dot redhat dot com (8 dot 11 dot 6/8 dot 9 dot 3) with ESMTP id h3C9SqV01131	for <libc-alpha at sources dot redhat dot com>; Sat, 12 Apr 2003 05:28:52 -0400Received: from free.redhat.lsd.ic.unicamp.br (free.redhat.lsd.ic.unicamp.br [127.0.0.1])	by free dot redhat dot lsd dot ic dot unicamp dot br (8 dot 12 dot 8/8 dot 12 dot 8) with ESMTP id h3C9SpVT028734	for <libc-alpha at sources dot redhat dot com>; Sat, 12 Apr 2003 06:28:51 -0300Received: (from aoliva@localhost)	by free dot redhat dot lsd dot ic dot unicamp dot br (8 dot 12 dot 8/8 dot 12 dot 8/Submit) id h3C9SpFb028730;	Sat, 12 Apr 2003 06:28:51 -0300To: libc-alpha at sources dot redhat dot comSubject: signal-handling tweaks for mips/mips64From: Alexandre Oliva <aoliva at redhat dot com>Organization: GCC Team, Red HatDate: 12 Apr 2003 06:28:51 -0300Message-ID: <orfzoof4j0.fsf@free.redhat.lsd.ic.unicamp.br>Lines: 49User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2MIME-Version: 1.0Content-Type: multipart/mixed; boundary="=-=-="--=-=-=It was reported to me that ucontext is utterly broken, even in o32with a stable 32-bit mips kernel.  Indeed, it doesn't match theucontext structure defined by the kernel at all.  This means thatprograms taking real-time signals in o32 won't be able to extractcorrect information from the mcontext_t, since the kernel puts data inthere that's in an entirely different format.I've looked for any ways in which the current data structures couldpossibly be useful, and didn't find any.  gdb and rda thought theywere using the register arrays, but it turned out they were using thearrays in procps instead.  makecontext(), [sg]etcontext() et al aren'timplemented on mips, so any uses thereof will just return ENOSYS,without messing with the given data structure.  So, I believe it isnot too late for us to fix it such that it matches the kernel datastructures.While at that, I fixed a number of incompatibilities introduced byeither differences between kernel headers that we used to include,whose contents are different depending on whether asm points toasm-mips or asm-mips64.With this patch, after some pending kernel patches are checked in, onewill be able to obtain the correct information from signal handlers inall mips ABIs.  With n64, this is already true.  With o32, it workswith the 32-bit mips kernel, but the mips64 kernel needs a patch toimplement the proper sigcontext ABI.  n32 still a patch to bedeveloped for it to be possible for ucontext to be POSIX-compliant.Currently, the kernel uses the same ucontext for n32 and n64, but thisdoesn't work in n32 because uc_link must be a pointer and stack_t mustcontain a pointer and a size_t, whose sizes differ between n32 andn64.  I believe Ralf is working on a patch for the kernel to generaten32-compliant ucontext when invoking signal handlers in n32 processes.The only uncertainty is whether uc_flags will be a 32- or 64-bit valuein n32; I left it as the latter, just because I already had that inplace; if it changes, a (simplifying) follow-up patch will be posted.However, I wanted to circulate the idea of fixing ucontext_t for o32as soon as possible, so I didn't wait for a decision on the exact n32ABI.Ok to install?--=-=-=Content-Type: text/x-patchContent-Disposition: inline; filename=mips-sigstuff.patchIndex: ChangeLogfrom  Alexandre Oliva  <aoliva@redhat.com>	* sysdeps/unix/sysv/linux/mips/profil-counter: New.	* sysdeps/unix/sysv/linux/mips/sigcontextinfo.h: Port to n32/n64.	* sysdeps/unix/sysv/linux/mips/bits/sigcontext.h: New.	* sysdeps/unix/sysv/linux/mips/sys/ucontext.h: Port to n32/n64.	(mcontext_t): Make it match the 32-bit mips kernel in o32.	* sysdeps/unix/sysv/linux/mips/sys/user.h: Bring in constants from	the mips and mips64 headers.	(struct user): Port to n32/n64.Index: sysdeps/unix/sysv/linux/mips/profil-counter.h===================================================================RCS file: sysdeps/unix/sysv/linux/mips/profil-counter.hdiff -N sysdeps/unix/sysv/linux/mips/profil-counter.h--- /dev/null	1 Jan 1970 00:00:00 -0000+++ libc/sysdeps/unix/sysv/linux/mips/profil-counter.h 12 Apr 2003 09:13:13 -0000@@ -0,0 +1,2 @@+/* We can use the ix86 version.  */+#include <sysdeps/unix/sysv/linux/i386/profil-counter.h>Index: sysdeps/unix/sysv/linux/mips/sigcontextinfo.h===================================================================RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/mips/sigcontextinfo.h,vretrieving revision 1.6diff -u -p -r1.6 sigcontextinfo.h--- libc/sysdeps/unix/sysv/linux/mips/sigcontextinfo.h 6 Jul 2001 04:56:18 -0000 1.6+++ libc/sysdeps/unix/sysv/linux/mips/sigcontextinfo.h 12 Apr 2003 09:13:13 -0000@@ -1,4 +1,4 @@-/* Copyright (C) 2000, 2001 Free Software Foundation, Inc.+/* Copyright (C) 2000, 2001, 2003 Free Software Foundation, Inc.    This file is part of the GNU C Library.    Contributed by Andreas Jaeger <aj@suse.de>, 2000. @@ -18,6 +18,8 @@    02111-1307 USA.  */  +#if _MIPS_SIM == _MIPS_SIM_ABI32+ #define SIGCONTEXT unsigned long _code, struct sigcontext * #define SIGCONTEXT_EXTRA_ARGS _code, #define GET_PC(ctx)	((void *) ctx->sc_pc)@@ -25,3 +27,15 @@ #define GET_STACK(ctx)	((void *) ctx->sc_regs[29]) #define CALL_SIGHANDLER(handler, signo, ctx) \   (handler)((signo), SIGCONTEXT_EXTRA_ARGS (ctx))++#else++#define SIGCONTEXT unsigned long _code, ucontext_t *+#define SIGCONTEXT_EXTRA_ARGS _code,+#define GET_PC(ctx)	((void *) ctx->uc_mcontext.pc)+#define GET_FRAME(ctx)	((void *) ctx->uc_mcontext.gregs[30])+#define GET_STACK(ctx)	((void *) ctx->uc_mcontext.gregs[29])+#define CALL_SIGHANDLER(handler, signo, ctx) \+  (handler)((signo), SIGCONTEXT_EXTRA_ARGS (ctx))++#endifIndex: sysdeps/unix/sysv/linux/mips/bits/sigcontext.h===================================================================RCS file: sysdeps/unix/sysv/linux/mips/bits/sigcontext.hdiff -N sysdeps/unix/sysv/linux/mips/bits/sigcontext.h--- /dev/null	1 Jan 1970 00:00:00 -0000+++ libc/sysdeps/unix/sysv/linux/mips/bits/sigcontext.h 12 Apr 2003 09:13:13 -0000@@ -0,0 +1,103 @@+/* Copyright (C) 1996, 1997, 1998, 2003 Free Software Foundation, Inc.+   This file is part of the GNU C Library.++   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.  */++#if !defined _SIGNAL_H && !defined _SYS_UCONTEXT_H+# error "Never use <bits/sigcontext.h> directly; include <signal.h> instead."+#endif++#ifndef sigcontext_struct+/* Kernel headers before 2.1.1 define a struct sigcontext_struct, but+   we need sigcontext.  */+# define sigcontext_struct sigcontext++/* # include <asm/sigcontext.h> */+/* Instead of including the kernel header, that will vary depending on+   whether the 32- or the 64-bit kernel is installed, we paste the+   contents here.  In case you're wondering about the different+   licenses, the fact that the file is pasted, instead of included,+   doesn't really make any difference for the program that includes+   this header.  */+#if _MIPS_SIM == _MIPS_SIM_ABI32+/*+ * This file is subject to the terms and conditions of the GNU General Public+ * License.  See the file "COPYING" in the main directory of this archive+ * for more details.+ *+ * Copyright (C) 1996, 1997, 2000 by Ralf Baechle+ */+#ifndef _ASM_SIGCONTEXT_H+#define _ASM_SIGCONTEXT_H++/*+ * Keep this struct definition in sync with the sigcontext fragment+ * in arch/mips/tools/offset.c+ */+struct sigcontext {+	unsigned int       sc_regmask;		/* Unused */+	unsigned int       sc_status;+	unsigned long long sc_pc;+	unsigned long long sc_regs[32];+	unsigned long long sc_fpregs[32];+	unsigned int       sc_ownedfp;		/* Unused */+	unsigned int       sc_fpc_csr;+	unsigned int       sc_fpc_eir;		/* Unused */+	unsigned int       sc_used_math;+	unsigned int       sc_ssflags;		/* Unused */+	unsigned long long sc_mdhi;+	unsigned long long sc_mdlo;++	unsigned int       sc_cause;		/* Unused */+	unsigned int       sc_badvaddr;		/* Unused */++	unsigned long      sc_sigset[4];	/* kernel's sigset_t */+};++#endif /* _ASM_SIGCONTEXT_H */+#else /* _MIPS_SIM != _MIPS_SIM_ABI32 */+/*+ * This file is subject to the terms and conditions of the GNU General Public+ * License.  See the file "COPYING" in the main directory of this archive+ * for more details.+ *+ * Copyright (C) 1996, 1997, 1999 by Ralf Baechle+ * Copyright (C) 1999 Silicon Graphics, Inc.+ */+#ifndef _ASM_SIGCONTEXT_H+#define _ASM_SIGCONTEXT_H++/*+ * Keep this struct definition in sync with the sigcontext fragment+ * in arch/mips/tools/offset.c+ */+struct sigcontext {+	unsigned long long sc_regs[32];+	unsigned long long sc_fpregs[32];+	unsigned long long sc_mdhi;+	unsigned long long sc_mdlo;+	unsigned long long sc_pc;+	unsigned int       sc_status;+	unsigned int       sc_fpc_csr;+	unsigned int       sc_fpc_eir;+	unsigned int       sc_used_math;+	unsigned int       sc_cause;+	unsigned int       sc_badvaddr;+};++#endif /* _ASM_SIGCONTEXT_H */+#endif /* _MIPS_SIM != _MIPS_SIM_ABI32 */+#endif[hunk deleted, see below]Index: sysdeps/unix/sysv/linux/mips/sys/user.h===================================================================RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/mips/sys/user.h,vretrieving revision 1.1diff -u -p -r1.1 user.h

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -