1 diff -ur glibc-2.5/Makeconfig glibc/Makeconfig
2 --- glibc-2.5/Makeconfig 2006-07-11 07:42:27.000000000 +1000
3 +++ glibc/Makeconfig 2008-07-05 00:01:41.000000000 +1000
7 ifneq ($(have-as-needed),yes)
8 - libgcc_eh := -lgcc_eh $(libunwind)
9 + libgcc_eh := $(libunwind)
11 libgcc_eh := -Wl,--as-needed -lgcc_s$(libgcc_s_suffix) $(libunwind) -Wl,--no-as-needed
13 gnulib := -lgcc $(libgcc_eh)
14 -static-gnulib := -lgcc -lgcc_eh $(libunwind)
15 +static-gnulib := -lgcc $(libunwind)
16 libc.so-gnulib := -lgcc
19 diff -ur glibc-2.5/dlfcn/Makefile glibc/dlfcn/Makefile
20 --- glibc-2.5/dlfcn/Makefile 2006-09-01 02:59:15.000000000 +1000
21 +++ glibc/dlfcn/Makefile 2008-07-05 00:02:11.000000000 +1000
23 $(objpfx)bug-atexit2-lib.so: $(common-objpfx)libc.so \
24 $(common-objpfx)libc_nonshared.a
26 -LDLIBS-bug-atexit3-lib.so = -lstdc++ -lgcc_eh $(common-objpfx)elf/ld.so \
27 +LDLIBS-bug-atexit3-lib.so = -lstdc++ $(common-objpfx)elf/ld.so \
28 $(common-objpfx)libc_nonshared.a
29 $(objpfx)bug-atexit3: $(libdl)
30 $(objpfx)bug-atexit3.out: $(objpfx)bug-atexit3-lib.so
31 diff -ur glibc-2.5/malloc/memusage.c glibc/malloc/memusage.c
32 --- glibc-2.5/malloc/memusage.c 2005-10-15 07:09:34.000000000 +1000
33 +++ glibc/malloc/memusage.c 2008-07-05 00:30:28.000000000 +1000
43 /* Pointer to the real functions. These are determined used `dlsym'
47 static struct entry buffer[2 * DEFAULT_BUFFER_SIZE];
48 -static uatomic32_t buffer_cnt;
49 +static uint32_t buffer_cnt;
50 static struct entry first;
54 /* Store the value only if we are writing to a file. */
57 - uatomic32_t idx = atomic_exchange_and_add (&buffer_cnt, 1);
58 + uint32_t idx = atomic_exchange_and_add (&buffer_cnt, 1);
59 if (idx >= 2 * buffer_size)
61 /* We try to reset the counter to the correct range. If
65 /* Write a colorful statistic. */
66 - fprintf (stderr, "\n\
67 -\e[01;32mMemory usage summary:\e[0;0m heap total: %llu, heap peak: %lu, stack peak: %lu\n\
68 -\e[04;34m total calls total memory failed calls\e[0m\n\
69 -\e[00;34m malloc|\e[0m %10lu %12llu %s%12lu\e[00;00m\n\
70 -\e[00;34mrealloc|\e[0m %10lu %12llu %s%12lu\e[00;00m (in place: %ld, dec: %ld)\n\
71 -\e[00;34m calloc|\e[0m %10lu %12llu %s%12lu\e[00;00m\n\
72 -\e[00;34m free|\e[0m %10lu %12llu\n",
73 + fprintf (stderr, "\n"
74 +"\e[01;32mMemory usage summary:\e[0;0m heap total: %llu, heap peak: %lu, stack peak: %lu\n"
75 +"\e[04;34m total calls total memory failed calls\e[0m\n"
76 +"\e[00;34m malloc|\e[0m %10lu %12llu %s%12lu\e[00;00m\n"
77 +"\e[00;34mrealloc|\e[0m %10lu %12llu %s%12lu\e[00;00m (in place: %ld, dec: %ld)\n"
78 +"\e[00;34m calloc|\e[0m %10lu %12llu %s%12lu\e[00;00m\n"
79 +"\e[00;34m free|\e[0m %10lu %12llu\n",
80 (unsigned long long int) grand_total, (unsigned long int) peak_heap,
81 (unsigned long int) peak_stack,
82 (unsigned long int) calls[idx_malloc],
84 (unsigned long long int) total[idx_free]);
88 -\e[00;34mmmap(r)|\e[0m %10lu %12llu %s%12lu\e[00;00m\n\
89 -\e[00;34mmmap(w)|\e[0m %10lu %12llu %s%12lu\e[00;00m\n\
90 -\e[00;34mmmap(a)|\e[0m %10lu %12llu %s%12lu\e[00;00m\n\
91 -\e[00;34m mremap|\e[0m %10lu %12llu %s%12lu\e[00;00m (in place: %ld, dec: %ld)\n\
92 -\e[00;34m munmap|\e[0m %10lu %12llu %s%12lu\e[00;00m\n",
94 +"\e[00;34mmmap(r)|\e[0m %10lu %12llu %s%12lu\e[00;00m\n"
95 +"\e[00;34mmmap(w)|\e[0m %10lu %12llu %s%12lu\e[00;00m\n"
96 +"\e[00;34mmmap(a)|\e[0m %10lu %12llu %s%12lu\e[00;00m\n"
97 +"\e[00;34m mremap|\e[0m %10lu %12llu %s%12lu\e[00;00m (in place: %ld, dec: %ld)\n"
98 +"\e[00;34m munmap|\e[0m %10lu %12llu %s%12lu\e[00;00m\n",
99 (unsigned long int) calls[idx_mmap_r],
100 (unsigned long long int) total[idx_mmap_r],
101 failed[idx_mmap_r] ? "\e[01;41m" : "",
102 diff -ur glibc-2.5/sysdeps/generic/memusage.h glibc/sysdeps/generic/memusage.h
103 --- glibc-2.5/sysdeps/generic/memusage.h 2005-08-20 11:07:03.000000000 +1000
104 +++ glibc/sysdeps/generic/memusage.h 2008-07-05 00:26:00.000000000 +1000
109 -# define memusage_cntr_t uatomic32_t
110 +# define memusage_cntr_t uint32_t
112 -# define memusage_cntr_t uatomic64_t
113 +# define memusage_cntr_t uint64_t
115 #ifndef memusage_size_t
117 -# define memusage_size_t uatomic32_t
118 +# define memusage_size_t uint32_t
120 -# define memusage_size_t uatomic64_t
121 +# define memusage_size_t uint64_t
124 diff -ur glibc-2.5/sysdeps/unix/sysv/linux/getcwd.c glibc/sysdeps/unix/sysv/linux/getcwd.c
125 --- glibc-2.5/sysdeps/unix/sysv/linux/getcwd.c 2006-04-03 03:58:28.000000000 +1000
126 +++ glibc/sysdeps/unix/sysv/linux/getcwd.c 2008-07-04 23:11:52.000000000 +1000
128 return generic_getcwd (buf, size);
130 #ifndef NO_ALLOCATION
132 +#define MAX(a,b) ((a) > (b) ? (a) : (b))
134 size_t alloc_size = size;