--- glibc-2.24/sysdeps/i386/dl-machine.h.0072~ 2016-08-02 04:01:36.000000000 +0200 +++ glibc-2.24/sysdeps/i386/dl-machine.h 2016-08-17 16:58:27.711996583 +0200 @@ -226,6 +226,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 + /* We define an initialization functions. This is called very early in _dl_sysdep_start. */ #define DL_PLATFORM_INIT dl_platform_init () @@ -241,6 +244,12 @@ dl_platform_init (void) /* init_cpu_features has been called early from __libc_start_main in static executable. */ init_cpu_features (&GLRO(dl_x86_cpu_features)); + + 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"; #endif }