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