patches/glibc/2.7/210-alpha-ptr_mangle.patch
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Sun Jan 17 23:06:02 2010 +0100 (2010-01-17)
changeset 1740 c57458bb354d
parent 744 4bf8448536d5
permissions -rw-r--r--
configure: do not require hg when configuring in an hg clone

When configuring in an hg clone, we need hg to compute the version string.
It can happen that users do not have Mercurial (eg. if they got a snapshot
rather that they did a full clone). In this case, we can still run, of
course, so simply fill the version string with a sufficiently explicit
value, that does not require hg. The date is a good candidate.
yann@734
     1
--- glibc-2.7.orig/sysdeps/unix/alpha/sysdep.h
yann@734
     2
+++ glibc-2.7/sysdeps/unix/alpha/sysdep.h
yann@734
     3
@@ -397,42 +397,4 @@
yann@734
     4
 	_sc_ret = _sc_0, _sc_err = _sc_19;			\
yann@734
     5
 }
yann@734
     6
 
yann@734
     7
-/* Pointer mangling support.  Note that tls access is slow enough that
yann@734
     8
-   we don't deoptimize things by placing the pointer check value there.  */
yann@734
     9
-
yann@734
    10
-#include <stdint.h>
yann@734
    11
-
yann@734
    12
-#if defined NOT_IN_libc && defined IS_IN_rtld
yann@734
    13
-# ifdef __ASSEMBLER__
yann@734
    14
-#  define PTR_MANGLE(dst, src, tmp)				\
yann@734
    15
-	ldah	tmp, __pointer_chk_guard_local($29) !gprelhigh;	\
yann@734
    16
-	ldq	tmp, __pointer_chk_guard_local(tmp) !gprellow;	\
yann@734
    17
-	xor	src, tmp, dst
yann@734
    18
-#  define PTR_MANGLE2(dst, src, tmp)				\
yann@734
    19
-	xor	src, tmp, dst
yann@734
    20
-#  define PTR_DEMANGLE(dst, tmp)   PTR_MANGLE(dst, dst, tmp)
yann@734
    21
-#  define PTR_DEMANGLE2(dst, tmp)  PTR_MANGLE2(dst, dst, tmp)
yann@734
    22
-# else
yann@734
    23
-extern uintptr_t __pointer_chk_guard_local attribute_relro attribute_hidden;
yann@734
    24
-#  define PTR_MANGLE(var)	\
yann@734
    25
-  (var) = (__typeof (var)) ((uintptr_t) (var) ^ __pointer_chk_guard_local)
yann@734
    26
-#  define PTR_DEMANGLE(var)  PTR_MANGLE(var)
yann@734
    27
-# endif
yann@734
    28
-#elif defined PIC
yann@734
    29
-# ifdef __ASSEMBLER__
yann@734
    30
-#  define PTR_MANGLE(dst, src, tmp)		\
yann@734
    31
-	ldq	tmp, __pointer_chk_guard;	\
yann@734
    32
-	xor	src, tmp, dst
yann@734
    33
-#  define PTR_MANGLE2(dst, src, tmp)		\
yann@734
    34
-	xor	src, tmp, dst
yann@734
    35
-#  define PTR_DEMANGLE(dst, tmp)   PTR_MANGLE(dst, dst, tmp)
yann@734
    36
-#  define PTR_DEMANGLE2(dst, tmp)  PTR_MANGLE2(dst, dst, tmp)
yann@734
    37
-# else
yann@734
    38
-extern uintptr_t __pointer_chk_guard attribute_relro;
yann@734
    39
-#  define PTR_MANGLE(var)	\
yann@734
    40
-	(var) = (void *) ((uintptr_t) (var) ^ __pointer_chk_guard)
yann@734
    41
-#  define PTR_DEMANGLE(var)  PTR_MANGLE(var)
yann@734
    42
-# endif
yann@734
    43
-#endif
yann@734
    44
-
yann@734
    45
 #endif /* ASSEMBLER */
yann@734
    46
--- glibc-2.7.orig/sysdeps/unix/sysv/linux/alpha/sysdep.h
yann@734
    47
+++ glibc-2.7/sysdeps/unix/sysv/linux/alpha/sysdep.h
yann@734
    48
@@ -98,4 +98,46 @@
yann@734
    49
 	INTERNAL_SYSCALL1(name, err_out, nr, args);			\
yann@734
    50
 })
yann@734
    51
 
yann@734
    52
+/* Pointer mangling support.  Note that tls access is slow enough that
yann@734
    53
+   we don't deoptimize things by placing the pointer check value there.  */
yann@734
    54
+
yann@734
    55
+#if defined NOT_IN_libc && defined IS_IN_rtld
yann@734
    56
+# ifdef __ASSEMBLER__
yann@734
    57
+#  define PTR_MANGLE(dst, src, tmp)				\
yann@734
    58
+	ldah	tmp, __pointer_chk_guard_local($29) !gprelhigh;	\
yann@734
    59
+	ldq	tmp, __pointer_chk_guard_local(tmp) !gprellow;	\
yann@734
    60
+	xor	src, tmp, dst
yann@734
    61
+#  define PTR_MANGLE2(dst, src, tmp)				\
yann@734
    62
+	xor	src, tmp, dst
yann@734
    63
+#  define PTR_DEMANGLE(dst, tmp)   PTR_MANGLE(dst, dst, tmp)
yann@734
    64
+#  define PTR_DEMANGLE2(dst, tmp)  PTR_MANGLE2(dst, dst, tmp)
yann@734
    65
+# else
yann@734
    66
+extern uintptr_t __pointer_chk_guard_local attribute_relro attribute_hidden;
yann@734
    67
+#  define PTR_MANGLE(var)	\
yann@734
    68
+  (var) = (__typeof (var)) ((uintptr_t) (var) ^ __pointer_chk_guard_local)
yann@734
    69
+#  define PTR_DEMANGLE(var)  PTR_MANGLE(var)
yann@734
    70
+# endif
yann@734
    71
+#elif defined PIC
yann@734
    72
+# ifdef __ASSEMBLER__
yann@734
    73
+#  define PTR_MANGLE(dst, src, tmp)		\
yann@734
    74
+	ldq	tmp, __pointer_chk_guard;	\
yann@734
    75
+	xor	src, tmp, dst
yann@734
    76
+#  define PTR_MANGLE2(dst, src, tmp)		\
yann@734
    77
+	xor	src, tmp, dst
yann@734
    78
+#  define PTR_DEMANGLE(dst, tmp)   PTR_MANGLE(dst, dst, tmp)
yann@734
    79
+#  define PTR_DEMANGLE2(dst, tmp)  PTR_MANGLE2(dst, dst, tmp)
yann@734
    80
+# else
yann@734
    81
+extern uintptr_t __pointer_chk_guard attribute_relro;
yann@734
    82
+#  define PTR_MANGLE(var)	\
yann@734
    83
+	(var) = (void *) ((uintptr_t) (var) ^ __pointer_chk_guard)
yann@734
    84
+#  define PTR_DEMANGLE(var)  PTR_MANGLE(var)
yann@734
    85
+# endif
yann@734
    86
+#else
yann@734
    87
+/* Pointer mangling is not yet supported for static libc on alpha.  */
yann@734
    88
+# ifndef __ASSEMBLER__
yann@734
    89
+#  define PTR_MANGLE(var)   (void) (var)
yann@734
    90
+#  define PTR_DEMANGLE(var) (void) (var)
yann@734
    91
+# endif
yann@734
    92
+#endif
yann@734
    93
+
yann@734
    94
 #endif /* _LINUX_ALPHA_SYSDEP_H */