1 http://bugs.gentoo.org/201910
3 For every arch, PTR_MANGLE and PTR_DEMANGLE defines are in
4 sysdeps/unix/sysv/linux/<arch>/sysdep.h. But for alpha this is not true. The
5 defines are in sysdeps/unix/alpha/sysdep.h and unix/sysv/linux/alpha/sysdep.h
8 This is a patch that fixes the issue and let alpha build, at the expense of
9 disabling MANGLING in the non PIC case, but googling showed that the issue is
10 known, and that nobody really cares about it.
12 Info from: http://sourceware.org/bugzilla/show_bug.cgi?id=5216
14 diff -durN glibc-2.10.1.orig/glibc-ports-2.10.1/sysdeps/unix/alpha/sysdep.h glibc-2.10.1/glibc-ports-2.10.1/sysdeps/unix/alpha/sysdep.h
15 --- glibc-2.10.1.orig/glibc-ports-2.10.1/sysdeps/unix/alpha/sysdep.h 2009-05-16 10:36:20.000000000 +0200
16 +++ glibc-2.10.1/glibc-ports-2.10.1/sysdeps/unix/alpha/sysdep.h 2009-11-13 00:50:55.000000000 +0100
18 _sc_ret = _sc_0, _sc_err = _sc_19; \
21 -/* Pointer mangling support. Note that tls access is slow enough that
22 - we don't deoptimize things by placing the pointer check value there. */
26 -#if defined NOT_IN_libc && defined IS_IN_rtld
27 -# ifdef __ASSEMBLER__
28 -# define PTR_MANGLE(dst, src, tmp) \
29 - ldah tmp, __pointer_chk_guard_local($29) !gprelhigh; \
30 - ldq tmp, __pointer_chk_guard_local(tmp) !gprellow; \
32 -# define PTR_MANGLE2(dst, src, tmp) \
34 -# define PTR_DEMANGLE(dst, tmp) PTR_MANGLE(dst, dst, tmp)
35 -# define PTR_DEMANGLE2(dst, tmp) PTR_MANGLE2(dst, dst, tmp)
37 -extern uintptr_t __pointer_chk_guard_local attribute_relro attribute_hidden;
38 -# define PTR_MANGLE(var) \
39 - (var) = (__typeof (var)) ((uintptr_t) (var) ^ __pointer_chk_guard_local)
40 -# define PTR_DEMANGLE(var) PTR_MANGLE(var)
43 -# ifdef __ASSEMBLER__
44 -# define PTR_MANGLE(dst, src, tmp) \
45 - ldq tmp, __pointer_chk_guard; \
47 -# define PTR_MANGLE2(dst, src, tmp) \
49 -# define PTR_DEMANGLE(dst, tmp) PTR_MANGLE(dst, dst, tmp)
50 -# define PTR_DEMANGLE2(dst, tmp) PTR_MANGLE2(dst, dst, tmp)
52 -extern uintptr_t __pointer_chk_guard attribute_relro;
53 -# define PTR_MANGLE(var) \
54 - (var) = (void *) ((uintptr_t) (var) ^ __pointer_chk_guard)
55 -# define PTR_DEMANGLE(var) PTR_MANGLE(var)
59 #endif /* ASSEMBLER */
60 diff -durN glibc-2.10.1.orig/glibc-ports-2.10.1/sysdeps/unix/sysv/linux/alpha/sysdep.h glibc-2.10.1/glibc-ports-2.10.1/sysdeps/unix/sysv/linux/alpha/sysdep.h
61 --- glibc-2.10.1.orig/glibc-ports-2.10.1/sysdeps/unix/sysv/linux/alpha/sysdep.h 2009-05-16 10:36:20.000000000 +0200
62 +++ glibc-2.10.1/glibc-ports-2.10.1/sysdeps/unix/sysv/linux/alpha/sysdep.h 2009-11-13 00:50:55.000000000 +0100
64 INTERNAL_SYSCALL1(name, err_out, nr, args); \
67 +/* Pointer mangling support. Note that tls access is slow enough that
68 + we don't deoptimize things by placing the pointer check value there. */
70 +#if defined NOT_IN_libc && defined IS_IN_rtld
71 +# ifdef __ASSEMBLER__
72 +# define PTR_MANGLE(dst, src, tmp) \
73 + ldah tmp, __pointer_chk_guard_local($29) !gprelhigh; \
74 + ldq tmp, __pointer_chk_guard_local(tmp) !gprellow; \
76 +# define PTR_MANGLE2(dst, src, tmp) \
78 +# define PTR_DEMANGLE(dst, tmp) PTR_MANGLE(dst, dst, tmp)
79 +# define PTR_DEMANGLE2(dst, tmp) PTR_MANGLE2(dst, dst, tmp)
81 +extern uintptr_t __pointer_chk_guard_local attribute_relro attribute_hidden;
82 +# define PTR_MANGLE(var) \
83 + (var) = (__typeof (var)) ((uintptr_t) (var) ^ __pointer_chk_guard_local)
84 +# define PTR_DEMANGLE(var) PTR_MANGLE(var)
87 +# ifdef __ASSEMBLER__
88 +# define PTR_MANGLE(dst, src, tmp) \
89 + ldq tmp, __pointer_chk_guard; \
91 +# define PTR_MANGLE2(dst, src, tmp) \
93 +# define PTR_DEMANGLE(dst, tmp) PTR_MANGLE(dst, dst, tmp)
94 +# define PTR_DEMANGLE2(dst, tmp) PTR_MANGLE2(dst, dst, tmp)
96 +extern uintptr_t __pointer_chk_guard attribute_relro;
97 +# define PTR_MANGLE(var) \
98 + (var) = (void *) ((uintptr_t) (var) ^ __pointer_chk_guard)
99 +# define PTR_DEMANGLE(var) PTR_MANGLE(var)
102 +/* Pointer mangling is not yet supported for static libc on alpha. */
103 +# ifndef __ASSEMBLER__
104 +# define PTR_MANGLE(var) (void) (var)
105 +# define PTR_DEMANGLE(var) (void) (var)
109 #endif /* _LINUX_ALPHA_SYSDEP_H */
110 diff -durN glibc-2.10.1.orig/ports/sysdeps/unix/alpha/sysdep.h glibc-2.10.1/ports/sysdeps/unix/alpha/sysdep.h
111 diff -durN glibc-2.10.1.orig/ports/sysdeps/unix/sysv/linux/alpha/sysdep.h glibc-2.10.1/ports/sysdeps/unix/sysv/linux/alpha/sysdep.h