diff options
Diffstat (limited to 'meta/recipes-extended/unzip/unzip/0001-unix-configure-fix-detection-for-cross-compilation.patch')
-rw-r--r-- | meta/recipes-extended/unzip/unzip/0001-unix-configure-fix-detection-for-cross-compilation.patch | 103 |
1 files changed, 103 insertions, 0 deletions
diff --git a/meta/recipes-extended/unzip/unzip/0001-unix-configure-fix-detection-for-cross-compilation.patch b/meta/recipes-extended/unzip/unzip/0001-unix-configure-fix-detection-for-cross-compilation.patch new file mode 100644 index 0000000000..2fa7f481b7 --- /dev/null +++ b/meta/recipes-extended/unzip/unzip/0001-unix-configure-fix-detection-for-cross-compilation.patch | |||
@@ -0,0 +1,103 @@ | |||
1 | From 5cbf901b5c3b6a7d1d0ed91b6df4194bb6d25a40 Mon Sep 17 00:00:00 2001 | ||
2 | From: Chen Qi <Qi.Chen@windriver.com> | ||
3 | Date: Thu, 15 Jun 2023 07:14:17 -0700 | ||
4 | Subject: [PATCH] unix/configure: fix detection for cross compilation | ||
5 | |||
6 | We're doing cross compilation, running a cross-compiled problem | ||
7 | on host to detemine feature is not correct. So we change runtime | ||
8 | check into compile-time check to detect the features. | ||
9 | |||
10 | Upstream-Status: Inactive-Upstream | ||
11 | |||
12 | Signed-off-by: Chen Qi <Qi.Chen@windriver.com> | ||
13 | --- | ||
14 | unix/configure | 44 +++++++++++++++----------------------------- | ||
15 | 1 file changed, 15 insertions(+), 29 deletions(-) | ||
16 | |||
17 | diff --git a/unix/configure b/unix/configure | ||
18 | index 8fd82dd..68dee98 100755 | ||
19 | --- a/unix/configure | ||
20 | +++ b/unix/configure | ||
21 | @@ -259,6 +259,10 @@ cat > conftest.c << _EOF_ | ||
22 | #include <sys/stat.h> | ||
23 | #include <unistd.h> | ||
24 | #include <stdio.h> | ||
25 | + | ||
26 | +_Static_assert(sizeof(off_t) < 8, "sizeof off_t < 8 failed"); | ||
27 | +_Static_assert(sizeof((struct stat){0}.st_size) < 8, "sizeof st_size < 8 failed"); | ||
28 | + | ||
29 | int main() | ||
30 | { | ||
31 | off_t offset; | ||
32 | @@ -278,21 +282,10 @@ _EOF_ | ||
33 | # compile it | ||
34 | $CC $CFLAGS $LDFLAGS -o conftest conftest.c >/dev/null 2>/dev/null | ||
35 | if [ $? -ne 0 ]; then | ||
36 | - echo -- no Large File Support | ||
37 | + echo -- yes we have Large File Support! | ||
38 | + CFLAGSR="${CFLAGSR} -DLARGE_FILE_SUPPORT" | ||
39 | else | ||
40 | -# run it | ||
41 | - ./conftest | ||
42 | - r=$? | ||
43 | - if [ $r -eq 1 ]; then | ||
44 | - echo -- no Large File Support - no 64-bit off_t | ||
45 | - elif [ $r -eq 2 ]; then | ||
46 | - echo -- no Large File Support - no 64-bit stat | ||
47 | - elif [ $r -eq 3 ]; then | ||
48 | - echo -- yes we have Large File Support! | ||
49 | - CFLAGSR="${CFLAGSR} -DLARGE_FILE_SUPPORT" | ||
50 | - else | ||
51 | - echo -- no Large File Support - conftest returned $r | ||
52 | - fi | ||
53 | + echo -- no Large File Support | ||
54 | fi | ||
55 | |||
56 | # Added 11/24/2005 EG | ||
57 | @@ -302,6 +295,11 @@ cat > conftest.c << _EOF_ | ||
58 | #include <stdlib.h> | ||
59 | #include <stdio.h> | ||
60 | #include <wchar.h> | ||
61 | + | ||
62 | +#ifndef __STDC_ISO_10646__ | ||
63 | +#error "__STDC_ISO_10646__ not defined | ||
64 | +#endif | ||
65 | + | ||
66 | int main() | ||
67 | { | ||
68 | size_t wsize; | ||
69 | @@ -327,19 +325,8 @@ if [ $? -ne 0 ]; then | ||
70 | echo "-- no Unicode (wchar_t) support" | ||
71 | else | ||
72 | # have wide char support | ||
73 | -# run it | ||
74 | - ./conftest | ||
75 | - r=$? | ||
76 | - if [ $r -eq 0 ]; then | ||
77 | - echo -- no Unicode wchar_t support - wchar_t allocation error | ||
78 | - elif [ $r -eq 1 ]; then | ||
79 | - echo -- no Unicode support - wchar_t encoding unspecified | ||
80 | - elif [ $r -eq 2 ]; then | ||
81 | - echo -- have wchar_t with known UCS encoding - enabling Unicode support! | ||
82 | - CFLAGSR="${CFLAGSR} -DUNICODE_SUPPORT -DUNICODE_WCHAR" | ||
83 | - else | ||
84 | - echo "-- no Unicode (wchar_t) support - conftest returned $r" | ||
85 | - fi | ||
86 | + echo -- have wchar_t with known UCS encoding - enabling Unicode support! | ||
87 | + CFLAGSR="${CFLAGSR} -DUNICODE_SUPPORT -DUNICODE_WCHAR" | ||
88 | fi | ||
89 | |||
90 | echo "Check for setlocale support (needed for UNICODE Native check)" | ||
91 | @@ -418,8 +405,7 @@ temp_link="link_$$" | ||
92 | echo "int main() { lchmod(\"${temp_file}\", 0666); }" \ | ||
93 | ) > conftest.c | ||
94 | ln -s "${temp_link}" "${temp_file}" && \ | ||
95 | - $CC $BFLAG $LDFLAGS -o conftest conftest.c >/dev/null 2>/dev/null && \ | ||
96 | - ./conftest | ||
97 | + $CC -Werror=implicit-function-declaration $BFLAG $LDFLAGS -o conftest conftest.c >/dev/null | ||
98 | [ $? -ne 0 ] && CFLAGSR="${CFLAGSR} -DNO_LCHMOD" | ||
99 | rm -f "${temp_file}" | ||
100 | |||
101 | -- | ||
102 | 2.34.1 | ||
103 | |||