This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Why does sysdeps/generic/dl-cache.c check _DL_PLATFORMS_COUNT?


_DL_PLATFORMS_COUNT is only defined in
sysdeps/unix/sysv/linux/i386/dl-procinfo.h. I don't see why it is
necessary. Right now, glibc won't build on any none-x86 platforms.
Here is a patch.

-- 
H.J. Lu (hjl@valinux.com)
---
2000-11-15  H.J. Lu  <hjl@gnu.org>

	* sysdeps/generic/dl-cache.c (HWCAP_CHECK): Don't check
	_DL_PLATFORMS_COUNT.

	* sysdeps/unix/sysv/linux/i386/dl-procinfo.h (_DL_PLATFORMS_COUNT):
	Replaced by sizeof.

Index: ./sysdeps/generic/dl-cache.c
===================================================================
RCS file: /work/cvs/gnu/glibc/sysdeps/generic/dl-cache.c,v
retrieving revision 1.1.1.4
diff -u -p -r1.1.1.4 dl-cache.c
--- ./sysdeps/generic/dl-cache.c	2000/11/16 02:09:56	1.1.1.4
+++ ./sysdeps/generic/dl-cache.c	2000/11/16 03:04:55
@@ -229,7 +229,7 @@ _dl_load_cache_lookup (const char *name)
 
       /* Only accept hwcap if it's for the right platform.  */
 #define HWCAP_CHECK							       \
-      if (_DL_PLATFORMS_COUNT && platform != -1				       \
+      if (platform != -1				       \
 	  && (cache_new->libs[middle].hwcap & _DL_HWCAP_PLATFORM) != 0	       \
 	  && (cache_new->libs[middle].hwcap & _DL_HWCAP_PLATFORM) != platform) \
 	continue;							       \
Index: sysdeps/unix/sysv/linux/i386/dl-procinfo.h
===================================================================
RCS file: /work/cvs/gnu/glibc/sysdeps/unix/sysv/linux/i386/dl-procinfo.h,v
retrieving revision 1.1.1.3
diff -u -p -r1.1.1.3 dl-procinfo.h
--- sysdeps/unix/sysv/linux/i386/dl-procinfo.h	2000/11/16 02:10:18	1.1.1.3
+++ sysdeps/unix/sysv/linux/i386/dl-procinfo.h	2000/11/16 03:12:01
@@ -36,7 +36,6 @@ static const char x86_platforms[][5] =
   {
     "i386", "i486", "i586", "i686"
   };
-#define _DL_PLATFORMS_COUNT 	4
 
 /* Start at 48 to reserve some space.  */
 #define _DL_FIRST_PLATFORM 	48
@@ -54,7 +53,8 @@ _dl_procinfo (int word)
 
   _dl_sysdep_message ("AT_HWCAP:   ", NULL);
 
-  for (i = 0; i < _DL_HWCAP_COUNT; ++i)
+  for (i = 0; i < sizeof (x86_platforms) / sizeof (x86_platforms [0]);
+       ++i)
     if (word & (1 << i))
       _dl_sysdep_message (" ", x86_cap_flags[i], NULL);
 

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]