Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 1 | From 49661ea3858cf8494926cccf57d3e8c6dcb47117 Mon Sep 17 00:00:00 2001 |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 2 | From: Dengke Du <dengke.du@windriver.com> |
| 3 | Date: Wed, 14 Dec 2016 18:13:08 +0800 |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 4 | Subject: [PATCH] apr: fix off_t size doesn't match in glibc when cross |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 5 | compiling |
| 6 | |
| 7 | In configure.in, it contains the following: |
| 8 | |
| 9 | APR_CHECK_SIZEOF_EXTENDED([#include <sys/types.h>], off_t, 8) |
| 10 | |
| 11 | the macro "APR_CHECK_SIZEOF_EXTENDED" was defined in build/apr_common.m4, |
| 12 | it use the "AC_TRY_RUN" macro, this macro let the off_t to 8, when cross |
| 13 | compiling enable. |
| 14 | |
| 15 | So it was hardcoded for cross compiling, we should detect it dynamic based on |
| 16 | the sysroot's glibc. We change it to the following: |
| 17 | |
| 18 | AC_CHECK_SIZEOF(off_t) |
| 19 | |
| 20 | The 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 | |
| 27 | Change the above correspondingly. |
| 28 | |
| 29 | Signed-off-by: Dengke Du <dengke.du@windriver.com> |
| 30 | |
| 31 | Upstream-Status: Pending |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 32 | |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 33 | --- |
| 34 | configure.in | 8 ++++---- |
| 35 | 1 file changed, 4 insertions(+), 4 deletions(-) |
| 36 | |
| 37 | diff --git a/configure.in b/configure.in |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 38 | index 27b8539..fb408d1 100644 |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 39 | --- a/configure.in |
| 40 | +++ b/configure.in |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 41 | @@ -1801,7 +1801,7 @@ else |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 42 | 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 Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 50 | @@ -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 Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 53 | |
| 54 | -APR_CHECK_SIZEOF_EXTENDED([#include <sys/types.h>], ssize_t, 8) |
| 55 | +AC_CHECK_SIZEOF(ssize_t) |
| 56 | |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 57 | dnl the else cases below should no longer occur; |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 58 | AC_MSG_CHECKING([which format to use for apr_ssize_t]) |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 59 | @@ -1891,7 +1891,7 @@ fi |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 60 | |
| 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 Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 66 | # else cases below should no longer occur; |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 67 | AC_MSG_CHECKING([which format to use for apr_size_t]) |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 68 | @@ -1909,7 +1909,7 @@ fi |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 69 | |
| 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 |