Patch from Enrico WEIGELT <weigelt@metux.de> to disable __cxa_atexit for those C libraries with no support (old uClibc).
1 # see http://bugs.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&pr=4155
2 # and http://www.kegel.com/xgcc3/ppc405erratum77.html
3 # See also matching patch for linuxthreads
5 diff -aur glibc-2.2.5.orig/sysdeps/powerpc/atomicity.h glibc-2.2.5/sysdeps/powerpc/atomicity.h
6 --- glibc-2.2.5.orig/sysdeps/powerpc/atomicity.h Thu Jul 5 21:56:01 2001
7 +++ glibc-2.2.5/sysdeps/powerpc/atomicity.h Tue Jul 23 05:39:38 2002
9 # define __ATOMICITY_INLINE inline
13 +/* workaround for PPC405 erratum #77 - Mark Hatle, dank. References:
14 + http://www-3.ibm.com/chips/techlib/techlib.nsf/techdocs/89DED00DEBFF54BF87256A8000491BA2/$file/405CR_C_errata_1_2.pdf
15 + http://ppc.bkbits.net:8080/linuxppc_2_4_devel/cset@1.489
16 + http://www.kegel.com/xgcc3/ppc405erratum77.html
17 + FIXME: using dbct instead of sync would be faster */
18 +#define __LIBC_PPC405_ERR77_SYNC "sync \n\t"
20 +#define __LIBC_PPC405_ERR77_SYNC
23 static __ATOMICITY_INLINE int
24 __attribute__ ((unused))
25 exchange_and_add (volatile uint32_t *mem, int val)
30 + " __LIBC_PPC405_ERR77_SYNC "\n\
33 " : "=&b"(result), "=&r"(tmp) : "r" (mem), "Ir"(val) : "cr0", "memory");
38 + " __LIBC_PPC405_ERR77_SYNC "\n\
41 " : "=&b"(tmp) : "r" (mem), "Ir"(val) : "cr0", "memory");
46 + " __LIBC_PPC405_ERR77_SYNC "\n\
54 + " __LIBC_PPC405_ERR77_SYNC "\n\
57 " : "=&r"(result) : "r"(p), "r"(newval) : "cr0", "memory");
62 + " __LIBC_PPC405_ERR77_SYNC "\n\