]> git.pld-linux.org Git - packages/dietlibc.git/blob - dietlibc-bloat.patch
- release 17 (by relup.sh)
[packages/dietlibc.git] / dietlibc-bloat.patch
1 Index: dietfeatures.h
2 ===================================================================
3 RCS file: /cvs/dietlibc/dietfeatures.h,v
4 retrieving revision 1.68
5 retrieving revision 1.69
6 diff -u -r1.68 -r1.69
7 --- dietfeatures.h      21 Jun 2010 16:40:06 -0000      1.68
8 +++ dietfeatures.h      1 Aug 2010 19:56:21 -0000       1.69
9 @@ -121,6 +121,12 @@
10   * `main' can not be found. */
11  /* #define WANT_STACKGAP */
12  
13 +/* #define this if you want GNU bloat like program_invocation_short_name
14 + * and program_invocation_name to be there.  This functionality is not
15 + * portable and adds useless bloat to libc.  Help stomp out code
16 + * depending on this!  util-linux, I'm looking at you here! */
17 +#define WANT_GNU_STARTUP_BLOAT
18 +
19  /* Include support for ProPolice/SSP, calls guard_setup */
20  /* ProPolice is part of gcc 4.1 and up, there were patches for earlier
21   * versions.  To make use of this, compile your application with
22 Index: include/errno.h
23 ===================================================================
24 RCS file: /cvs/dietlibc/include/errno.h,v
25 retrieving revision 1.22
26 retrieving revision 1.23
27 diff -u -r1.22 -r1.23
28 --- include/errno.h     14 May 2005 23:35:39 -0000      1.22
29 +++ include/errno.h     1 Aug 2010 19:56:21 -0000       1.23
30 @@ -720,6 +720,11 @@
31  extern int sys_nerr __attribute_dontuse__;
32  #endif
33  
34 +#ifdef _GNU_SOURCE
35 +extern char* program_invocation_name __attribute_dontuse__;
36 +extern char* program_invocation_short_name __attribute_dontuse__;
37 +#endif
38 +
39  __END_DECLS
40  
41  #endif
42 Index: include/stdint.h
43 ===================================================================
44 RCS file: /cvs/dietlibc/include/stdint.h,v
45 retrieving revision 1.8
46 retrieving revision 1.9
47 diff -u -r1.8 -r1.9
48 --- include/stdint.h    15 Mar 2005 08:51:22 -0000      1.8
49 +++ include/stdint.h    1 Aug 2010 19:56:21 -0000       1.9
50 @@ -2,6 +2,7 @@
51  #define _STDINT_H
52  
53  #include <inttypes.h>
54 +#include <stddef.h>
55  
56  __BEGIN_DECLS
57  
58 @@ -44,6 +45,39 @@
59       WINT_MIN, WINT_MAX
60  */
61  
62 +#define INT8_MIN (-0x80)
63 +#define INT16_MIN (-0x7fff-1)
64 +#define INT32_MIN (-0x7fffffffl-1)
65 +#define INT64_MIN (-0x7fffffffffffffffll-1)
66 +
67 +#define INT8_MAX 0x7f
68 +#define INT16_MAX 0x7fff
69 +#define INT32_MAX 0x7fffffffl
70 +#define INT32_MAX 0x7fffffffffffffffll
71 +
72 +#define UINT8_MAX 0xff
73 +#define UINT16_MAX 0xffff
74 +#define UINT32_MAX 0xfffffffful
75 +#define UINT64_MAX 0xffffffffffffffffull
76 +
77 +#if __WORDSIZE == 64
78 +#define INTPTR_MIN INT64_MIN
79 +#define INTPTR_MAX INT64_MAX
80 +#define UINTPTR_MAX UINT64_MAX
81 +#else
82 +#define INTPTR_MIN INT32_MIN
83 +#define INTPTR_MAX INT32_MAX
84 +#define UINTPTR_MAX UINT32_MAX
85 +#endif
86 +
87 +#define SIZE_MAX UINTPTR_MAX
88 +#define PTRDIFF_MIN INTPTR_MIN
89 +#define PTRDIFF_MAX INTPTR_MAX
90 +
91 +#define INTMAX_MIN INT64_MIN
92 +#define INTMAX_MAX INT64_MAX
93 +#define UINTMAX_MAX UINT64_MAX
94 +
95  #endif /* C++ && limit macros */
96  
97  
98 Index: include/string.h
99 ===================================================================
100 RCS file: /cvs/dietlibc/include/string.h,v
101 retrieving revision 1.53
102 retrieving revision 1.54
103 diff -u -r1.53 -r1.54
104 --- include/string.h    15 May 2009 03:24:27 -0000      1.53
105 +++ include/string.h    1 Aug 2010 19:56:21 -0000       1.54
106 @@ -56,7 +56,7 @@
107  int strerror_r(int errnum,char* buf,size_t n) __THROW __attribute_dontuse__;
108  
109  #ifdef _GNU_SOURCE
110 -const char *strsignal(int signum) __THROW __attribute_const__;
111 +char *strsignal(int signum) __THROW __attribute_const__;
112  void *memmem(const void *haystack, size_t haystacklen, const void *needle, size_t needlelen) __THROW __nonnull((1,3));
113  
114  void* mempcpy(void* __restrict__ dest,const void* __restrict__ src,size_t n) __THROW __nonnull((1,2));
115 Index: lib/stackgap.c
116 ===================================================================
117 RCS file: /cvs/dietlibc/lib/stackgap.c,v
118 retrieving revision 1.15
119 retrieving revision 1.16
120 diff -u -r1.15 -r1.16
121 --- lib/stackgap.c      2 Jun 2010 20:22:07 -0000       1.15
122 +++ lib/stackgap.c      1 Aug 2010 19:56:21 -0000       1.16
123 @@ -17,6 +17,11 @@
124  #include <stdlib.h>
125  #include "dietfeatures.h"
126  
127 +#ifdef WANT_GNU_STARTUP_BLOAT
128 +char* program_invocation_name;
129 +char* program_invocation_short_name;
130 +#endif
131 +
132  extern int main(int argc,char* argv[],char* envp[]);
133  
134  #if defined(WANT_SSP)
135 @@ -178,6 +183,14 @@
136      __valgrind=(v && strstr(v,"valgrind"));
137    }
138  #endif
139 +#ifdef WANT_GNU_STARTUP_BLOAT
140 +  program_invocation_name=argv[0];
141 +  {
142 +    char* c;
143 +    for (c=program_invocation_short_name=program_invocation_name; *c; ++c)
144 +      if (*c=='/') program_invocation_short_name=c+1;
145 +  }
146 +#endif
147    return main(argc,argv,envp);
148  }
149  
150 Index: libugly/strsignal.c
151 ===================================================================
152 RCS file: /cvs/dietlibc/libugly/strsignal.c,v
153 retrieving revision 1.9
154 retrieving revision 1.10
155 diff -u -r1.9 -r1.10
156 --- libugly/strsignal.c 15 Aug 2006 16:07:15 -0000      1.9
157 +++ libugly/strsignal.c 1 Aug 2010 19:56:21 -0000       1.10
158 @@ -2,9 +2,9 @@
159  #include <string.h>
160  #include <signal.h>
161  
162 -const char* strsignal(int sig) {
163 +char* strsignal(int sig) {
164    if ((unsigned int)sig<=SIGRTMAX)
165 -    return sys_siglist[sig];
166 +    return (char*)sys_siglist[sig];
167    else
168 -    return "(unknown signal)";
169 +    return (char*)"(unknown signal)";
170  }
This page took 0.05232 seconds and 3 git commands to generate.