summaryrefslogtreecommitdiff
path: root/tools/toolchain-patches/glibc-220-make44.patch
diff options
context:
space:
mode:
authorSolomon Peachy <pizza@shaftnet.org>2023-05-23 14:58:54 -0400
committerSolomon Peachy <pizza@shaftnet.org>2023-05-23 15:57:00 -0400
commit3acd5f86e59586e45cc1ec2bc25cc662a8488d6f (patch)
tree9c5451d0c140cb3bacddca1694e6fc6ea8673cc8 /tools/toolchain-patches/glibc-220-make44.patch
parent56fe1129da1b59eea4cac351707bc9eaabfb853c (diff)
downloadrockbox-3acd5f86e59586e45cc1ec2bc25cc662a8488d6f.tar.gz
rockbox-3acd5f86e59586e45cc1ec2bc25cc662a8488d6f.zip
build: Fix problems compiling old glibc with gmake >= 4.4
Three separate problems: 1) Make 4.4 defaults to a named pipe for jobserver control, this was incompatible with how glibc did recursive makes 2) Make 4.4 passed long arguments ( --foo ) into MAKEFLAGS and this broke stuff that wasn't expecting it 3) Circular dependency in a header generation due do make 4.4 being stricter/more consistent in how it orders rules vs which makefiles they came from. This one was the real !@#!@ to deal with. This patch set fixes the hosted arm (glibc 2.19) and mips (glibc 2.25) toolchains. Change-Id: Ie6d6a0ab7e1b36f24c43e524fee4afc0bd3a14d6
Diffstat (limited to 'tools/toolchain-patches/glibc-220-make44.patch')
-rw-r--r--tools/toolchain-patches/glibc-220-make44.patch224
1 files changed, 224 insertions, 0 deletions
diff --git a/tools/toolchain-patches/glibc-220-make44.patch b/tools/toolchain-patches/glibc-220-make44.patch
new file mode 100644
index 0000000000..6370acea80
--- /dev/null
+++ b/tools/toolchain-patches/glibc-220-make44.patch
@@ -0,0 +1,224 @@
1diff -Naur glibc-2.20/libio/stdio.h glibc-2.20-patched/libio/stdio.h
2--- glibc-2.20/libio/stdio.h 2014-09-07 04:09:09.000000000 -0400
3+++ glibc-2.20-patched/libio/stdio.h 2023-05-23 14:44:22.278872059 -0400
4@@ -151,18 +151,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.20/Makerules glibc-2.20-patched/Makerules
36--- glibc-2.20/Makerules 2014-09-07 04:09:09.000000000 -0400
37+++ glibc-2.20-patched/Makerules 2023-05-23 14:42:21.745795149 -0400
38@@ -1277,54 +1277,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- echo '#define _LIBC 1'; \
56- echo '#include "$(..)misc/sys/uio.h"'; } | \
57- $(CC) -E -dM -MD -MP -MF $(@:st=dT) -MT '$(@:st=h) $(@:st=d)' \
58- $(CPPUNDEFS) $(+includes) -xc - -o $(@:st=hT)
59- sed $(sed-remove-objpfx) $(sed-remove-dotdot) \
60- $(@:st=dT) > $(@:st=dt)
61- mv -f $(@:st=dt) $(@:st=d)
62- fopen_max=`sed -n 's/^#define OPEN_MAX //1p' $(@:st=hT)`; \
63- filename_max=`sed -n 's/^#define PATH_MAX //1p' $(@:st=hT)`; \
64- iov_max=`sed -n 's/^#define UIO_MAXIOV //p' $(@:st=hT)`; \
65- fopen_max=$${fopen_max:-16}; \
66- filename_max=$${filename_max:-1024}; \
67- if [ -z "$$iov_max" ]; then \
68- define_iov_max="# undef IOV_MAX"; \
69- else \
70- define_iov_max="# define IOV_MAX $$iov_max"; \
71- fi; \
72- sed -e "s/@FOPEN_MAX@/$$fopen_max/" \
73- -e "s/@FILENAME_MAX@/$$filename_max/" \
74- -e "s/@L_tmpnam@/$(L_tmpnam)/" \
75- -e "s/@TMP_MAX@/$(TMP_MAX)/" \
76- -e "s/@L_ctermid@/$(L_ctermid)/" \
77- -e "s/@L_cuserid@/$(L_cuserid)/" \
78- -e "s/@define_IOV_MAX@/$$define_iov_max/" \
79- $< > $(@:st=h.new)
80- $(move-if-change) $(@:st=h.new) $(@:st=h)
81-# Remove these last so that they can be examined if something went wrong.
82- rm -f $(@:st=hT) $(@:st=dT) $(@:st=dt)
83- touch $@
84-# Get dependencies.
85-ifndef no_deps
86--include $(stdio_lim:h=d)
87-endif
88-common-generated += bits/stdio_lim.h bits/stdio_lim.d bits/stdio_lim.st
89-
90 FORCE:
91
92 .PHONY: echo-headers
93diff -Naur glibc-2.20/Rules glibc-2.20-patched/Rules
94--- glibc-2.20/Rules 2014-09-07 04:09:09.000000000 -0400
95+++ glibc-2.20-patched/Rules 2023-05-23 14:44:22.279872060 -0400
96@@ -60,9 +60,6 @@
97 common-generated :=
98 endif
99
100-# See below. This must be set before Makerules processes it.
101-before-compile += $(common-objpfx)bits/stdio_lim.h
102-
103 include $(..)Makerules
104
105 .PHONY: subdir_lib
106diff -Naur glibc-2.20/stdio-common/stdio_lim.h.in glibc-2.20-patched/stdio-common/stdio_lim.h.in
107--- glibc-2.20/stdio-common/stdio_lim.h.in 2014-09-07 04:09:09.000000000 -0400
108+++ glibc-2.20-patched/stdio-common/stdio_lim.h.in 1969-12-31 19:00:00.000000000 -0500
109@@ -1,42 +0,0 @@
110-/* Copyright (C) 1994-2014 Free Software Foundation, Inc.
111- This file is part of the GNU C Library.
112-
113- The GNU C Library is free software; you can redistribute it and/or
114- modify it under the terms of the GNU Lesser General Public
115- License as published by the Free Software Foundation; either
116- version 2.1 of the License, or (at your option) any later version.
117-
118- The GNU C Library is distributed in the hope that it will be useful,
119- but WITHOUT ANY WARRANTY; without even the implied warranty of
120- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
121- Lesser General Public License for more details.
122-
123- You should have received a copy of the GNU Lesser General Public
124- License along with the GNU C Library; if not, see
125- <http://www.gnu.org/licenses/>. */
126-
127-#if !defined _STDIO_H && !defined __need_FOPEN_MAX && !defined __need_IOV_MAX
128-# error "Never include <bits/stdio_lim.h> directly; use <stdio.h> instead."
129-#endif
130-
131-#ifdef _STDIO_H
132-# define L_tmpnam @L_tmpnam@
133-# define TMP_MAX @TMP_MAX@
134-# define FILENAME_MAX @FILENAME_MAX@
135-
136-# ifdef __USE_POSIX
137-# define L_ctermid @L_ctermid@
138-# if !defined __USE_XOPEN2K || defined __USE_GNU
139-# define L_cuserid @L_cuserid@
140-# endif
141-# endif
142-#endif
143-
144-#if defined __need_FOPEN_MAX || defined _STDIO_H
145-# undef FOPEN_MAX
146-# define FOPEN_MAX @FOPEN_MAX@
147-#endif
148-
149-#if defined __need_IOV_MAX && !defined IOV_MAX
150-@define_IOV_MAX@
151-#endif
152diff -Naur glibc-2.20/sysdeps/mach/hurd/bits/stdio_lim.h glibc-2.20-patched/sysdeps/mach/hurd/bits/stdio_lim.h
153--- glibc-2.20/sysdeps/mach/hurd/bits/stdio_lim.h 1969-12-31 19:00:00.000000000 -0500
154+++ glibc-2.20-patched/sysdeps/mach/hurd/bits/stdio_lim.h 2023-05-23 14:44:22.279872060 -0400
155@@ -0,0 +1,28 @@
156+/* System specific stdio.h definitions. Hurd version.
157+ Copyright (C) 2023 Free Software Foundation, Inc.
158+ This file is part of the GNU C Library.
159+
160+ The GNU C Library is free software; you can redistribute it and/or
161+ modify it under the terms of the GNU Lesser General Public
162+ License as published by the Free Software Foundation; either
163+ version 2.1 of the License, or (at your option) any later version.
164+
165+ The GNU C Library is distributed in the hope that it will be useful,
166+ but WITHOUT ANY WARRANTY; without even the implied warranty of
167+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
168+ Lesser General Public License for more details.
169+
170+ You should have received a copy of the GNU Lesser General Public
171+ License along with the GNU C Library; if not, see
172+ <http://www.gnu.org/licenses/>. */
173+
174+#ifndef _BITS_STDIO_LIM_H
175+#define _BITS_STDIO_LIM_H 1
176+
177+#ifndef _STDIO_H
178+# error "Never include <bits/stdio_lim.h> directly; use <stdio.h> instead."
179+#endif
180+
181+#define FILENAME_MAX 1024
182+
183+#endif /* bits/stdio_lim.h */
184diff -Naur glibc-2.20/sysdeps/posix/Makefile glibc-2.20-patched/sysdeps/posix/Makefile
185--- glibc-2.20/sysdeps/posix/Makefile 2014-09-07 04:09:09.000000000 -0400
186+++ glibc-2.20-patched/sysdeps/posix/Makefile 1969-12-31 19:00:00.000000000 -0500
187@@ -1,5 +0,0 @@
188-# These affect the generated bits/stdio_lim.h file.
189-L_tmpnam = 20
190-TMP_MAX = 238328
191-L_ctermid = 9
192-L_cuserid = 9
193diff -Naur glibc-2.20/sysdeps/unix/sysv/linux/bits/stdio_lim.h glibc-2.20-patched/sysdeps/unix/sysv/linux/bits/stdio_lim.h
194--- glibc-2.20/sysdeps/unix/sysv/linux/bits/stdio_lim.h 1969-12-31 19:00:00.000000000 -0500
195+++ glibc-2.20-patched/sysdeps/unix/sysv/linux/bits/stdio_lim.h 2023-05-23 14:44:22.279872060 -0400
196@@ -0,0 +1,28 @@
197+/* System specific stdio.h definitions. Linux version.
198+ Copyright (C) 2023 Free Software Foundation, Inc.
199+ This file is part of the GNU C Library.
200+
201+ The GNU C Library is free software; you can redistribute it and/or
202+ modify it under the terms of the GNU Lesser General Public
203+ License as published by the Free Software Foundation; either
204+ version 2.1 of the License, or (at your option) any later version.
205+
206+ The GNU C Library is distributed in the hope that it will be useful,
207+ but WITHOUT ANY WARRANTY; without even the implied warranty of
208+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
209+ Lesser General Public License for more details.
210+
211+ You should have received a copy of the GNU Lesser General Public
212+ License along with the GNU C Library; if not, see
213+ <https://www.gnu.org/licenses/>. */
214+
215+#ifndef _BITS_STDIO_LIM_H
216+#define _BITS_STDIO_LIM_H 1
217+
218+//#ifndef _STDIO_H
219+//# error "Never include <bits/stdio_lim.h> directly; use <stdio.h> instead."
220+//#endif
221+
222+#define FILENAME_MAX 4096
223+
224+#endif /* bits/stdio_lim.h */