glibc-2.1.3, asm/elf.h and PPC kernels with AltiVec support
Franz Sirl
Franz.Sirl-kernel@lauterbach.com
Thu Feb 3 13:36:00 GMT 2000
Am Don, 03 Feb 2000 schrieb Franz Sirl:
>Hi,
>
>current glibc-2-1-branch breaks on the latest 2.2 kernels containing
>AltiVec support:
>
>make[2]: Entering directory
>'/usr/src/redhat/BUILD/glibc-2.1/linuxthreads'
>In file included from
>../sysdeps/unix/sysv/linux/powerpc/sys/procfs.h:31,
> from ../linuxthreads_db/proc_service.h:20,
> from ../linuxthreads_db/thread_dbP.h:6,
> from internals.h:30
> from attr.c:22:
>/usr/include/asm/elf.h:43: parse error before 'elf_vrreg_t'
>/usr/include/asm/elf.h:43: warning: data definition has no type or
>storage class
>/usr/include/asm/elf.h:44: parse error before 'elf_vrregset_t'
>/usr/include/asm/elf.h:44: warning: data definition has no type or
>storage class
>make[2]: ***
>[/usr/src/redhat/BUILD/glibc-2.1/build-ppc-linux/linuxthreads/attr.o]
>Error 1
>
>I think the correct fix would be a separate sys/elf.h for PPC, like what
>x86 and arm already do.
>
>If there are no objections, I'll put together such a file and post it later
>today with the corresponding changes to other files.
OK, here's the patch. glibc-2-1-branch + this patch did build without
problems for me. Andreas, would you mind checking it on your system too?
Franz.
* sysdeps/unix/sysv/linux/powerpc/Dist: Add sys/elf.h.
* sysdeps/unix/sysv/linux/powerpc/Makefile (sysdep_headers): Add
sys/elf.h.
* sysdeps/unix/sysv/linux/powerpc/sys/procfs.h: Include sys/elf.h.
* sysdeps/unix/sysv/linux/powerpc/sys/elf.h: New file.
Index: sysdeps/unix/sysv/linux/powerpc/Dist
===================================================================
RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/powerpc/Dist,v
retrieving revision 1.9
diff -u -p -r1.9 Dist
--- Dist 1998/12/14 09:11:23 1.9
+++ sysdeps/unix/sysv/linux/powerpc/Dist 2000/02/03 21:07:00
@@ -2,5 +2,6 @@ clone.S
kernel_stat.h
kernel_termios.h
init-first.h
+sys/elf.h
sys/procfs.h
sys/user.h
Index: sysdeps/unix/sysv/linux/powerpc/sys/procfs.h
===================================================================
RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/powerpc/sys/procfs.h,v
retrieving revision 1.1.2.3
diff -u -p -r1.1.2.3 procfs.h
--- procfs.h 1999/11/14 08:12:58 1.1.2.3
+++ sysdeps/unix/sysv/linux/powerpc/sys/procfs.h 2000/02/03 21:07:00
@@ -28,7 +28,7 @@
#include <sys/time.h>
#include <sys/types.h>
#include <sys/user.h>
-#include <asm/elf.h>
+#include <sys/elf.h>
__BEGIN_DECLS
Index: sysdeps/unix/sysv/linux/powerpc/sys/elf.h
===================================================================
RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/powerpc/sys/elf.h,v
diff -u -p elf.h
--- /dev/null Tue May 5 13:32:27 1998
+++ sysdeps/unix/sysv/linux/powerpc/sys/elf.h Thu Feb 3 13:08:59 2000
@@ -0,0 +1,42 @@
+/* Copyright (C) 2000 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 Library General Public License as
+ published by the Free Software Foundation; either version 2 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
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#ifndef _SYS_ELF_H
+#define _SYS_ELF_H 1
+
+#include <sys/user.h>
+
+#define ELF_NGREG 48 /* includes nip, msr, lr, etc. */
+#define ELF_NFPREG 33 /* includes fpscr */
+#define ELF_NVRREG 33 /* includes vscr */
+
+typedef unsigned long elf_greg_t;
+typedef elf_greg_t elf_gregset_t[ELF_NGREG];
+
+typedef double elf_fpreg_t;
+typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];
+
+typedef struct {
+ unsigned long u[4];
+} __attribute((aligned(16))) vector128;
+
+/* Altivec registers */
+typedef vector128 elf_vrreg_t;
+typedef elf_vrreg_t elf_vrregset_t[ELF_NVRREG];
+
+#endif /* sys/elf.h */
Index: sysdeps/unix/sysv/linux/powerpc/Makefile
===================================================================
RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/powerpc/Makefile,v
retrieving revision 1.1
diff -u -p -r1.1 Makefile
--- Makefile 1998/10/21 15:39:49 1.1
+++ sysdeps/unix/sysv/linux/powerpc/Makefile 2000/02/03 21:30:08
@@ -1,3 +1,7 @@
+ifeq ($(subdir),misc)
+sysdep_headers += sys/elf.h
+endif
+
ifeq ($(subdir),signal)
sysdep_routines += rt_sigsuspend rt_sigprocmask rt_sigtimedwait \
rt_sigqueueinfo rt_sigaction rt_sigpending
More information about the Libc-alpha
mailing list