diff options
author | Khem Raj <raj.khem@gmail.com> | 2022-03-08 22:47:57 -0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-03-10 13:07:37 +0000 |
commit | e34f694c3539bc8557a323361e277bbc85addd2c (patch) | |
tree | b1e8350183ee4822184b9499edd71f3ace037355 /meta/recipes-core/zlib | |
parent | dc8d760f0956792e4e6a7e43316b31b93e57bd31 (diff) | |
download | poky-e34f694c3539bc8557a323361e277bbc85addd2c.tar.gz |
zlib: Pass ldflags to configure tests using linking
(From OE-Core rev: 86bc57eaa3d1016d8d99041e5bd115cf3d2e4ce3)
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-core/zlib')
-rw-r--r-- | meta/recipes-core/zlib/zlib/0001-configure-Pass-LDFLAGS-to-link-tests.patch | 79 | ||||
-rw-r--r-- | meta/recipes-core/zlib/zlib_1.2.11.bb | 1 |
2 files changed, 80 insertions, 0 deletions
diff --git a/meta/recipes-core/zlib/zlib/0001-configure-Pass-LDFLAGS-to-link-tests.patch b/meta/recipes-core/zlib/zlib/0001-configure-Pass-LDFLAGS-to-link-tests.patch new file mode 100644 index 0000000000..91a1b4a09a --- /dev/null +++ b/meta/recipes-core/zlib/zlib/0001-configure-Pass-LDFLAGS-to-link-tests.patch | |||
@@ -0,0 +1,79 @@ | |||
1 | From 001971eef84485562f912d8edd4fc7688acfad91 Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Tue, 8 Mar 2022 22:38:47 -0800 | ||
4 | Subject: [PATCH] configure: Pass LDFLAGS to link tests | ||
5 | |||
6 | LDFLAGS can contain critical flags without which linking wont succeed | ||
7 | therefore ensure that all configure tests involving link time checks are | ||
8 | using LDFLAGS on compiler commandline along with CFLAGS to ensure the | ||
9 | tests perform correctly. Without this some tests may fail resulting in | ||
10 | wrong confgure result, ending in miscompiling the package | ||
11 | |||
12 | Upstream-Status: Submitted [https://github.com/madler/zlib/pull/599] | ||
13 | |||
14 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
15 | --- | ||
16 | configure | 12 ++++++------ | ||
17 | 1 file changed, 6 insertions(+), 6 deletions(-) | ||
18 | |||
19 | diff --git a/configure b/configure | ||
20 | index e974d1f..69dfa3f 100755 | ||
21 | --- a/configure | ||
22 | +++ b/configure | ||
23 | @@ -410,7 +410,7 @@ if test $shared -eq 1; then | ||
24 | echo Checking for shared library support... | tee -a configure.log | ||
25 | # we must test in two steps (cc then ld), required at least on SunOS 4.x | ||
26 | if try $CC -w -c $SFLAGS $test.c && | ||
27 | - try $LDSHARED $SFLAGS -o $test$shared_ext $test.o; then | ||
28 | + try $LDSHARED $SFLAGS $LDFLAGS -o $test$shared_ext $test.o; then | ||
29 | echo Building shared library $SHAREDLIBV with $CC. | tee -a configure.log | ||
30 | elif test -z "$old_cc" -a -z "$old_cflags"; then | ||
31 | echo No shared library support. | tee -a configure.log | ||
32 | @@ -492,7 +492,7 @@ int main(void) { | ||
33 | } | ||
34 | EOF | ||
35 | fi | ||
36 | - if try $CC $CFLAGS -o $test $test.c; then | ||
37 | + if try $CC $CFLAGS $LDFLAGS -o $test $test.c; then | ||
38 | sizet=`./$test` | ||
39 | echo "Checking for a pointer-size integer type..." $sizet"." | tee -a configure.log | ||
40 | else | ||
41 | @@ -530,7 +530,7 @@ int main(void) { | ||
42 | return 0; | ||
43 | } | ||
44 | EOF | ||
45 | - if try $CC $CFLAGS -o $test $test.c; then | ||
46 | + if try $CC $CFLAGS $LDFLAGS -o $test $test.c; then | ||
47 | echo "Checking for fseeko... Yes." | tee -a configure.log | ||
48 | else | ||
49 | CFLAGS="${CFLAGS} -DNO_FSEEKO" | ||
50 | @@ -547,7 +547,7 @@ cat > $test.c <<EOF | ||
51 | #include <errno.h> | ||
52 | int main() { return strlen(strerror(errno)); } | ||
53 | EOF | ||
54 | -if try $CC $CFLAGS -o $test $test.c; then | ||
55 | +if try $CC $CFLAGS $LDFLAGS -o $test $test.c; then | ||
56 | echo "Checking for strerror... Yes." | tee -a configure.log | ||
57 | else | ||
58 | CFLAGS="${CFLAGS} -DNO_STRERROR" | ||
59 | @@ -654,7 +654,7 @@ int main() | ||
60 | return (mytest("Hello%d\n", 1)); | ||
61 | } | ||
62 | EOF | ||
63 | - if try $CC $CFLAGS -o $test $test.c; then | ||
64 | + if try $CC $CFLAGS $LDFLAGS -o $test $test.c; then | ||
65 | echo "Checking for vsnprintf() in stdio.h... Yes." | tee -a configure.log | ||
66 | |||
67 | echo >> configure.log | ||
68 | @@ -744,7 +744,7 @@ int main() | ||
69 | } | ||
70 | EOF | ||
71 | |||
72 | - if try $CC $CFLAGS -o $test $test.c; then | ||
73 | + if try $CC $CFLAGS $LDFLAGS -o $test $test.c; then | ||
74 | echo "Checking for snprintf() in stdio.h... Yes." | tee -a configure.log | ||
75 | |||
76 | echo >> configure.log | ||
77 | -- | ||
78 | 2.35.1 | ||
79 | |||
diff --git a/meta/recipes-core/zlib/zlib_1.2.11.bb b/meta/recipes-core/zlib/zlib_1.2.11.bb index 1c06aa0ab5..d699719554 100644 --- a/meta/recipes-core/zlib/zlib_1.2.11.bb +++ b/meta/recipes-core/zlib/zlib_1.2.11.bb | |||
@@ -8,6 +8,7 @@ LIC_FILES_CHKSUM = "file://zlib.h;beginline=6;endline=23;md5=5377232268e952e9ef6 | |||
8 | 8 | ||
9 | SRC_URI = "${SOURCEFORGE_MIRROR}/libpng/${BPN}/${PV}/${BPN}-${PV}.tar.xz \ | 9 | SRC_URI = "${SOURCEFORGE_MIRROR}/libpng/${BPN}/${PV}/${BPN}-${PV}.tar.xz \ |
10 | file://ldflags-tests.patch \ | 10 | file://ldflags-tests.patch \ |
11 | file://0001-configure-Pass-LDFLAGS-to-link-tests.patch \ | ||
11 | file://run-ptest \ | 12 | file://run-ptest \ |
12 | " | 13 | " |
13 | UPSTREAM_CHECK_URI = "http://zlib.net/" | 14 | UPSTREAM_CHECK_URI = "http://zlib.net/" |