summaryrefslogtreecommitdiffstats
path: root/meta/recipes-sato
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-sato')
-rw-r--r--meta/recipes-sato/puzzles/files/0001-malloc-Check-for-excessive-values-to-malloc.patch45
-rw-r--r--meta/recipes-sato/puzzles/files/0001-map-Fix-stringop-overflow-warning.patch34
-rw-r--r--meta/recipes-sato/puzzles/files/0001-palisade-Fix-warnings-with-clang-on-arm.patch72
-rw-r--r--meta/recipes-sato/puzzles/files/0001-pattern.c-Change-string-lenght-parameter-to-be-size_.patch30
-rw-r--r--meta/recipes-sato/puzzles/files/fix-compiling-failure-with-option-g-O.patch33
-rw-r--r--meta/recipes-sato/puzzles/files/fix-ki-uninitialized.patch32
-rw-r--r--meta/recipes-sato/puzzles/puzzles_git.bb11
7 files changed, 2 insertions, 255 deletions
diff --git a/meta/recipes-sato/puzzles/files/0001-malloc-Check-for-excessive-values-to-malloc.patch b/meta/recipes-sato/puzzles/files/0001-malloc-Check-for-excessive-values-to-malloc.patch
deleted file mode 100644
index b572b55d1c..0000000000
--- a/meta/recipes-sato/puzzles/files/0001-malloc-Check-for-excessive-values-to-malloc.patch
+++ /dev/null
@@ -1,45 +0,0 @@
1tree234: Avoid excessive values to malloc
2
3with whole program optimizers like lto, smalloc() is inlined the excessive
4constant argument is propagated to malloc() and ultimately triggers the warning.
5
6| tmp/work/core2-64-poky-linux/puzzles/2_0.0+gitAUTOINC+640f9235c7-r0/git/tree234.c: In function 'disptree':
7| tmp/work/core2-64-poky-linux/puzzles/2_0.0+gitAUTOINC+640f9235c7-r0/git/tree234.c:46:17: error: argument 1 value '18446744073709551612' exceeds maximum object size 9223372036854775807 [-Werror=alloc-size-larger-than=]
8| 46 | #define smalloc malloc
9| | ^
10| tmp/work/core2-64-poky-linux/puzzles/2_0.0+gitAUTOINC+640f9235c7-r0/git/tree234.c:1631:17: note: in expansion of macro 'smalloc'
11| 1631 | leveldata = smalloc(ht * (width+2));
12| | ^~~~~~~
13| In file included from tmp/work/core2-64-poky-linux/puzzles/2_0.0+gitAUTOINC+640f9235c7-r0/git/tree234.c:29:
14| tmp/work/core2-64-poky-linux/puzzles/2_0.0+gitAUTOINC+640f9235c7-r0/recipe-sysroot/usr/include/stdlib.h:539:14: note: in a call to allocation function 'malloc' declared here
15| 539 | extern void *malloc (size_t __size) __THROW __attribute_malloc__
16| | ^~~~~~
17| tmp/work/core2-64-poky-linux/puzzles/2_0.0+gitAUTOINC+640f9235c7-r0/git/tree234.c:46:17: error: argument 1 value '18446744073709551600' exceeds maximum object size 9223372036854775807 [-Werror=alloc-size-larger-than=]
18| 46 | #define smalloc malloc
19| | ^
20| tmp/work/core2-64-poky-linux/puzzles/2_0.0+gitAUTOINC+640f9235c7-r0/git/tree234.c:1632:18: note: in expansion of macro 'smalloc'
21| 1632 | ctx.levels = smalloc(ht * sizeof(char *));
22| | ^~~~~~~
23| In file included from tmp/work/core2-64-poky-linux/puzzles/2_0.0+gitAUTOINC+640f9235c7-r0/git/tree234.c:29:
24| tmp/work/core2-64-poky-linux/puzzles/2_0.0+gitAUTOINC+640f9235c7-r0/recipe-sysroot/usr/include/stdlib.h:539:14: note: in a call to allocation function 'malloc' declared here
25| 539 | extern void *malloc (size_t __size) __THROW __attribute_malloc__
26| | ^~~~~~
27| cc1: some warnings being treated as errors
28
29Upstream-Status: Submitted [email discussion with upstream]
30
31Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
32
33Index: git/tree234.c
34===================================================================
35--- git.orig/tree234.c
36+++ git/tree234.c
37@@ -1621,7 +1621,7 @@ void disptree(tree234 *t) {
38 dispctx ctx;
39 char *leveldata;
40 int width = count234(t);
41- int ht = height234(t) * 3 - 2;
42+ unsigned int ht = height234(t) * 3 - 2;
43 int i;
44
45 if (!t->root) {
diff --git a/meta/recipes-sato/puzzles/files/0001-map-Fix-stringop-overflow-warning.patch b/meta/recipes-sato/puzzles/files/0001-map-Fix-stringop-overflow-warning.patch
deleted file mode 100644
index 7f46d3ec0e..0000000000
--- a/meta/recipes-sato/puzzles/files/0001-map-Fix-stringop-overflow-warning.patch
+++ /dev/null
@@ -1,34 +0,0 @@
1From: Khem Raj <raj.khem@gmail.com>
2map: Fix stringop-overflow warning
3
4Fixes
5
6../git/map.c: In function 'new_game_desc':
7../git/map.c:1663:23: error: writing 1 byte into a region of size 0 [-Werror=stringop-overflow=]
8 1663 | ret[retlen++] = ',';
9 | ~~~~~~~~~~~~~~^~~~~
10../git/./map.c: In function 'new_game_desc':
11../git/./map.c:1663:23: error: writing 1 byte into a region of size 0 [-Werror=stringop-overflow=]
12 1663 | ret[retlen++] = ',';
13 | ~~~~~~~~~~~~~~^~~~~
14
15Upstream-Status: Submitted [email discussion with upstream]
16
17Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
18Signed-off-by: Khem Raj <raj.khem@gmail.com>
19
20Index: git/map.c
21===================================================================
22--- git.orig/map.c
23+++ git/map.c
24@@ -1659,6 +1659,10 @@ static char *new_game_desc(const game_pa
25 }
26 }
27
28+ if (retlen + 10 >= retsize) {
29+ retsize = retlen + 256;
30+ ret = sresize(ret, retsize, char);
31+ }
32 ret[retlen++] = 'a'-1 + run;
33 ret[retlen++] = ',';
34
diff --git a/meta/recipes-sato/puzzles/files/0001-palisade-Fix-warnings-with-clang-on-arm.patch b/meta/recipes-sato/puzzles/files/0001-palisade-Fix-warnings-with-clang-on-arm.patch
deleted file mode 100644
index 07eb1d32f6..0000000000
--- a/meta/recipes-sato/puzzles/files/0001-palisade-Fix-warnings-with-clang-on-arm.patch
+++ /dev/null
@@ -1,72 +0,0 @@
1From: Khem Raj <raj.khem@gmail.com>
2
3palisade: Fix warnings with clang on arm
4
5ARM treats 'char' as unsigned char when 'char' is not qualified with
6'signed' or 'unsigned' explicitly.
7
8This results in warnings e.g.
9
10palisade.c:531:22: error: comparison of constant -1 with expression of
11type 'clue' (aka 'char') is always false
12[-Werror,-Wtautological-constant-out-of-range-compare]
13 if (clues[i] == EMPTY) continue;
14
15Therefore, typcast the contant to char in such places to be explicit
16
17Upstream-Status: Submitted [email discussion with upstream]
18
19Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
20Signed-off-by: Khem Raj <raj.khem@gmail.com>
21
22Index: git/palisade.c
23===================================================================
24--- git.orig/palisade.c
25+++ git/palisade.c
26@@ -46,7 +46,7 @@ struct game_params {
27 int w, h, k;
28 };
29
30-typedef char clue;
31+typedef signed char clue;
32 typedef unsigned char borderflag;
33
34 typedef struct shared_state {
35@@ -242,7 +242,7 @@ typedef struct solver_ctx {
36 * thing is done. See how it is propagated across multiple squares.]
37 */
38
39-#define EMPTY (~0)
40+#define EMPTY ((clue)-1)
41
42 #define BIT(i) (1 << (i))
43 #define BORDER(i) BIT(i)
44@@ -622,7 +622,7 @@ static char *new_game_desc(const game_pa
45 {
46 int w = params->w, h = params->h, wh = w*h, k = params->k;
47
48- clue *numbers = snewn(wh + 1, clue), *p;
49+ clue *numbers = snewn(wh + 1, clue);
50 borderflag *rim = snewn(wh, borderflag);
51 borderflag *scratch_borders = snewn(wh, borderflag);
52
53@@ -682,7 +682,8 @@ static char *new_game_desc(const game_pa
54 sfree(shuf);
55 sfree(dsf);
56
57- p = numbers;
58+ char *output = snewn(wh + 1, char), *p = output;
59+
60 r = 0;
61 for (i = 0; i < wh; ++i) {
62 if (numbers[i] != EMPTY) {
63@@ -699,7 +700,8 @@ static char *new_game_desc(const game_pa
64 }
65 *p++ = '\0';
66
67- return sresize(numbers, p - numbers, clue);
68+ sfree(numbers);
69+ return sresize(output, p - output, char);
70 }
71
72 static const char *validate_desc(const game_params *params, const char *desc)
diff --git a/meta/recipes-sato/puzzles/files/0001-pattern.c-Change-string-lenght-parameter-to-be-size_.patch b/meta/recipes-sato/puzzles/files/0001-pattern.c-Change-string-lenght-parameter-to-be-size_.patch
deleted file mode 100644
index 5e240bfea5..0000000000
--- a/meta/recipes-sato/puzzles/files/0001-pattern.c-Change-string-lenght-parameter-to-be-size_.patch
+++ /dev/null
@@ -1,30 +0,0 @@
1From: Khem Raj <raj.khem@gmail.com>
2
3pattern.c: Change string lenght parameter to be size_t in do_row()
4
5This fixes below error on some architectures e.g. RISC-V
6
7pattern.c:455:9: error: 'memset' specified size between 18446744071562067968 and 18446744073709551615 exceeds maximum object size 9223372036854775807 [-Werror=stringop-overflow=] 455 | memset(deduced, DOT, (size_t)len); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
8
9Upstream-Status: Submitted [email discussion with upstream]
10
11Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
12Signed-off-by: Khem Raj <raj.khem@gmail.com>
13
14---
15 pattern.c | 2 +-
16 1 file changed, 1 insertion(+), 1 deletion(-)
17
18Index: git/pattern.c
19===================================================================
20--- git.orig/pattern.c
21+++ git/pattern.c
22@@ -429,7 +429,7 @@ static bool do_row(unsigned char *known,
23 unsigned char *row,
24 unsigned char *minpos_done, unsigned char *maxpos_done,
25 unsigned char *minpos_ok, unsigned char *maxpos_ok,
26- unsigned char *start, int len, int step, int *data,
27+ unsigned char *start, size_t len, int step, int *data,
28 unsigned int *changed
29 #ifdef STANDALONE_SOLVER
30 , const char *rowcol, int index, int cluewid
diff --git a/meta/recipes-sato/puzzles/files/fix-compiling-failure-with-option-g-O.patch b/meta/recipes-sato/puzzles/files/fix-compiling-failure-with-option-g-O.patch
deleted file mode 100644
index 4ee7543166..0000000000
--- a/meta/recipes-sato/puzzles/files/fix-compiling-failure-with-option-g-O.patch
+++ /dev/null
@@ -1,33 +0,0 @@
1From: Hongxu Jia <hongxu.jia@windriver.com>
2
3gtk.c: fix compiling failure with option -g -O
4
5There was a compile failure with option -g -O
6...
7././gtk.c: In function 'main':
8././gtk.c:2911:6: error: 'error' may be used uninitialized in this function [-Werror=maybe-uninitialized]
9 fprintf(stderr, "%s: %s\n", pname, error);
10 ^
11cc1: all warnings being treated as errors
12...
13
14Fix by initializing pointer 'error' with NULL
15
16Upstream-Status: Submitted [email discussion with upstream]
17
18Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
19Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
20
21Index: git/gtk.c
22===================================================================
23--- git.orig/gtk.c
24+++ git/gtk.c
25@@ -3578,7 +3578,7 @@ static void list_presets_from_menu(struc
26 int main(int argc, char **argv)
27 {
28 char *pname = argv[0];
29- char *error;
30+ char *error = NULL;
31 int ngenerate = 0, px = 1, py = 1;
32 bool print = false;
33 bool time_generation = false, test_solve = false, list_presets = false;
diff --git a/meta/recipes-sato/puzzles/files/fix-ki-uninitialized.patch b/meta/recipes-sato/puzzles/files/fix-ki-uninitialized.patch
deleted file mode 100644
index b182240240..0000000000
--- a/meta/recipes-sato/puzzles/files/fix-ki-uninitialized.patch
+++ /dev/null
@@ -1,32 +0,0 @@
1tree123: avoid compiler unitialized variable error
2
3The compiler does not realize that we must go through the while()
4loop at least once, so we replace it with a for() loop.
5
6Upstream-Status: Submitted [email discussion with upstream]
7
8Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9Signed-off-by: Joe Slater <joe.slater@windriver.com>
10
11Index: git/tree234.c
12===================================================================
13--- git.orig/tree234.c
14+++ git/tree234.c
15@@ -335,7 +335,7 @@ static void *add234_internal(tree234 *t,
16 }
17
18 n = t->root;
19- while (n) {
20+ do {
21 LOG((" node %p: %p/%d \"%s\" %p/%d \"%s\" %p/%d \"%s\" %p/%d\n",
22 n,
23 n->kids[0], n->counts[0], n->elems[0],
24@@ -388,7 +388,7 @@ static void *add234_internal(tree234 *t,
25 if (!n->kids[ki])
26 break;
27 n = n->kids[ki];
28- }
29+ } while (n);
30
31 add234_insert(NULL, e, NULL, &t->root, n, ki);
32
diff --git a/meta/recipes-sato/puzzles/puzzles_git.bb b/meta/recipes-sato/puzzles/puzzles_git.bb
index 8ac62d52e5..f2fe7d7b96 100644
--- a/meta/recipes-sato/puzzles/puzzles_git.bb
+++ b/meta/recipes-sato/puzzles/puzzles_git.bb
@@ -7,17 +7,10 @@ LIC_FILES_CHKSUM = "file://LICENCE;md5=6e7d24cf1c949887ee9447a1e2a4a24c"
7# gtk support includes a bunch of x11 headers 7# gtk support includes a bunch of x11 headers
8REQUIRED_DISTRO_FEATURES = "x11" 8REQUIRED_DISTRO_FEATURES = "x11"
9 9
10SRC_URI = "git://git.tartarus.org/simon/puzzles.git;branch=main \ 10SRC_URI = "git://git.tartarus.org/simon/puzzles.git;branch=main"
11 file://fix-compiling-failure-with-option-g-O.patch \
12 file://0001-palisade-Fix-warnings-with-clang-on-arm.patch \
13 file://0001-pattern.c-Change-string-lenght-parameter-to-be-size_.patch \
14 file://fix-ki-uninitialized.patch \
15 file://0001-malloc-Check-for-excessive-values-to-malloc.patch \
16 file://0001-map-Fix-stringop-overflow-warning.patch \
17 "
18 11
19UPSTREAM_CHECK_COMMITS = "1" 12UPSTREAM_CHECK_COMMITS = "1"
20SRCREV = "640f9235c79cdb1a924b0148cb312b0f02253364" 13SRCREV = "b56c994b721f7cb5c5bcf09c5d695d4ae07d3052"
21PE = "2" 14PE = "2"
22PV = "0.0+git${SRCPV}" 15PV = "0.0+git${SRCPV}"
23 16