mirror of
https://git.yoctoproject.org/poky
synced 2026-06-02 13:29:49 +00:00
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>
This commit is contained in:
@@ -0,0 +1,52 @@
|
|||||||
|
From 8ca3c3306f1a149e51a3be6a4b1e47e9aee88262 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Khem Raj <raj.khem@gmail.com>
|
||||||
|
Date: Tue, 23 Aug 2022 22:42:03 -0700
|
||||||
|
Subject: [PATCH] add AC_CACHE_CHECK for strerror_r return type
|
||||||
|
|
||||||
|
APR's configure script uses AC_TRY_RUN to detect whether the return type
|
||||||
|
of strerror_r is int. When cross-compiling this defaults to no.
|
||||||
|
|
||||||
|
This commit adds an AC_CACHE_CHECK so users who cross-compile APR may
|
||||||
|
influence the outcome with a configure variable.
|
||||||
|
|
||||||
|
Upstream-Status: Backport [https://svn.apache.org/viewvc?view=revision&revision=1875065]
|
||||||
|
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||||
|
---
|
||||||
|
build/apr_common.m4 | 11 ++++-------
|
||||||
|
1 file changed, 4 insertions(+), 7 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/build/apr_common.m4 b/build/apr_common.m4
|
||||||
|
index cbf2a4c..42e75cf 100644
|
||||||
|
--- a/build/apr_common.m4
|
||||||
|
+++ b/build/apr_common.m4
|
||||||
|
@@ -525,8 +525,9 @@ dnl string.
|
||||||
|
dnl
|
||||||
|
dnl
|
||||||
|
AC_DEFUN([APR_CHECK_STRERROR_R_RC], [
|
||||||
|
-AC_MSG_CHECKING(for type of return code from strerror_r)
|
||||||
|
-AC_TRY_RUN([
|
||||||
|
+AC_CACHE_CHECK([whether return code from strerror_r has type int],
|
||||||
|
+[ac_cv_strerror_r_rc_int],
|
||||||
|
+[AC_TRY_RUN([
|
||||||
|
#include <errno.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
@@ -542,14 +543,10 @@ main()
|
||||||
|
}], [
|
||||||
|
ac_cv_strerror_r_rc_int=yes ], [
|
||||||
|
ac_cv_strerror_r_rc_int=no ], [
|
||||||
|
- ac_cv_strerror_r_rc_int=no ] )
|
||||||
|
+ ac_cv_strerror_r_rc_int=no ] ) ] )
|
||||||
|
if test "x$ac_cv_strerror_r_rc_int" = xyes; then
|
||||||
|
AC_DEFINE(STRERROR_R_RC_INT, 1, [Define if strerror returns int])
|
||||||
|
- msg="int"
|
||||||
|
-else
|
||||||
|
- msg="pointer"
|
||||||
|
fi
|
||||||
|
-AC_MSG_RESULT([$msg])
|
||||||
|
] )
|
||||||
|
|
||||||
|
dnl
|
||||||
|
--
|
||||||
|
2.37.2
|
||||||
|
|
||||||
@@ -24,6 +24,7 @@ SRC_URI = "${APACHE_MIRROR}/apr/${BPN}-${PV}.tar.bz2 \
|
|||||||
file://libtoolize_check.patch \
|
file://libtoolize_check.patch \
|
||||||
file://0001-Add-option-to-disable-timed-dependant-tests.patch \
|
file://0001-Add-option-to-disable-timed-dependant-tests.patch \
|
||||||
file://autoconf270.patch \
|
file://autoconf270.patch \
|
||||||
|
file://0001-add-AC_CACHE_CHECK-for-strerror_r-return-type.patch \
|
||||||
file://CVE-2021-35940.patch \
|
file://CVE-2021-35940.patch \
|
||||||
"
|
"
|
||||||
|
|
||||||
@@ -44,9 +45,12 @@ CACHED_CONFIGUREVARS += "ac_cv_header_netinet_sctp_h=no ac_cv_header_netinet_sct
|
|||||||
CACHED_CONFIGUREVARS += "ac_cv_sizeof_struct_iovec=yes"
|
CACHED_CONFIGUREVARS += "ac_cv_sizeof_struct_iovec=yes"
|
||||||
CACHED_CONFIGUREVARS += "ac_cv_file__dev_zero=yes"
|
CACHED_CONFIGUREVARS += "ac_cv_file__dev_zero=yes"
|
||||||
|
|
||||||
|
CACHED_CONFIGUREVARS:append:libc-musl = " ac_cv_strerror_r_rc_int=yes"
|
||||||
PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)}"
|
PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)}"
|
||||||
|
PACKAGECONFIG:append:libc-musl = " xsi-strerror"
|
||||||
PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,"
|
PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,"
|
||||||
PACKAGECONFIG[timed-tests] = "--enable-timed-tests,--disable-timed-tests,"
|
PACKAGECONFIG[timed-tests] = "--enable-timed-tests,--disable-timed-tests,"
|
||||||
|
PACKAGECONFIG[xsi-strerror] = "ac_cv_strerror_r_rc_int=yes,ac_cv_strerror_r_rc_int=no,"
|
||||||
|
|
||||||
do_configure:prepend() {
|
do_configure:prepend() {
|
||||||
# Avoid absolute paths for grep since it causes failures
|
# Avoid absolute paths for grep since it causes failures
|
||||||
|
|||||||
Reference in New Issue
Block a user