summaryrefslogtreecommitdiffstats
path: root/meta-python/recipes-devtools/python/python3-inflate64/0001-Do-not-override-const-qualifier.patch
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2024-07-02 22:18:25 -0700
committerKhem Raj <raj.khem@gmail.com>2024-07-02 22:21:18 -0700
commit26d0e97ce2b10ab8753f7b3c0b12fbff887b2fad (patch)
treec914b867406889b4da8a31ca4b079b54a606f096 /meta-python/recipes-devtools/python/python3-inflate64/0001-Do-not-override-const-qualifier.patch
parent0ae8adcd63c27a6a4dbe46b6950d1607b2ef8abe (diff)
downloadmeta-openembedded-26d0e97ce2b10ab8753f7b3c0b12fbff887b2fad.tar.gz
python3-inflate64: Fix build with clang fortified glibc headers
This issue is seen with upcoming glibc 2.40 Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-python/recipes-devtools/python/python3-inflate64/0001-Do-not-override-const-qualifier.patch')
-rw-r--r--meta-python/recipes-devtools/python/python3-inflate64/0001-Do-not-override-const-qualifier.patch83
1 files changed, 83 insertions, 0 deletions
diff --git a/meta-python/recipes-devtools/python/python3-inflate64/0001-Do-not-override-const-qualifier.patch b/meta-python/recipes-devtools/python/python3-inflate64/0001-Do-not-override-const-qualifier.patch
new file mode 100644
index 0000000000..5391a11da0
--- /dev/null
+++ b/meta-python/recipes-devtools/python/python3-inflate64/0001-Do-not-override-const-qualifier.patch
@@ -0,0 +1,83 @@
1From 7e3a795cbeea94b3324aa926f2b11904cb169acc Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Tue, 2 Jul 2024 22:02:38 -0700
4Subject: [PATCH] Do not override 'const' qualifier
5
6This has worked so far but with fortified system headers from
7Glibc 2.40+ and clang compiler it ends up in compile errors
8
9| In file included from /mnt/b/yoe/master/build/tmp/work/riscv64-yoe-linux/python3-inflate64/1.0.0/recipe-sysroot/usr/include/string.h:548:
10| /mnt/b/yoe/master/build/tmp/work/riscv64-yoe-linux/python3-inflate64/1.0.0/recipe-sysroot/usr/include/bits/string_fortified.h:77:66: error: pass_object_size attribute only applies to constant pointer arguments
11| 77 | __NTH (strcpy (__fortify_clang_overload_arg (char *, __restrict, __dest),
12| | ^
13| /mnt/b/yoe/master/build/tmp/work/riscv64-yoe-linux/python3-inflate64/1.0.0/recipe-sysroot/usr/include/bits/string_fortified.h:86:66: error: pass_object_size attribute only applies to constant pointer arguments
14| 86 | __NTH (stpcpy (__fortify_clang_overload_arg (char *, __restrict, __dest),
15| | ^
16| /mnt/b/yoe/master/build/tmp/work/riscv64-yoe-linux/python3-inflate64/1.0.0/recipe-sysroot/usr/include/bits/string_fortified.h:96:67: error: pass_object_size attribute only applies to constant pointer arguments
17| 96 | __NTH (strncpy (__fortify_clang_overload_arg (char *, __restrict, __dest),
18| | ^
19| /mnt/b/yoe/master/build/tmp/work/riscv64-yoe-linux/python3-inflate64/1.0.0/recipe-sysroot/usr/include/bits/string_fortified.h:107:56: error: pass_object_size attribute only applies to constant pointer arguments
20| 107 | __NTH (stpncpy (__fortify_clang_overload_arg (char *, ,__dest),
21| | ^
22| /mnt/b/yoe/master/build/tmp/work/riscv64-yoe-linux/python3-inflate64/1.0.0/recipe-sysroot/usr/include/bits/string_fortified.h:136:66: error: pass_object_size attribute only applies to constant pointer arguments
23| 136 | __NTH (strcat (__fortify_clang_overload_arg (char *, __restrict, __dest),
24| | ^
25| /mnt/b/yoe/master/build/tmp/work/riscv64-yoe-linux/python3-inflate64/1.0.0/recipe-sysroot/usr/include/bits/string_fortified.h:145:67: error: pass_object_size attribute only applies to constant pointer arguments
26| 145 | __NTH (strncat (__fortify_clang_overload_arg (char *, __restrict, __dest),
27| | ^
28| /mnt/b/yoe/master/build/tmp/work/riscv64-yoe-linux/python3-inflate64/1.0.0/recipe-sysroot/usr/include/bits/string_fortified.h:161:67: error: pass_object_size attribute only applies to constant pointer arguments
29| 161 | __NTH (strlcpy (__fortify_clang_overload_arg (char *, __restrict, __dest),
30
31Therefore adjust needed places to use const qualifier
32
33Upstream-Status: Submitted [https://codeberg.org/miurahr/inflate64/pulls/13]
34Signed-off-by: Khem Raj <raj.khem@gmail.com>
35---
36 src/lib/deflate.h | 2 +-
37 src/lib/deflate_tree.c | 4 ++--
38 src/lib/inflate64_config.h | 3 ---
39 3 files changed, 3 insertions(+), 6 deletions(-)
40
41diff --git a/src/lib/deflate.h b/src/lib/deflate.h
42index 72a324f..c780be9 100644
43--- a/src/lib/deflate.h
44+++ b/src/lib/deflate.h
45@@ -288,6 +288,6 @@ void ZLIB_INTERNAL _tr_stored_block OF((deflate_state *s, char FAR *buf,
46 extern const unsigned char ZLIB_INTERNAL _dist_code[];
47 #endif
48 #endif
49-extern uch ZLIB_INTERNAL length_code[];
50+extern const uch ZLIB_INTERNAL length_code[];
51
52 #endif /* DEFLATE_H */
53diff --git a/src/lib/deflate_tree.c b/src/lib/deflate_tree.c
54index 5a66139..cdee934 100644
55--- a/src/lib/deflate_tree.c
56+++ b/src/lib/deflate_tree.c
57@@ -78,10 +78,10 @@ local const uch bl_order[BL_CODES]
58
59 #define DIST_CODE_LEN 768 /* see definition of array dist_code below */
60
61-local int base_length[LENGTH_CODES];
62+local const int base_length[LENGTH_CODES];
63 /* First normalized length for each code (0 = MIN_MATCH) */
64
65-uch length_code[BASE_MATCH-MIN_MATCH+1];
66+const uch length_code[BASE_MATCH-MIN_MATCH+1];
67 /* length code for each normalized match length (0 == MIN_MATCH) */
68
69 #if defined(GEN_TREES_H) || !defined(STDC)
70diff --git a/src/lib/inflate64_config.h b/src/lib/inflate64_config.h
71index 16cfd12..ade7300 100644
72--- a/src/lib/inflate64_config.h
73+++ b/src/lib/inflate64_config.h
74@@ -53,9 +53,6 @@
75 # define FAR
76 #endif
77
78-#ifndef const
79-# define const
80-#endif
81 #define z_const const
82
83 typedef unsigned char uch;