diff options
author | Khem Raj <raj.khem@gmail.com> | 2022-08-23 23:34:41 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-08-25 11:08:06 +0100 |
commit | 28e6412e474f5d03f906d07c607402c09aa647b5 (patch) | |
tree | c8ec5ac2e64cf13a35815cedd5e01b084544dba0 /meta | |
parent | 55ad14e87ce77cd87c1e09a2c89d0d920325ce33 (diff) | |
download | poky-28e6412e474f5d03f906d07c607402c09aa647b5.tar.gz |
apr: Use correct strerror_r implementation based on libc type
musl does not implement GNU extention of strerror_r but XSI compliant
version, therefore add it via a packageconfig to set right variables
during configure to cache the value.
configure detection logic depends on runtime test which will always be
wrong on cross compiles therefore backport a patch to make it possible
to cache the needed configure variable.
(From OE-Core rev: ded3d76a844dd1aef9ac610fbe506bf76285369b)
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r-- | meta/recipes-support/apr/apr/0001-add-AC_CACHE_CHECK-for-strerror_r-return-type.patch | 52 | ||||
-rw-r--r-- | meta/recipes-support/apr/apr_1.7.0.bb | 4 |
2 files changed, 56 insertions, 0 deletions
diff --git a/meta/recipes-support/apr/apr/0001-add-AC_CACHE_CHECK-for-strerror_r-return-type.patch b/meta/recipes-support/apr/apr/0001-add-AC_CACHE_CHECK-for-strerror_r-return-type.patch new file mode 100644 index 0000000000..d0a9bd9129 --- /dev/null +++ b/meta/recipes-support/apr/apr/0001-add-AC_CACHE_CHECK-for-strerror_r-return-type.patch | |||
@@ -0,0 +1,52 @@ | |||
1 | From 8ca3c3306f1a149e51a3be6a4b1e47e9aee88262 Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Tue, 23 Aug 2022 22:42:03 -0700 | ||
4 | Subject: [PATCH] add AC_CACHE_CHECK for strerror_r return type | ||
5 | |||
6 | APR's configure script uses AC_TRY_RUN to detect whether the return type | ||
7 | of strerror_r is int. When cross-compiling this defaults to no. | ||
8 | |||
9 | This commit adds an AC_CACHE_CHECK so users who cross-compile APR may | ||
10 | influence the outcome with a configure variable. | ||
11 | |||
12 | Upstream-Status: Backport [https://svn.apache.org/viewvc?view=revision&revision=1875065] | ||
13 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
14 | --- | ||
15 | build/apr_common.m4 | 11 ++++------- | ||
16 | 1 file changed, 4 insertions(+), 7 deletions(-) | ||
17 | |||
18 | diff --git a/build/apr_common.m4 b/build/apr_common.m4 | ||
19 | index cbf2a4c..42e75cf 100644 | ||
20 | --- a/build/apr_common.m4 | ||
21 | +++ b/build/apr_common.m4 | ||
22 | @@ -525,8 +525,9 @@ dnl string. | ||
23 | dnl | ||
24 | dnl | ||
25 | AC_DEFUN([APR_CHECK_STRERROR_R_RC], [ | ||
26 | -AC_MSG_CHECKING(for type of return code from strerror_r) | ||
27 | -AC_TRY_RUN([ | ||
28 | +AC_CACHE_CHECK([whether return code from strerror_r has type int], | ||
29 | +[ac_cv_strerror_r_rc_int], | ||
30 | +[AC_TRY_RUN([ | ||
31 | #include <errno.h> | ||
32 | #include <string.h> | ||
33 | #include <stdio.h> | ||
34 | @@ -542,14 +543,10 @@ main() | ||
35 | }], [ | ||
36 | ac_cv_strerror_r_rc_int=yes ], [ | ||
37 | ac_cv_strerror_r_rc_int=no ], [ | ||
38 | - ac_cv_strerror_r_rc_int=no ] ) | ||
39 | + ac_cv_strerror_r_rc_int=no ] ) ] ) | ||
40 | if test "x$ac_cv_strerror_r_rc_int" = xyes; then | ||
41 | AC_DEFINE(STRERROR_R_RC_INT, 1, [Define if strerror returns int]) | ||
42 | - msg="int" | ||
43 | -else | ||
44 | - msg="pointer" | ||
45 | fi | ||
46 | -AC_MSG_RESULT([$msg]) | ||
47 | ] ) | ||
48 | |||
49 | dnl | ||
50 | -- | ||
51 | 2.37.2 | ||
52 | |||
diff --git a/meta/recipes-support/apr/apr_1.7.0.bb b/meta/recipes-support/apr/apr_1.7.0.bb index 9c826d4380..07bf61545e 100644 --- a/meta/recipes-support/apr/apr_1.7.0.bb +++ b/meta/recipes-support/apr/apr_1.7.0.bb | |||
@@ -24,6 +24,7 @@ SRC_URI = "${APACHE_MIRROR}/apr/${BPN}-${PV}.tar.bz2 \ | |||
24 | file://libtoolize_check.patch \ | 24 | file://libtoolize_check.patch \ |
25 | file://0001-Add-option-to-disable-timed-dependant-tests.patch \ | 25 | file://0001-Add-option-to-disable-timed-dependant-tests.patch \ |
26 | file://autoconf270.patch \ | 26 | file://autoconf270.patch \ |
27 | file://0001-add-AC_CACHE_CHECK-for-strerror_r-return-type.patch \ | ||
27 | file://CVE-2021-35940.patch \ | 28 | file://CVE-2021-35940.patch \ |
28 | " | 29 | " |
29 | 30 | ||
@@ -44,9 +45,12 @@ CACHED_CONFIGUREVARS += "ac_cv_header_netinet_sctp_h=no ac_cv_header_netinet_sct | |||
44 | CACHED_CONFIGUREVARS += "ac_cv_sizeof_struct_iovec=yes" | 45 | CACHED_CONFIGUREVARS += "ac_cv_sizeof_struct_iovec=yes" |
45 | CACHED_CONFIGUREVARS += "ac_cv_file__dev_zero=yes" | 46 | CACHED_CONFIGUREVARS += "ac_cv_file__dev_zero=yes" |
46 | 47 | ||
48 | CACHED_CONFIGUREVARS:append:libc-musl = " ac_cv_strerror_r_rc_int=yes" | ||
47 | PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)}" | 49 | PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)}" |
50 | PACKAGECONFIG:append:libc-musl = " xsi-strerror" | ||
48 | PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6," | 51 | PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6," |
49 | PACKAGECONFIG[timed-tests] = "--enable-timed-tests,--disable-timed-tests," | 52 | PACKAGECONFIG[timed-tests] = "--enable-timed-tests,--disable-timed-tests," |
53 | PACKAGECONFIG[xsi-strerror] = "ac_cv_strerror_r_rc_int=yes,ac_cv_strerror_r_rc_int=no," | ||
50 | 54 | ||
51 | do_configure:prepend() { | 55 | do_configure:prepend() { |
52 | # Avoid absolute paths for grep since it causes failures | 56 | # Avoid absolute paths for grep since it causes failures |