summaryrefslogtreecommitdiffstats
path: root/meta/recipes-support/apr
diff options
context:
space:
mode:
authorDengke Du <dengke.du@windriver.com>2016-12-20 13:53:16 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-12-22 08:50:16 +0000
commit45be34c8e00fb29649887fee34779334038226fc (patch)
tree96513c6ffd0f04dcbd4d9fcc113d41a180551391 /meta/recipes-support/apr
parent971fc297132b9fd2938cd28a75f6689116688101 (diff)
downloadpoky-45be34c8e00fb29649887fee34779334038226fc.tar.gz
apr: fix off_t size can't match when configure and in target glibc
When subversion run on x86 and lib32 on x86-64, it use the APR's apr.h header file. But when configure the APR, APR meets the cross compiling, it was hardcoded in configure.in in apr source code. As the following: APR_CHECK_SIZEOF_EXTENDED([#include <sys/types.h>], off_t, 8) It pass 8 bytes to off_t when meets cross compiling, but on x86 or lib32 the off_t in glibc was 4 bytes, so it let the application who use apr.h go to wrong. Such as subversion: svnadmin create test So we should let the APR detect the correct off_t when cross compiling, change it to the following: AC_CHECK_SIZEOF(off_t) The same for the following hardcoded types for cross compiling: pid_t 8 size_t 8 ssize_t 8 Change the above correspondingly. (From OE-Core rev: e18820ca9202c07e2406d702c46f45415182b7a6) Signed-off-by: Dengke Du <dengke.du@windriver.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-support/apr')
-rw-r--r--meta/recipes-support/apr/apr/0001-apr-fix-off_t-size-doesn-t-match-in-glibc-when-cross.patch76
-rw-r--r--meta/recipes-support/apr/apr_1.5.2.bb1
2 files changed, 77 insertions, 0 deletions
diff --git a/meta/recipes-support/apr/apr/0001-apr-fix-off_t-size-doesn-t-match-in-glibc-when-cross.patch b/meta/recipes-support/apr/apr/0001-apr-fix-off_t-size-doesn-t-match-in-glibc-when-cross.patch
new file mode 100644
index 0000000000..12371428f0
--- /dev/null
+++ b/meta/recipes-support/apr/apr/0001-apr-fix-off_t-size-doesn-t-match-in-glibc-when-cross.patch
@@ -0,0 +1,76 @@
1From f26e8b88d2c90ed7eb9d4e276412b0923c23d10f Mon Sep 17 00:00:00 2001
2From: Dengke Du <dengke.du@windriver.com>
3Date: Wed, 14 Dec 2016 18:13:08 +0800
4Subject: [PATCH] apr: fix off_t size doesn't match in glibc when cross
5 compiling
6
7In configure.in, it contains the following:
8
9 APR_CHECK_SIZEOF_EXTENDED([#include <sys/types.h>], off_t, 8)
10
11the macro "APR_CHECK_SIZEOF_EXTENDED" was defined in build/apr_common.m4,
12it use the "AC_TRY_RUN" macro, this macro let the off_t to 8, when cross
13compiling enable.
14
15So it was hardcoded for cross compiling, we should detect it dynamic based on
16the sysroot's glibc. We change it to the following:
17
18 AC_CHECK_SIZEOF(off_t)
19
20The same for the following hardcoded types for cross compiling:
21
22 pid_t 8
23 ssize_t 8
24 size_t 8
25 off_t 8
26
27Change the above correspondingly.
28
29Signed-off-by: Dengke Du <dengke.du@windriver.com>
30---
31 configure.in | 8 ++++----
32 1 file changed, 4 insertions(+), 4 deletions(-)
33
34diff --git a/configure.in b/configure.in
35index 9d57ae6..5b19940 100644
36--- a/configure.in
37+++ b/configure.in
38@@ -1681,7 +1681,7 @@ else
39 socklen_t_value="int"
40 fi
41
42-APR_CHECK_SIZEOF_EXTENDED([#include <sys/types.h>], pid_t, 8)
43+AC_CHECK_SIZEOF(pid_t)
44
45 if test "$ac_cv_sizeof_pid_t" = "$ac_cv_sizeof_short"; then
46 pid_t_fmt='#define APR_PID_T_FMT "hd"'
47@@ -1750,7 +1750,7 @@ APR_CHECK_TYPES_COMPATIBLE(ssize_t, long, [ssize_t_fmt="ld"])
48 APR_CHECK_TYPES_COMPATIBLE(size_t, unsigned int, [size_t_fmt="u"])
49 APR_CHECK_TYPES_COMPATIBLE(size_t, unsigned long, [size_t_fmt="lu"])
50
51-APR_CHECK_SIZEOF_EXTENDED([#include <sys/types.h>], ssize_t, 8)
52+AC_CHECK_SIZEOF(ssize_t)
53
54 AC_MSG_CHECKING([which format to use for apr_ssize_t])
55 if test -n "$ssize_t_fmt"; then
56@@ -1767,7 +1767,7 @@ fi
57
58 ssize_t_fmt="#define APR_SSIZE_T_FMT \"$ssize_t_fmt\""
59
60-APR_CHECK_SIZEOF_EXTENDED([#include <stddef.h>], size_t, 8)
61+AC_CHECK_SIZEOF(size_t)
62
63 AC_MSG_CHECKING([which format to use for apr_size_t])
64 if test -n "$size_t_fmt"; then
65@@ -1784,7 +1784,7 @@ fi
66
67 size_t_fmt="#define APR_SIZE_T_FMT \"$size_t_fmt\""
68
69-APR_CHECK_SIZEOF_EXTENDED([#include <sys/types.h>], off_t, 8)
70+AC_CHECK_SIZEOF(off_t)
71
72 if test "${ac_cv_sizeof_off_t}${apr_cv_use_lfs64}" = "4yes"; then
73 # Enable LFS
74--
752.7.4
76
diff --git a/meta/recipes-support/apr/apr_1.5.2.bb b/meta/recipes-support/apr/apr_1.5.2.bb
index 302c93504b..f560c8b9c4 100644
--- a/meta/recipes-support/apr/apr_1.5.2.bb
+++ b/meta/recipes-support/apr/apr_1.5.2.bb
@@ -17,6 +17,7 @@ SRC_URI = "${APACHE_MIRROR}/apr/${BPN}-${PV}.tar.bz2 \
17 file://upgrade-and-fix-1.5.1.patch \ 17 file://upgrade-and-fix-1.5.1.patch \
18 file://Fix-packet-discards-HTTP-redirect.patch \ 18 file://Fix-packet-discards-HTTP-redirect.patch \
19 file://configure.in-fix-LTFLAGS-to-make-it-work-with-ccache.patch \ 19 file://configure.in-fix-LTFLAGS-to-make-it-work-with-ccache.patch \
20 file://0001-apr-fix-off_t-size-doesn-t-match-in-glibc-when-cross.patch \
20" 21"
21 22
22SRC_URI[md5sum] = "4e9769f3349fe11fc0a5e1b224c236aa" 23SRC_URI[md5sum] = "4e9769f3349fe11fc0a5e1b224c236aa"