Sophie

Sophie

distrib > Mageia > 6 > armv5tl > by-pkgid > 741d673bcb95c5664e7c2a84750d540a > files > 133

glibc-2.22-26.mga6.src.rpm

2003-08-29  Gwenole Beauchesne  <gbeauchesne@mandrakesoft.com>

	* sysdeps/i386/dl-machine.h (dl_platform_init): Avoid i686
	libraries to be loaded if the host doesn't support CMOV.

--- glibc-2.3.3/sysdeps/i386/dl-machine.h.i586-if-no-cmov	2004-06-03 01:21:36.000000000 +0200
+++ glibc-2.3.3/sysdeps/i386/dl-machine.h	2004-06-03 07:09:51.518703634 +0200
@@ -347,6 +347,9 @@ _dl_start_user:\n\
    Prelinked libraries may use Elf32_Rela though.  */
 #define ELF_MACHINE_PLT_REL 1
 
+/* We need the definition of HWCAP_I386_CMOV.  */
+#include <sysdeps/i386/dl-hwcapinfo.h>
+
 /* We define an initialization functions.  This is called very early in
    _dl_sysdep_start.  */
 #define DL_PLATFORM_INIT dl_platform_init ()
@@ -357,6 +360,12 @@ dl_platform_init (void)
   if (GLRO(dl_platform) != NULL && *GLRO(dl_platform) == '\0')
     /* Avoid an empty string which would disturb us.  */
     GLRO(dl_platform) = NULL;
+
+  if (GLRO(dl_platform) != NULL
+      && GLRO(dl_platform)[1] >= '6' && (GLRO(dl_hwcap) & HWCAP_I386_CMOV) == 0)
+    /* Avoid i686 compiled libraries to be loaded if the host doesn't
+       support CMOV instructions.  */
+    GLRO(dl_platform) = "i586";
 }
 
 static inline Elf32_Addr