[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Alpha architecute optimized packages



Hi,

I've written a patch which will allow architecture-specific packages
for Alpha. The dynamic linker will look for libraries in lib/ARCH,
where ARCH is provided by the kernel and is one of ev4 (base, no extra
features), ev5, ev56, ev6, and ev67[1]. All those are strict supersets
of their predecessors. I'm not sure it makes sense to have packages
for all of them, but rather only ev56 and ev67. So that people on ev6
could profit from the ev56 packages, one would have to install some
symlinks. What would be a good way to do this? Include it in the
package? Have a postinst script?

-- 
	Falk

[1] older kernels distinguished only ev4 and ev5, see
http://linux.bkbits.net:8080/linux-2.5/diffs/include/asm-alpha/elf.h@1.7?nav=index.html|src/|src/include|src/include/asm-alpha|hist/include/asm-alpha/elf.h

Index: sysdeps/alpha.mk
===================================================================
RCS file: /cvs/glibc/glibc-package/debian/sysdeps/alpha.mk,v
retrieving revision 1.2
diff -u -p -r1.2 alpha.mk
--- sysdeps/alpha.mk	28 Oct 2003 22:56:56 -0000	1.2
+++ sysdeps/alpha.mk	14 Mar 2004 14:08:02 -0000
@@ -1 +1,11 @@
 libc = libc6.1
+
+GLIBC_PASSES += alphaev67
+DEB_ARCH_REGULAR_PACKAGES += libc6.1-alphaev67
+
+alphaev67_MIN_KERNEL_SUPPORTED = 2.2.0
+alphaev67_configure_target=alphaev67-linux
+alphaev67_extra_cflags = -g1 -O3 -fomit-frame-pointer -D__USE_STRING_INLINES
+alphaev67_extra_config_options = $(extra_config_options) --disable-profile
+alphaev67_add-ons = linuxthreads $(add-ons)
+alphaev67_LIBDIR = /ev67
Index: control.in/opt
===================================================================
RCS file: /cvs/glibc/glibc-package/debian/control.in/opt,v
retrieving revision 1.6
diff -u -p -r1.6 opt
--- control.in/opt	3 Feb 2004 23:35:44 -0000	1.6
+++ control.in/opt	14 Mar 2004 14:08:02 -0000
@@ -28,7 +28,7 @@ Description: GNU C Library: Shared libra
  .
  This set of libraries is optimized for the UltraSPARC v9b ABI. It only
  needs to be installed on UltraSPARC machines. If you install this on a
- non-UltraSPARC, it wont even be used.
+ non-UltraSPARC, it won't even be used.
  .
  WARNING: Some commercial programs do not work well with these libraries.
  Most notably, IBM's JDK. If you experience problems with such
@@ -56,4 +56,18 @@ Description: GNU C Library: Shared libra
  WARNING: Some commercial programs may not work well with these libraries.
  Most notably, IBM's JDK. If you experience problems with such
  applications, you will need to remove this package.
+
+Package: libc6.1-alphaev67
+Architecture: alpha
+Section: libs
+Priority: extra
+Pre-Depends: @libc@ (= ${Source-Version})
+Description: GNU C Library: Shared libraries (EV67 optimized)
+ Contains the standard libraries that are used by nearly all programs on
+ the system. This package includes shared versions of the standard C
+ library and the standard math library, as well as many others.
+ .
+ This set of libraries is optimized for the Alpha EV67. It only
+ needs to be installed on Alpha EV67/68 and EV7 machines. If you install
+ this on an older machine, it won't even be used.
 
Index: patches/alpha-dl-procinfo.dpatch
===================================================================
RCS file: patches/alpha-dl-procinfo.dpatch
diff -N patches/alpha-dl-procinfo.dpatch
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ patches/alpha-dl-procinfo.dpatch	14 Mar 2004 14:08:02 -0000
@@ -0,0 +1,160 @@
+#! /bin/sh -e
+
+# All lines beginning with `# DP:' are a description of the patch.
+# DP: Description: Hardware platforms for Alpha
+# DP: Author: Falk Hueffner <falk@debian.org>
+
+if [ $# -ne 2 ]; then
+    echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+    exit 1
+fi
+case "$1" in
+    -patch) patch -d "$2" -f --no-backup-if-mismatch -p0 < $0;;
+    -unpatch) patch -d "$2" -f --no-backup-if-mismatch -R -p0 < $0;;
+    *)
+	echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+	exit 1
+esac
+exit 0
+
+# append the patch here and adjust the -p? flag in the patch calls.
+Index: sysdeps/alpha/dl-procinfo.c
+===================================================================
+RCS file: sysdeps/unix/sysv/linux/alpha/dl-procinfo.c
+diff -N sysdeps/alpha/dl-procinfo.c
+--- /dev/null	1 Jan 1970 00:00:00 -0000
++++ sysdeps/unix/sysv/linux/alpha/dl-procinfo.c	13 Mar 2004 13:41:47 -0000
+@@ -0,0 +1,64 @@
++/* Data for Alpha version of processor capability information.
++   Copyright (C) 2001,2002,2003,2004 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++   Contributed by Falk Hueffner <falk@debian.org>, 2004.
++
++   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.  */
++
++/* This information must be kept in sync with the _DL_HWCAP_COUNT and
++   _DL_PLATFORM_COUNT definitions in procinfo.h.
++
++   If anything should be added here check whether the size of each string
++   is still ok with the given array size.
++
++   All the #ifdefs in the definitions are quite irritating but
++   necessary if we want to avoid duplicating the information.  There
++   are three different modes:
++
++   - PROCINFO_DECL is defined.  This means we are only interested in
++     declarations.
++
++   - PROCINFO_DECL is not defined:
++
++     + if SHARED is defined the file is included in an array
++       initializer.  The .element = { ... } syntax is needed.
++
++     + if SHARED is not defined a normal array initialization is
++       needed.
++  */
++
++#ifndef PROCINFO_CLASS
++#define PROCINFO_CLASS
++#endif
++
++#if !defined PROCINFO_DECL && defined SHARED
++  ._dl_alpha_platforms
++#else
++PROCINFO_CLASS const char _dl_alpha_platforms[6][6]
++#endif
++#ifndef PROCINFO_DECL
++= {
++    "ev4", "ev5", "ev56", "pca56", "ev6", "ev67"
++  }
++#endif
++#if !defined SHARED || defined PROCINFO_DECL
++;
++#else
++,
++#endif
++
++#undef PROCINFO_DECL
++#undef PROCINFO_CLASS
+Index: sysdeps/alpha/dl-procinfo.h
+===================================================================
+RCS file: sysdeps/alpha/dl-procinfo.h
+diff -N sysdeps/alpha/dl-procinfo.h
+--- /dev/null	1 Jan 1970 00:00:00 -0000
++++ sysdeps/alpha/dl-procinfo.h	13 Mar 2004 13:41:47 -0000
+@@ -0,0 +1,62 @@
++/* Alpha version of processor capability information handling macros.
++   Copyright (C) 1998, 2000, 2003, 2004 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++   Contributed by Falk Hueffner <falk@debian.org>, 2004.
++
++   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.  */
++
++#ifndef _DL_PROCINFO_H
++#define _DL_PROCINFO_H	1
++#include <ldsodefs.h>
++
++#define _DL_PLATFORMS_COUNT	6
++
++/* Mask to filter out platform. We have no hwcaps, so all bits are
++   for the platform.  */
++#define _DL_HWCAP_PLATFORM	(-1ULL)
++
++static inline const char *
++__attribute__ ((unused))
++_dl_platform_string (int idx)
++{
++  return GL(dl_alpha_platforms)[idx];
++};
++
++static inline int
++__attribute__ ((unused, always_inline))
++_dl_string_platform (const char *str)
++{
++  int i;
++
++  if (str != NULL)
++    for (i = 0; i < _DL_PLATFORMS_COUNT; ++i)
++      {
++	if (strcmp (str, GL(dl_alpha_platforms)[i]) == 0)
++	  return i;
++      }
++  return -1;
++};
++
++/* We cannot provide a general printing function.  */
++#define _dl_procinfo(word) -1
++
++/* There are no hardware capabilities defined.  */
++#define _DL_HWCAP_COUNT		0
++#define HWCAP_IMPORTANT	0
++#define _dl_hwcap_string(idx)	""
++#define _dl_string_hwcap(str)	(-1)
++
++#endif /* dl-procinfo.h */
Index: patches/00list
===================================================================
RCS file: /cvs/glibc/glibc-package/debian/patches/00list,v
retrieving revision 1.20
diff -u -p -r1.20 00list
--- patches/00list	27 Jan 2004 13:46:13 -0000	1.20
+++ patches/00list	14 Mar 2004 14:08:02 -0000
@@ -50,6 +50,7 @@ sparcv8-target
 50_glibc232-hppa-full-nptl-2003-10-22
 alpha-crti
 #alpha-pwrite - no longer needed or valid with 2.6 headers
+alpha-dl-procinfo
 #revert-old-libio - [drow] I think this isn't needed any more
 arm-output-format
 arm-ioperm

Reply to: