summaryrefslogtreecommitdiff
path: root/packages/glibc/glibc-2.3.2/glibc23-sse-oldkernel.patch
diff options
context:
space:
mode:
Diffstat (limited to 'packages/glibc/glibc-2.3.2/glibc23-sse-oldkernel.patch')
-rw-r--r--packages/glibc/glibc-2.3.2/glibc23-sse-oldkernel.patch109
1 files changed, 109 insertions, 0 deletions
diff --git a/packages/glibc/glibc-2.3.2/glibc23-sse-oldkernel.patch b/packages/glibc/glibc-2.3.2/glibc23-sse-oldkernel.patch
index e69de29bb2..ed58db835b 100644
--- a/packages/glibc/glibc-2.3.2/glibc23-sse-oldkernel.patch
+++ b/packages/glibc/glibc-2.3.2/glibc23-sse-oldkernel.patch
@@ -0,0 +1,109 @@
+--- glibc-2.3.2/sysdeps/i386/dl-machine.h.orig 2003-11-01 15:52:17.000000000 -0500
++++ glibc-2.3.2/sysdeps/i386/dl-machine.h 2003-11-01 15:52:55.000000000 -0500
+@@ -25,6 +25,7 @@
+ #include <sys/param.h>
+ #include <sysdep.h>
+ #include <tls.h>
++#include <dl-procinfo.h>
+
+ /* Return nonzero iff ELF header is compatible with the running host. */
+ static inline int __attribute__ ((unused))
+@@ -357,6 +358,10 @@ dl_platform_init (void)
+ if (GL(dl_platform) != NULL && *GL(dl_platform) == '\0')
+ /* Avoid an empty string which would disturb us. */
+ GL(dl_platform) = NULL;
++
++#ifdef DL_ADJUST_PROCINFO
++ DL_ADJUST_PROCINFO;
++#endif
+ }
+
+ static inline Elf32_Addr
+--- glibc-2.3.2/sysdeps/unix/sysv/linux/i386/dl-procinfo.h.orig 2003-11-01 15:50:41.000000000 -0500
++++ glibc-2.3.2/sysdeps/unix/sysv/linux/i386/dl-procinfo.h 2003-11-01 15:51:48.000000000 -0500
+@@ -126,4 +126,20 @@ _dl_string_platform (const char *str)
+ return -1;
+ };
+
++#define DL_ADJUST_PROCINFO dl_adjust_procinfo ()
++
++static inline void
++__attribute__ ((unused, always_inline))
++dl_adjust_procinfo (void)
++{
++ if (GL(dl_osversion) < 0x020400)
++ {
++ /* Unfortunately, while the capability is named OSFXSR, it's
++ actually hardware FXSR direct from CPUID. And we can't test
++ CR4 ourselves, because we're in protected mode. Disable it
++ for kernels which might not have actually enabled OSFXSR. */
++ GL(dl_hwcap) &= ~(HWCAP_I386_OSFXSR | HWCAP_I386_XMM | HWCAP_I386_XMM2);
++ }
++}
++
+ #endif /* dl-procinfo.h */
+--- glibc-2.3.2/sysdeps/generic/libc-start.c.orig 2003-11-02 23:11:51.000000000 -0500
++++ glibc-2.3.2/sysdeps/generic/libc-start.c 2003-11-02 23:34:42.000000000 -0500
+@@ -23,6 +23,10 @@
+ #include <bp-start.h>
+ #include <bp-sym.h>
+
++#include <dl-osinfo.h>
++#include <dl-librecon.h>
++#include <dl-machine.h>
++
+ extern void __libc_init_first (int argc, char **argv, char **envp);
+
+ extern int __libc_multiple_libcs;
+@@ -123,15 +127,28 @@ LIBC_START_MAIN (int (*main) (int, char
+ # endif
+ _dl_aux_init (auxvec);
+ # endif
+-# ifdef DL_SYSDEP_OSCHECK
+ if (!__libc_multiple_libcs)
+ {
++# ifdef DL_SYSDEP_OSCHECK
+ /* This needs to run to initiliaze _dl_osversion before TLS
+ setup might check it. */
+ DL_SYSDEP_OSCHECK (__libc_fatal);
+- }
+ # endif
+
++ /* Moved here so that we can frob hwcap early enough. */
++# ifdef DL_OSVERSION_INIT
++ DL_OSVERSION_INIT;
++# endif
++
++# ifdef DL_PLATFORM_INIT
++ DL_PLATFORM_INIT;
++# endif
++
++ /* Now determine the length of the platform string. */
++ if (_dl_platform != NULL)
++ _dl_platformlen = strlen (_dl_platform);
++ }
++
+ /* Initialize the thread library at least a bit since the libgcc
+ functions are using thread functions if these are available and
+ we need to setup errno. If there is no thread library and we
+--- glibc-2.3.2/elf/dl-support.c.orig 2003-11-02 22:55:47.000000000 -0500
++++ glibc-2.3.2/elf/dl-support.c 2003-11-02 23:24:40.000000000 -0500
+@@ -252,18 +252,6 @@ _dl_non_dynamic_init (void)
+ if (__access ("/etc/suid-debug", F_OK) != 0)
+ unsetenv ("MALLOC_CHECK_");
+ }
+-
+-#ifdef DL_PLATFORM_INIT
+- DL_PLATFORM_INIT;
+-#endif
+-
+-#ifdef DL_OSVERSION_INIT
+- DL_OSVERSION_INIT;
+-#endif
+-
+- /* Now determine the length of the platform string. */
+- if (_dl_platform != NULL)
+- _dl_platformlen = strlen (_dl_platform);
+ }
+
+