blob: d1a2ebe881996bfa5a0bb065aed9d3f279e13749 [file] [log] [blame]
Brad Bishopc342db32019-05-15 21:57:59 -04001From 49661ea3858cf8494926cccf57d3e8c6dcb47117 Mon Sep 17 00:00:00 2001
Brad Bishop316dfdd2018-06-25 12:45:53 -04002From: Dengke Du <dengke.du@windriver.com>
3Date: Wed, 14 Dec 2016 18:13:08 +0800
Brad Bishopc342db32019-05-15 21:57:59 -04004Subject: [PATCH] apr: fix off_t size doesn't match in glibc when cross
Brad Bishop316dfdd2018-06-25 12:45:53 -04005 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
31Upstream-Status: Pending
Brad Bishopc342db32019-05-15 21:57:59 -040032
Brad Bishop316dfdd2018-06-25 12:45:53 -040033---
34 configure.in | 8 ++++----
35 1 file changed, 4 insertions(+), 4 deletions(-)
36
37diff --git a/configure.in b/configure.in
Brad Bishopc342db32019-05-15 21:57:59 -040038index 27b8539..fb408d1 100644
Brad Bishop316dfdd2018-06-25 12:45:53 -040039--- a/configure.in
40+++ b/configure.in
Brad Bishopc342db32019-05-15 21:57:59 -040041@@ -1801,7 +1801,7 @@ else
Brad Bishop316dfdd2018-06-25 12:45:53 -040042 socklen_t_value="int"
43 fi
44
45-APR_CHECK_SIZEOF_EXTENDED([#include <sys/types.h>], pid_t, 8)
46+AC_CHECK_SIZEOF(pid_t)
47
48 if test "$ac_cv_sizeof_pid_t" = "$ac_cv_sizeof_short"; then
49 pid_t_fmt='#define APR_PID_T_FMT "hd"'
Brad Bishopc342db32019-05-15 21:57:59 -040050@@ -1873,7 +1873,7 @@ APR_CHECK_TYPES_FMT_COMPATIBLE(size_t, unsigned long, lu, [size_t_fmt="lu"], [
51 APR_CHECK_TYPES_FMT_COMPATIBLE(size_t, unsigned int, u, [size_t_fmt="u"])
52 ])
Brad Bishop316dfdd2018-06-25 12:45:53 -040053
54-APR_CHECK_SIZEOF_EXTENDED([#include <sys/types.h>], ssize_t, 8)
55+AC_CHECK_SIZEOF(ssize_t)
56
Brad Bishopc342db32019-05-15 21:57:59 -040057 dnl the else cases below should no longer occur;
Brad Bishop316dfdd2018-06-25 12:45:53 -040058 AC_MSG_CHECKING([which format to use for apr_ssize_t])
Brad Bishopc342db32019-05-15 21:57:59 -040059@@ -1891,7 +1891,7 @@ fi
Brad Bishop316dfdd2018-06-25 12:45:53 -040060
61 ssize_t_fmt="#define APR_SSIZE_T_FMT \"$ssize_t_fmt\""
62
63-APR_CHECK_SIZEOF_EXTENDED([#include <stddef.h>], size_t, 8)
64+AC_CHECK_SIZEOF(size_t)
65
Brad Bishopc342db32019-05-15 21:57:59 -040066 # else cases below should no longer occur;
Brad Bishop316dfdd2018-06-25 12:45:53 -040067 AC_MSG_CHECKING([which format to use for apr_size_t])
Brad Bishopc342db32019-05-15 21:57:59 -040068@@ -1909,7 +1909,7 @@ fi
Brad Bishop316dfdd2018-06-25 12:45:53 -040069
70 size_t_fmt="#define APR_SIZE_T_FMT \"$size_t_fmt\""
71
72-APR_CHECK_SIZEOF_EXTENDED([#include <sys/types.h>], off_t, 8)
73+AC_CHECK_SIZEOF(off_t)
74
75 if test "${ac_cv_sizeof_off_t}${apr_cv_use_lfs64}" = "4yes"; then
76 # Enable LFS