diff options
Diffstat (limited to 'meta/recipes-extended/zip/zip-3.0/0001-unix-configure-use-_Static_assert-to-do-correct-dete.patch')
-rw-r--r-- | meta/recipes-extended/zip/zip-3.0/0001-unix-configure-use-_Static_assert-to-do-correct-dete.patch | 96 |
1 files changed, 96 insertions, 0 deletions
diff --git a/meta/recipes-extended/zip/zip-3.0/0001-unix-configure-use-_Static_assert-to-do-correct-dete.patch b/meta/recipes-extended/zip/zip-3.0/0001-unix-configure-use-_Static_assert-to-do-correct-dete.patch new file mode 100644 index 0000000000..106f246a7c --- /dev/null +++ b/meta/recipes-extended/zip/zip-3.0/0001-unix-configure-use-_Static_assert-to-do-correct-dete.patch | |||
@@ -0,0 +1,96 @@ | |||
1 | From 9916fc6f1f93f3e092e3c6937c30dc8137c26d34 Mon Sep 17 00:00:00 2001 | ||
2 | From: Chen Qi <Qi.Chen@windriver.com> | ||
3 | Date: Thu, 15 Jun 2023 18:31:26 +0800 | ||
4 | Subject: [PATCH] unix/configure: use _Static_assert to do correct detection | ||
5 | |||
6 | We're doing cross compilation, running a cross-compiled problem | ||
7 | on host to detemine feature is not correct. Use _Static_assert | ||
8 | to do the detection correctly. | ||
9 | |||
10 | Upstream-Status: Inactive-Upstream | ||
11 | |||
12 | Signed-off-by: Chen Qi <Qi.Chen@windriver.com> | ||
13 | --- | ||
14 | unix/configure | 42 ++++++++++++------------------------------ | ||
15 | 1 file changed, 12 insertions(+), 30 deletions(-) | ||
16 | |||
17 | diff --git a/unix/configure b/unix/configure | ||
18 | index f2b3d02..f917086 100644 | ||
19 | --- a/unix/configure | ||
20 | +++ b/unix/configure | ||
21 | @@ -361,6 +361,10 @@ cat > conftest.c << _EOF_ | ||
22 | #include <sys/stat.h> | ||
23 | #include <unistd.h> | ||
24 | #include <stdio.h> | ||
25 | + | ||
26 | +_Static_assert(sizeof((struct stat){0}.st_uid) == 2, "sizeof st_uid is not 16 bit"); | ||
27 | +_Static_assert(sizeof((struct stat){0}.st_gid) == 2, "sizeof st_gid is not 16 bit"); | ||
28 | + | ||
29 | int main() | ||
30 | { | ||
31 | struct stat s; | ||
32 | @@ -385,21 +389,7 @@ if [ $? -ne 0 ]; then | ||
33 | echo -- UID/GID test failed on compile - disabling old 16-bit UID/GID support | ||
34 | CFLAGS="${CFLAGS} -DUIDGID_NOT_16BIT" | ||
35 | else | ||
36 | -# run it | ||
37 | - ./conftest | ||
38 | - r=$? | ||
39 | - if [ $r -eq 1 ]; then | ||
40 | - echo -- UID not 2 bytes - disabling old 16-bit UID/GID support | ||
41 | - CFLAGS="${CFLAGS} -DUIDGID_NOT_16BIT" | ||
42 | - elif [ $r -eq 2 ]; then | ||
43 | - echo -- GID not 2 bytes - disabling old 16-bit UID/GID support | ||
44 | - CFLAGS="${CFLAGS} -DUIDGID_NOT_16BIT" | ||
45 | - elif [ $r -eq 3 ]; then | ||
46 | - echo -- 16-bit UIDs and GIDs - keeping old 16-bit UID/GID support | ||
47 | - else | ||
48 | - echo -- test failed - conftest returned $r - disabling old 16-bit UID/GID support | ||
49 | - CFLAGS="${CFLAGS} -DUIDGID_NOT_16BIT" | ||
50 | - fi | ||
51 | + echo -- 16-bit UIDs and GIDs - keeping old 16-bit UID/GID support | ||
52 | fi | ||
53 | |||
54 | |||
55 | @@ -417,6 +407,10 @@ cat > conftest.c << _EOF_ | ||
56 | #include <sys/stat.h> | ||
57 | #include <unistd.h> | ||
58 | #include <stdio.h> | ||
59 | + | ||
60 | +_Static_assert(sizeof(off_t) < 8, "sizeof off_t < 8 failed"); | ||
61 | +_Static_assert(sizeof((struct stat){0}.st_size) < 8, "sizeof st_size < 8 failed"); | ||
62 | + | ||
63 | int main() | ||
64 | { | ||
65 | off_t offset; | ||
66 | @@ -436,24 +430,12 @@ _EOF_ | ||
67 | # compile it | ||
68 | $CC -o conftest conftest.c >/dev/null 2>/dev/null | ||
69 | if [ $? -ne 0 ]; then | ||
70 | - echo -- no Large File Support | ||
71 | + echo -- yes we have Large File Support! | ||
72 | + CFLAGS="${CFLAGS} -DLARGE_FILE_SUPPORT" | ||
73 | else | ||
74 | -# run it | ||
75 | - ./conftest | ||
76 | - r=$? | ||
77 | - if [ $r -eq 1 ]; then | ||
78 | - echo -- no Large File Support - no 64-bit off_t | ||
79 | - elif [ $r -eq 2 ]; then | ||
80 | - echo -- no Large File Support - no 64-bit stat | ||
81 | - elif [ $r -eq 3 ]; then | ||
82 | - echo -- yes we have Large File Support! | ||
83 | - CFLAGS="${CFLAGS} -DLARGE_FILE_SUPPORT" | ||
84 | - else | ||
85 | - echo -- no Large File Support - conftest returned $r | ||
86 | - fi | ||
87 | + echo -- no Large File Support | ||
88 | fi | ||
89 | |||
90 | - | ||
91 | # Check for wide char for Unicode support | ||
92 | # Added 11/24/2005 EG | ||
93 | |||
94 | -- | ||
95 | 2.34.1 | ||
96 | |||