Add two new patches to glibc-2.7 to make it build for Alpha.
author"Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Sat Jul 26 15:29:51 2008 +0000 (2008-07-26)
changeset 7349416a82ef7b4
parent 729 506e36e44e5f
child 735 e9cbd9d6e737
Add two new patches to glibc-2.7 to make it build for Alpha.
Patches propagated to me from the net by Ioannis E. VENETIS.

/trunk/patches/glibc/2.7/230-glibc-2.7-alpha-atfcts.patch | 12 12 0 0 ++
/trunk/patches/glibc/2.7/240-glibc-2.7-alpha-ptr_mangle.patch | 94 94 0 0 +++++++++++++++++
2 files changed, 106 insertions(+)
patches/glibc/2.7/230-glibc-2.7-alpha-atfcts.patch
patches/glibc/2.7/240-glibc-2.7-alpha-ptr_mangle.patch
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/patches/glibc/2.7/230-glibc-2.7-alpha-atfcts.patch	Sat Jul 26 15:29:51 2008 +0000
     1.3 @@ -0,0 +1,12 @@
     1.4 +--- glibc-2.7/sysdeps/unix/sysv/linux/kernel-features.h	2007-08-14 06:21:09.000000000 +0300
     1.5 ++++ glibc-2.7/sysdeps/unix/sysv/linux/kernel-features.h.new	2008-07-23 07:05:20.000000000 +0300
     1.6 +@@ -449,8 +449,7 @@
     1.7 +    and on Alpha just after 2.6.22-rc1.  */
     1.8 + #if __LINUX_KERNEL_VERSION >= 0x020611 \
     1.9 +     && ((!defined __sh__ && !defined __alpha__) \
    1.10 +-	|| (__LINUX_KERNEL_VERSION >= 0x020613 && defined __sh__) \
    1.11 +-	|| (__LINUX_KERNEL_VERSION >= 0x020617 && defined __alpha__))
    1.12 ++	|| (__LINUX_KERNEL_VERSION >= 0x020613 && defined __sh__))
    1.13 + # define __ASSUME_ATFCTS	1
    1.14 + #endif
    1.15 + 
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/patches/glibc/2.7/240-glibc-2.7-alpha-ptr_mangle.patch	Sat Jul 26 15:29:51 2008 +0000
     2.3 @@ -0,0 +1,94 @@
     2.4 +--- glibc-2.7.orig/sysdeps/unix/alpha/sysdep.h
     2.5 ++++ glibc-2.7/sysdeps/unix/alpha/sysdep.h
     2.6 +@@ -397,42 +397,4 @@
     2.7 + 	_sc_ret = _sc_0, _sc_err = _sc_19;			\
     2.8 + }
     2.9 + 
    2.10 +-/* Pointer mangling support.  Note that tls access is slow enough that
    2.11 +-   we don't deoptimize things by placing the pointer check value there.  */
    2.12 +-
    2.13 +-#include <stdint.h>
    2.14 +-
    2.15 +-#if defined NOT_IN_libc && defined IS_IN_rtld
    2.16 +-# ifdef __ASSEMBLER__
    2.17 +-#  define PTR_MANGLE(dst, src, tmp)				\
    2.18 +-	ldah	tmp, __pointer_chk_guard_local($29) !gprelhigh;	\
    2.19 +-	ldq	tmp, __pointer_chk_guard_local(tmp) !gprellow;	\
    2.20 +-	xor	src, tmp, dst
    2.21 +-#  define PTR_MANGLE2(dst, src, tmp)				\
    2.22 +-	xor	src, tmp, dst
    2.23 +-#  define PTR_DEMANGLE(dst, tmp)   PTR_MANGLE(dst, dst, tmp)
    2.24 +-#  define PTR_DEMANGLE2(dst, tmp)  PTR_MANGLE2(dst, dst, tmp)
    2.25 +-# else
    2.26 +-extern uintptr_t __pointer_chk_guard_local attribute_relro attribute_hidden;
    2.27 +-#  define PTR_MANGLE(var)	\
    2.28 +-  (var) = (__typeof (var)) ((uintptr_t) (var) ^ __pointer_chk_guard_local)
    2.29 +-#  define PTR_DEMANGLE(var)  PTR_MANGLE(var)
    2.30 +-# endif
    2.31 +-#elif defined PIC
    2.32 +-# ifdef __ASSEMBLER__
    2.33 +-#  define PTR_MANGLE(dst, src, tmp)		\
    2.34 +-	ldq	tmp, __pointer_chk_guard;	\
    2.35 +-	xor	src, tmp, dst
    2.36 +-#  define PTR_MANGLE2(dst, src, tmp)		\
    2.37 +-	xor	src, tmp, dst
    2.38 +-#  define PTR_DEMANGLE(dst, tmp)   PTR_MANGLE(dst, dst, tmp)
    2.39 +-#  define PTR_DEMANGLE2(dst, tmp)  PTR_MANGLE2(dst, dst, tmp)
    2.40 +-# else
    2.41 +-extern uintptr_t __pointer_chk_guard attribute_relro;
    2.42 +-#  define PTR_MANGLE(var)	\
    2.43 +-	(var) = (void *) ((uintptr_t) (var) ^ __pointer_chk_guard)
    2.44 +-#  define PTR_DEMANGLE(var)  PTR_MANGLE(var)
    2.45 +-# endif
    2.46 +-#endif
    2.47 +-
    2.48 + #endif /* ASSEMBLER */
    2.49 +--- glibc-2.7.orig/sysdeps/unix/sysv/linux/alpha/sysdep.h
    2.50 ++++ glibc-2.7/sysdeps/unix/sysv/linux/alpha/sysdep.h
    2.51 +@@ -98,4 +98,46 @@
    2.52 + 	INTERNAL_SYSCALL1(name, err_out, nr, args);			\
    2.53 + })
    2.54 + 
    2.55 ++/* Pointer mangling support.  Note that tls access is slow enough that
    2.56 ++   we don't deoptimize things by placing the pointer check value there.  */
    2.57 ++
    2.58 ++#if defined NOT_IN_libc && defined IS_IN_rtld
    2.59 ++# ifdef __ASSEMBLER__
    2.60 ++#  define PTR_MANGLE(dst, src, tmp)				\
    2.61 ++	ldah	tmp, __pointer_chk_guard_local($29) !gprelhigh;	\
    2.62 ++	ldq	tmp, __pointer_chk_guard_local(tmp) !gprellow;	\
    2.63 ++	xor	src, tmp, dst
    2.64 ++#  define PTR_MANGLE2(dst, src, tmp)				\
    2.65 ++	xor	src, tmp, dst
    2.66 ++#  define PTR_DEMANGLE(dst, tmp)   PTR_MANGLE(dst, dst, tmp)
    2.67 ++#  define PTR_DEMANGLE2(dst, tmp)  PTR_MANGLE2(dst, dst, tmp)
    2.68 ++# else
    2.69 ++extern uintptr_t __pointer_chk_guard_local attribute_relro attribute_hidden;
    2.70 ++#  define PTR_MANGLE(var)	\
    2.71 ++  (var) = (__typeof (var)) ((uintptr_t) (var) ^ __pointer_chk_guard_local)
    2.72 ++#  define PTR_DEMANGLE(var)  PTR_MANGLE(var)
    2.73 ++# endif
    2.74 ++#elif defined PIC
    2.75 ++# ifdef __ASSEMBLER__
    2.76 ++#  define PTR_MANGLE(dst, src, tmp)		\
    2.77 ++	ldq	tmp, __pointer_chk_guard;	\
    2.78 ++	xor	src, tmp, dst
    2.79 ++#  define PTR_MANGLE2(dst, src, tmp)		\
    2.80 ++	xor	src, tmp, dst
    2.81 ++#  define PTR_DEMANGLE(dst, tmp)   PTR_MANGLE(dst, dst, tmp)
    2.82 ++#  define PTR_DEMANGLE2(dst, tmp)  PTR_MANGLE2(dst, dst, tmp)
    2.83 ++# else
    2.84 ++extern uintptr_t __pointer_chk_guard attribute_relro;
    2.85 ++#  define PTR_MANGLE(var)	\
    2.86 ++	(var) = (void *) ((uintptr_t) (var) ^ __pointer_chk_guard)
    2.87 ++#  define PTR_DEMANGLE(var)  PTR_MANGLE(var)
    2.88 ++# endif
    2.89 ++#else
    2.90 ++/* Pointer mangling is not yet supported for static libc on alpha.  */
    2.91 ++# ifndef __ASSEMBLER__
    2.92 ++#  define PTR_MANGLE(var)   (void) (var)
    2.93 ++#  define PTR_DEMANGLE(var) (void) (var)
    2.94 ++# endif
    2.95 ++#endif
    2.96 ++
    2.97 + #endif /* _LINUX_ALPHA_SYSDEP_H */