diff options
author | Martin Jansa <Martin.Jansa@gmail.com> | 2023-03-13 21:20:22 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2023-03-14 17:13:11 +0000 |
commit | 607ad000c1d227fce3bb97d8ae34b718b04cfd83 (patch) | |
tree | cef1e0c7119bd8cc8ab745cf33d44c002e4e4d23 /meta/recipes-extended/timezone | |
parent | 5ec86bd4fad0841e82a5031d34743f434ffd890b (diff) | |
download | poky-607ad000c1d227fce3bb97d8ae34b718b04cfd83.tar.gz |
tzcode-native: fix build with gcc-13 on host
* passing -std=c2x to avoid build failure with gcc-13 on host
works as well, but the resulting zic then segfaults when
used in tzdata, use a fix from upstream instead
* reported upstream in https://mm.icann.org/pipermail/tz/2023-March/032690.html
* fixes:
http://errors.yoctoproject.org/Errors/Details/697913/
(From OE-Core rev: 5dabf677f38c209fb6a8ba837d5a66fd89f57d4d)
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-extended/timezone')
-rw-r--r-- | meta/recipes-extended/timezone/tzcode-native.bb | 2 | ||||
-rw-r--r-- | meta/recipes-extended/timezone/tzcode/0001-Fix-C23-related-conformance-bug.patch | 301 |
2 files changed, 303 insertions, 0 deletions
diff --git a/meta/recipes-extended/timezone/tzcode-native.bb b/meta/recipes-extended/timezone/tzcode-native.bb index d0b23a9d80..6d52b3c422 100644 --- a/meta/recipes-extended/timezone/tzcode-native.bb +++ b/meta/recipes-extended/timezone/tzcode-native.bb | |||
@@ -2,6 +2,8 @@ require timezone.inc | |||
2 | 2 | ||
3 | SUMMARY = "tzcode, timezone zoneinfo utils -- zic, zdump, tzselect" | 3 | SUMMARY = "tzcode, timezone zoneinfo utils -- zic, zdump, tzselect" |
4 | 4 | ||
5 | SRC_URI += "file://0001-Fix-C23-related-conformance-bug.patch" | ||
6 | |||
5 | inherit native | 7 | inherit native |
6 | 8 | ||
7 | EXTRA_OEMAKE += "cc='${CC}'" | 9 | EXTRA_OEMAKE += "cc='${CC}'" |
diff --git a/meta/recipes-extended/timezone/tzcode/0001-Fix-C23-related-conformance-bug.patch b/meta/recipes-extended/timezone/tzcode/0001-Fix-C23-related-conformance-bug.patch new file mode 100644 index 0000000000..c91ef93e95 --- /dev/null +++ b/meta/recipes-extended/timezone/tzcode/0001-Fix-C23-related-conformance-bug.patch | |||
@@ -0,0 +1,301 @@ | |||
1 | From 509c5974398952618abdd17f39117b88e3f50057 Mon Sep 17 00:00:00 2001 | ||
2 | From: Paul Eggert <eggert@cs.ucla.edu> | ||
3 | Date: Thu, 1 Dec 2022 10:28:04 -0800 | ||
4 | Subject: [PATCH] Fix C23-related conformance bug | ||
5 | MIME-Version: 1.0 | ||
6 | Content-Type: text/plain; charset=UTF-8 | ||
7 | Content-Transfer-Encoding: 8bit | ||
8 | |||
9 | Problem reported by Houge Langley for ‘gcc -std=gnu99’ in: | ||
10 | https://bugs.gentoo.org/show_bug.cgi?id=883719 | ||
11 | * NEWS: Mention this. | ||
12 | * date.c, localtime.c, private.h, zdump.c, zic.c: | ||
13 | Use ATTRIBUTE_* at the start of function declarations, | ||
14 | not later (such as after the keyword ‘static’). | ||
15 | This is required for strict conformance to C23. | ||
16 | |||
17 | Upstream-Status: Backport [https://github.com/eggert/tz/commit/9cfe9507fcc22cd4a0c4da486ea1c7f0de6b075f] | ||
18 | |||
19 | NEWS change skipped to avoid conflicts. | ||
20 | |||
21 | Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> | ||
22 | --- | ||
23 | date.c | 2 +- | ||
24 | localtime.c | 4 ++-- | ||
25 | private.h | 6 +++--- | ||
26 | zdump.c | 12 ++++++------ | ||
27 | zic.c | 34 +++++++++++++++++----------------- | ||
28 | 5 files changed, 29 insertions(+), 29 deletions(-) | ||
29 | |||
30 | diff --git a/date.c b/date.c | ||
31 | index 11c5e5fe..97df6ab0 100644 | ||
32 | --- a/date.c | ||
33 | +++ b/date.c | ||
34 | @@ -42,7 +42,7 @@ static void display(const char *, time_t); | ||
35 | static void dogmt(void); | ||
36 | static void errensure(void); | ||
37 | static void timeout(FILE *, const char *, const struct tm *); | ||
38 | -static ATTRIBUTE_NORETURN void usage(void); | ||
39 | +ATTRIBUTE_NORETURN static void usage(void); | ||
40 | |||
41 | int | ||
42 | main(const int argc, char *argv[]) | ||
43 | diff --git a/localtime.c b/localtime.c | ||
44 | index 1d22d351..3bf1b911 100644 | ||
45 | --- a/localtime.c | ||
46 | +++ b/localtime.c | ||
47 | @@ -838,7 +838,7 @@ is_digit(char c) | ||
48 | ** Return a pointer to that character. | ||
49 | */ | ||
50 | |||
51 | -static ATTRIBUTE_REPRODUCIBLE const char * | ||
52 | +ATTRIBUTE_REPRODUCIBLE static const char * | ||
53 | getzname(register const char *strp) | ||
54 | { | ||
55 | register char c; | ||
56 | @@ -859,7 +859,7 @@ getzname(register const char *strp) | ||
57 | ** We don't do any checking here; checking is done later in common-case code. | ||
58 | */ | ||
59 | |||
60 | -static ATTRIBUTE_REPRODUCIBLE const char * | ||
61 | +ATTRIBUTE_REPRODUCIBLE static const char * | ||
62 | getqzname(register const char *strp, const int delim) | ||
63 | { | ||
64 | register int c; | ||
65 | diff --git a/private.h b/private.h | ||
66 | index 7a73eff7..ae522986 100644 | ||
67 | --- a/private.h | ||
68 | +++ b/private.h | ||
69 | @@ -628,7 +628,7 @@ char *asctime(struct tm const *); | ||
70 | char *asctime_r(struct tm const *restrict, char *restrict); | ||
71 | char *ctime(time_t const *); | ||
72 | char *ctime_r(time_t const *, char *); | ||
73 | -double difftime(time_t, time_t) ATTRIBUTE_UNSEQUENCED; | ||
74 | +ATTRIBUTE_UNSEQUENCED double difftime(time_t, time_t); | ||
75 | size_t strftime(char *restrict, size_t, char const *restrict, | ||
76 | struct tm const *restrict); | ||
77 | # if HAVE_STRFTIME_L | ||
78 | @@ -740,10 +740,10 @@ timezone_t tzalloc(char const *); | ||
79 | void tzfree(timezone_t); | ||
80 | # ifdef STD_INSPIRED | ||
81 | # if TZ_TIME_T || !defined posix2time_z | ||
82 | -time_t posix2time_z(timezone_t, time_t) ATTRIBUTE_REPRODUCIBLE; | ||
83 | +ATTRIBUTE_REPRODUCIBLE time_t posix2time_z(timezone_t, time_t); | ||
84 | # endif | ||
85 | # if TZ_TIME_T || !defined time2posix_z | ||
86 | -time_t time2posix_z(timezone_t, time_t) ATTRIBUTE_REPRODUCIBLE; | ||
87 | +ATTRIBUTE_REPRODUCIBLE time_t time2posix_z(timezone_t, time_t); | ||
88 | # endif | ||
89 | # endif | ||
90 | #endif | ||
91 | diff --git a/zdump.c b/zdump.c | ||
92 | index 7acb3e2d..3e482ba3 100644 | ||
93 | --- a/zdump.c | ||
94 | +++ b/zdump.c | ||
95 | @@ -89,7 +89,7 @@ static bool warned; | ||
96 | static bool errout; | ||
97 | |||
98 | static char const *abbr(struct tm const *); | ||
99 | -static intmax_t delta(struct tm *, struct tm *) ATTRIBUTE_REPRODUCIBLE; | ||
100 | +ATTRIBUTE_REPRODUCIBLE static intmax_t delta(struct tm *, struct tm *); | ||
101 | static void dumptime(struct tm const *); | ||
102 | static time_t hunt(timezone_t, time_t, time_t, bool); | ||
103 | static void show(timezone_t, char *, time_t, bool); | ||
104 | @@ -97,7 +97,7 @@ static void showextrema(timezone_t, char *, time_t, struct tm *, time_t); | ||
105 | static void showtrans(char const *, struct tm const *, time_t, char const *, | ||
106 | char const *); | ||
107 | static const char *tformat(void); | ||
108 | -static time_t yeartot(intmax_t) ATTRIBUTE_REPRODUCIBLE; | ||
109 | +ATTRIBUTE_REPRODUCIBLE static time_t yeartot(intmax_t); | ||
110 | |||
111 | /* Is C an ASCII digit? */ | ||
112 | static bool | ||
113 | @@ -125,7 +125,7 @@ is_alpha(char a) | ||
114 | } | ||
115 | } | ||
116 | |||
117 | -static ATTRIBUTE_NORETURN void | ||
118 | +ATTRIBUTE_NORETURN static void | ||
119 | size_overflow(void) | ||
120 | { | ||
121 | fprintf(stderr, _("%s: size overflow\n"), progname); | ||
122 | @@ -134,7 +134,7 @@ size_overflow(void) | ||
123 | |||
124 | /* Return A + B, exiting if the result would overflow either ptrdiff_t | ||
125 | or size_t. */ | ||
126 | -static ATTRIBUTE_REPRODUCIBLE ptrdiff_t | ||
127 | +ATTRIBUTE_REPRODUCIBLE static ptrdiff_t | ||
128 | sumsize(size_t a, size_t b) | ||
129 | { | ||
130 | #ifdef ckd_add | ||
131 | @@ -151,7 +151,7 @@ sumsize(size_t a, size_t b) | ||
132 | |||
133 | /* Return a pointer to a newly allocated buffer of size SIZE, exiting | ||
134 | on failure. SIZE should be nonzero. */ | ||
135 | -static void * ATTRIBUTE_MALLOC | ||
136 | +ATTRIBUTE_MALLOC static void * | ||
137 | xmalloc(size_t size) | ||
138 | { | ||
139 | void *p = malloc(size); | ||
140 | @@ -920,7 +920,7 @@ showextrema(timezone_t tz, char *zone, time_t lo, struct tm *lotmp, time_t hi) | ||
141 | # include <stdarg.h> | ||
142 | |||
143 | /* A substitute for snprintf that is good enough for zdump. */ | ||
144 | -static int ATTRIBUTE_FORMAT((printf, 3, 4)) | ||
145 | +ATTRIBUTE_FORMAT((printf, 3, 4)) static int | ||
146 | my_snprintf(char *s, size_t size, char const *format, ...) | ||
147 | { | ||
148 | int n; | ||
149 | diff --git a/zic.c b/zic.c | ||
150 | index 892414af..f143fcef 100644 | ||
151 | --- a/zic.c | ||
152 | +++ b/zic.c | ||
153 | @@ -459,20 +459,20 @@ static char roll[TZ_MAX_LEAPS]; | ||
154 | ** Memory allocation. | ||
155 | */ | ||
156 | |||
157 | -static ATTRIBUTE_NORETURN void | ||
158 | +ATTRIBUTE_NORETURN static void | ||
159 | memory_exhausted(const char *msg) | ||
160 | { | ||
161 | fprintf(stderr, _("%s: Memory exhausted: %s\n"), progname, msg); | ||
162 | exit(EXIT_FAILURE); | ||
163 | } | ||
164 | |||
165 | -static ATTRIBUTE_NORETURN void | ||
166 | +ATTRIBUTE_NORETURN static void | ||
167 | size_overflow(void) | ||
168 | { | ||
169 | memory_exhausted(_("size overflow")); | ||
170 | } | ||
171 | |||
172 | -static ATTRIBUTE_REPRODUCIBLE ptrdiff_t | ||
173 | +ATTRIBUTE_REPRODUCIBLE static ptrdiff_t | ||
174 | size_sum(size_t a, size_t b) | ||
175 | { | ||
176 | #ifdef ckd_add | ||
177 | @@ -487,7 +487,7 @@ size_sum(size_t a, size_t b) | ||
178 | size_overflow(); | ||
179 | } | ||
180 | |||
181 | -static ATTRIBUTE_REPRODUCIBLE ptrdiff_t | ||
182 | +ATTRIBUTE_REPRODUCIBLE static ptrdiff_t | ||
183 | size_product(ptrdiff_t nitems, ptrdiff_t itemsize) | ||
184 | { | ||
185 | #ifdef ckd_mul | ||
186 | @@ -502,7 +502,7 @@ size_product(ptrdiff_t nitems, ptrdiff_t itemsize) | ||
187 | size_overflow(); | ||
188 | } | ||
189 | |||
190 | -static ATTRIBUTE_REPRODUCIBLE ptrdiff_t | ||
191 | +ATTRIBUTE_REPRODUCIBLE static ptrdiff_t | ||
192 | align_to(ptrdiff_t size, ptrdiff_t alignment) | ||
193 | { | ||
194 | ptrdiff_t lo_bits = alignment - 1, sum = size_sum(size, lo_bits); | ||
195 | @@ -526,7 +526,7 @@ memcheck(void *ptr) | ||
196 | return ptr; | ||
197 | } | ||
198 | |||
199 | -static void * ATTRIBUTE_MALLOC | ||
200 | +ATTRIBUTE_MALLOC static void * | ||
201 | emalloc(size_t size) | ||
202 | { | ||
203 | return memcheck(malloc(size)); | ||
204 | @@ -538,7 +538,7 @@ erealloc(void *ptr, size_t size) | ||
205 | return memcheck(realloc(ptr, size)); | ||
206 | } | ||
207 | |||
208 | -static char * ATTRIBUTE_MALLOC | ||
209 | +ATTRIBUTE_MALLOC static char * | ||
210 | estrdup(char const *str) | ||
211 | { | ||
212 | return memcheck(strdup(str)); | ||
213 | @@ -608,7 +608,7 @@ eat(int fnum, lineno num) | ||
214 | eats(fnum, num, 0, -1); | ||
215 | } | ||
216 | |||
217 | -static void ATTRIBUTE_FORMAT((printf, 1, 0)) | ||
218 | +ATTRIBUTE_FORMAT((printf, 1, 0)) static void | ||
219 | verror(const char *const string, va_list args) | ||
220 | { | ||
221 | /* | ||
222 | @@ -626,7 +626,7 @@ verror(const char *const string, va_list args) | ||
223 | fprintf(stderr, "\n"); | ||
224 | } | ||
225 | |||
226 | -static void ATTRIBUTE_FORMAT((printf, 1, 2)) | ||
227 | +ATTRIBUTE_FORMAT((printf, 1, 2)) static void | ||
228 | error(const char *const string, ...) | ||
229 | { | ||
230 | va_list args; | ||
231 | @@ -636,7 +636,7 @@ error(const char *const string, ...) | ||
232 | errors = true; | ||
233 | } | ||
234 | |||
235 | -static void ATTRIBUTE_FORMAT((printf, 1, 2)) | ||
236 | +ATTRIBUTE_FORMAT((printf, 1, 2)) static void | ||
237 | warning(const char *const string, ...) | ||
238 | { | ||
239 | va_list args; | ||
240 | @@ -666,7 +666,7 @@ close_file(FILE *stream, char const *dir, char const *name, | ||
241 | } | ||
242 | } | ||
243 | |||
244 | -static ATTRIBUTE_NORETURN void | ||
245 | +ATTRIBUTE_NORETURN static void | ||
246 | usage(FILE *stream, int status) | ||
247 | { | ||
248 | fprintf(stream, | ||
249 | @@ -3597,7 +3597,7 @@ lowerit(char a) | ||
250 | } | ||
251 | |||
252 | /* case-insensitive equality */ | ||
253 | -static ATTRIBUTE_REPRODUCIBLE bool | ||
254 | +ATTRIBUTE_REPRODUCIBLE static bool | ||
255 | ciequal(register const char *ap, register const char *bp) | ||
256 | { | ||
257 | while (lowerit(*ap) == lowerit(*bp++)) | ||
258 | @@ -3606,7 +3606,7 @@ ciequal(register const char *ap, register const char *bp) | ||
259 | return false; | ||
260 | } | ||
261 | |||
262 | -static ATTRIBUTE_REPRODUCIBLE bool | ||
263 | +ATTRIBUTE_REPRODUCIBLE static bool | ||
264 | itsabbr(register const char *abbr, register const char *word) | ||
265 | { | ||
266 | if (lowerit(*abbr) != lowerit(*word)) | ||
267 | @@ -3622,7 +3622,7 @@ itsabbr(register const char *abbr, register const char *word) | ||
268 | |||
269 | /* Return true if ABBR is an initial prefix of WORD, ignoring ASCII case. */ | ||
270 | |||
271 | -static ATTRIBUTE_REPRODUCIBLE bool | ||
272 | +ATTRIBUTE_REPRODUCIBLE static bool | ||
273 | ciprefix(char const *abbr, char const *word) | ||
274 | { | ||
275 | do | ||
276 | @@ -3725,14 +3725,14 @@ getfields(char *cp, char **array, int arrayelts) | ||
277 | return nsubs; | ||
278 | } | ||
279 | |||
280 | -static ATTRIBUTE_NORETURN void | ||
281 | +ATTRIBUTE_NORETURN static void | ||
282 | time_overflow(void) | ||
283 | { | ||
284 | error(_("time overflow")); | ||
285 | exit(EXIT_FAILURE); | ||
286 | } | ||
287 | |||
288 | -static ATTRIBUTE_REPRODUCIBLE zic_t | ||
289 | +ATTRIBUTE_REPRODUCIBLE static zic_t | ||
290 | oadd(zic_t t1, zic_t t2) | ||
291 | { | ||
292 | #ifdef ckd_add | ||
293 | @@ -3746,7 +3746,7 @@ oadd(zic_t t1, zic_t t2) | ||
294 | time_overflow(); | ||
295 | } | ||
296 | |||
297 | -static ATTRIBUTE_REPRODUCIBLE zic_t | ||
298 | +ATTRIBUTE_REPRODUCIBLE static zic_t | ||
299 | tadd(zic_t t1, zic_t t2) | ||
300 | { | ||
301 | #ifdef ckd_add | ||