summaryrefslogtreecommitdiffstats
path: root/tools/toolchain-patches/glibc-220-make44.patch
blob: 6370acea808b0a6c9e2b599153eb5816df91adac (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
diff -Naur glibc-2.20/libio/stdio.h glibc-2.20-patched/libio/stdio.h
--- glibc-2.20/libio/stdio.h	2014-09-07 04:09:09.000000000 -0400
+++ glibc-2.20-patched/libio/stdio.h	2023-05-23 14:44:22.278872059 -0400
@@ -151,18 +151,23 @@
 # define P_tmpdir	"/tmp"
 #endif
 
+#define L_tmpnam 20
+#define TMP_MAX 238328
 
 /* Get the values:
-   L_tmpnam	How long an array of chars must be to be passed to `tmpnam'.
-   TMP_MAX	The minimum number of unique filenames generated by tmpnam
-		(and tempnam when it uses tmpnam's name space),
-		or tempnam (the two are separate).
-   L_ctermid	How long an array to pass to `ctermid'.
-   L_cuserid	How long an array to pass to `cuserid'.
-   FOPEN_MAX	Minimum number of files that can be open at once.
    FILENAME_MAX	Maximum length of a filename.  */
 #include <bits/stdio_lim.h>
 
+#ifdef __USE_POSIX
+# define L_ctermid 9
+# if !defined __USE_XOPEN2K || defined __USE_GNU
+#  define L_cuserid 9
+# endif
+#endif
+
+#undef  FOPEN_MAX
+#define FOPEN_MAX 16
+
 
 /* Standard streams.  */
 extern struct _IO_FILE *stdin;		/* Standard input stream.  */
diff -Naur glibc-2.20/Makerules glibc-2.20-patched/Makerules
--- glibc-2.20/Makerules	2014-09-07 04:09:09.000000000 -0400
+++ glibc-2.20-patched/Makerules	2023-05-23 14:42:21.745795149 -0400
@@ -1277,54 +1277,6 @@
 
 endif
 
-# These will have been set by sysdeps/posix/Makefile.
-L_tmpnam  ?= 1
-TMP_MAX   ?= 0
-L_ctermid ?= 1
-L_cuserid ?= 1
-
-stdio_lim = $(common-objpfx)bits/stdio_lim.h
-
-$(stdio_lim:lim.h=%.h) $(stdio_lim:lim.h=%.d): $(stdio_lim:lim.h=%.st); @:
-$(stdio_lim:h=st): $(..)stdio-common/stdio_lim.h.in $(..)Rules \
-		   $(common-objpfx)config.make
-	$(make-target-directory)
-	{ echo '#include "$(..)posix/bits/posix1_lim.h"';		\
-	  echo '#define _LIBC 1';					\
-	  echo '#include "$(..)misc/sys/uio.h"'; } |			\
-	$(CC) -E -dM -MD -MP -MF $(@:st=dT) -MT '$(@:st=h) $(@:st=d)' 	\
-	      $(CPPUNDEFS) $(+includes) -xc - -o $(@:st=hT)
-	sed $(sed-remove-objpfx) $(sed-remove-dotdot)			\
-	    $(@:st=dT) > $(@:st=dt)
-	mv -f $(@:st=dt) $(@:st=d)
-	fopen_max=`sed -n 's/^#define OPEN_MAX //1p' $(@:st=hT)`; 	\
-	filename_max=`sed -n 's/^#define PATH_MAX //1p' $(@:st=hT)`;	\
-	iov_max=`sed -n 's/^#define UIO_MAXIOV //p' $(@:st=hT)`;	\
-	fopen_max=$${fopen_max:-16};					\
-	filename_max=$${filename_max:-1024};				\
-	if [ -z "$$iov_max" ]; then					\
-	  define_iov_max="# undef IOV_MAX";				\
-	else								\
-	  define_iov_max="# define IOV_MAX $$iov_max";			\
-	fi;								\
-	sed -e "s/@FOPEN_MAX@/$$fopen_max/"				\
-	    -e "s/@FILENAME_MAX@/$$filename_max/"			\
-	    -e "s/@L_tmpnam@/$(L_tmpnam)/"				\
-	    -e "s/@TMP_MAX@/$(TMP_MAX)/"				\
-	    -e "s/@L_ctermid@/$(L_ctermid)/"				\
-	    -e "s/@L_cuserid@/$(L_cuserid)/"				\
-	    -e "s/@define_IOV_MAX@/$$define_iov_max/"			\
-	    $< > $(@:st=h.new)
-	$(move-if-change) $(@:st=h.new) $(@:st=h)
-# Remove these last so that they can be examined if something went wrong.
-	rm -f $(@:st=hT) $(@:st=dT) $(@:st=dt)
-	touch $@
-# Get dependencies.
-ifndef no_deps
--include $(stdio_lim:h=d)
-endif
-common-generated += bits/stdio_lim.h bits/stdio_lim.d bits/stdio_lim.st
-
 FORCE:
 
 .PHONY: echo-headers
diff -Naur glibc-2.20/Rules glibc-2.20-patched/Rules
--- glibc-2.20/Rules	2014-09-07 04:09:09.000000000 -0400
+++ glibc-2.20-patched/Rules	2023-05-23 14:44:22.279872060 -0400
@@ -60,9 +60,6 @@
 common-generated :=
 endif
 
-# See below.  This must be set before Makerules processes it.
-before-compile += $(common-objpfx)bits/stdio_lim.h
-
 include $(..)Makerules
 
 .PHONY: subdir_lib
diff -Naur glibc-2.20/stdio-common/stdio_lim.h.in glibc-2.20-patched/stdio-common/stdio_lim.h.in
--- glibc-2.20/stdio-common/stdio_lim.h.in	2014-09-07 04:09:09.000000000 -0400
+++ glibc-2.20-patched/stdio-common/stdio_lim.h.in	1969-12-31 19:00:00.000000000 -0500
@@ -1,42 +0,0 @@
-/* Copyright (C) 1994-2014 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, see
-   <http://www.gnu.org/licenses/>.  */
-
-#if !defined _STDIO_H && !defined __need_FOPEN_MAX && !defined __need_IOV_MAX
-# error "Never include <bits/stdio_lim.h> directly; use <stdio.h> instead."
-#endif
-
-#ifdef _STDIO_H
-# define L_tmpnam @L_tmpnam@
-# define TMP_MAX @TMP_MAX@
-# define FILENAME_MAX @FILENAME_MAX@
-
-# ifdef __USE_POSIX
-#  define L_ctermid @L_ctermid@
-#  if !defined __USE_XOPEN2K || defined __USE_GNU
-#   define L_cuserid @L_cuserid@
-#  endif
-# endif
-#endif
-
-#if defined __need_FOPEN_MAX || defined _STDIO_H
-# undef  FOPEN_MAX
-# define FOPEN_MAX @FOPEN_MAX@
-#endif
-
-#if defined __need_IOV_MAX && !defined IOV_MAX
-@define_IOV_MAX@
-#endif
diff -Naur glibc-2.20/sysdeps/mach/hurd/bits/stdio_lim.h glibc-2.20-patched/sysdeps/mach/hurd/bits/stdio_lim.h
--- glibc-2.20/sysdeps/mach/hurd/bits/stdio_lim.h	1969-12-31 19:00:00.000000000 -0500
+++ glibc-2.20-patched/sysdeps/mach/hurd/bits/stdio_lim.h	2023-05-23 14:44:22.279872060 -0400
@@ -0,0 +1,28 @@
+/* System specific stdio.h definitions.  Hurd version.
+   Copyright (C) 2023 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef _BITS_STDIO_LIM_H
+#define _BITS_STDIO_LIM_H 1
+
+#ifndef _STDIO_H
+# error "Never include <bits/stdio_lim.h> directly; use <stdio.h> instead."
+#endif
+
+#define FILENAME_MAX 1024
+
+#endif /* bits/stdio_lim.h */
diff -Naur glibc-2.20/sysdeps/posix/Makefile glibc-2.20-patched/sysdeps/posix/Makefile
--- glibc-2.20/sysdeps/posix/Makefile	2014-09-07 04:09:09.000000000 -0400
+++ glibc-2.20-patched/sysdeps/posix/Makefile	1969-12-31 19:00:00.000000000 -0500
@@ -1,5 +0,0 @@
-# These affect the generated bits/stdio_lim.h file.
-L_tmpnam  = 20
-TMP_MAX   = 238328
-L_ctermid = 9
-L_cuserid = 9
diff -Naur glibc-2.20/sysdeps/unix/sysv/linux/bits/stdio_lim.h glibc-2.20-patched/sysdeps/unix/sysv/linux/bits/stdio_lim.h
--- glibc-2.20/sysdeps/unix/sysv/linux/bits/stdio_lim.h	1969-12-31 19:00:00.000000000 -0500
+++ glibc-2.20-patched/sysdeps/unix/sysv/linux/bits/stdio_lim.h	2023-05-23 14:44:22.279872060 -0400
@@ -0,0 +1,28 @@
+/* System specific stdio.h definitions.  Linux version.
+   Copyright (C) 2023 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <https://www.gnu.org/licenses/>.  */
+
+#ifndef _BITS_STDIO_LIM_H
+#define _BITS_STDIO_LIM_H 1
+
+//#ifndef _STDIO_H
+//# error "Never include <bits/stdio_lim.h> directly; use <stdio.h> instead."
+//#endif
+
+#define FILENAME_MAX 4096
+
+#endif /* bits/stdio_lim.h */