Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 1 | From f26e8b88d2c90ed7eb9d4e276412b0923c23d10f Mon Sep 17 00:00:00 2001 |
| 2 | From: Dengke Du <dengke.du@windriver.com> |
| 3 | Date: Wed, 14 Dec 2016 18:13:08 +0800 |
| 4 | Subject: [PATCH] apr: fix off_t size doesn't match in glibc when cross |
| 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> |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 30 | |
| 31 | Upstream-Status: Pending |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 32 | --- |
| 33 | configure.in | 8 ++++---- |
| 34 | 1 file changed, 4 insertions(+), 4 deletions(-) |
| 35 | |
| 36 | diff --git a/configure.in b/configure.in |
| 37 | index 9d57ae6..5b19940 100644 |
| 38 | --- a/configure.in |
| 39 | +++ b/configure.in |
| 40 | @@ -1681,7 +1681,7 @@ else |
| 41 | socklen_t_value="int" |
| 42 | fi |
| 43 | |
| 44 | -APR_CHECK_SIZEOF_EXTENDED([#include <sys/types.h>], pid_t, 8) |
| 45 | +AC_CHECK_SIZEOF(pid_t) |
| 46 | |
| 47 | if test "$ac_cv_sizeof_pid_t" = "$ac_cv_sizeof_short"; then |
| 48 | pid_t_fmt='#define APR_PID_T_FMT "hd"' |
| 49 | @@ -1750,7 +1750,7 @@ APR_CHECK_TYPES_COMPATIBLE(ssize_t, long, [ssize_t_fmt="ld"]) |
| 50 | APR_CHECK_TYPES_COMPATIBLE(size_t, unsigned int, [size_t_fmt="u"]) |
| 51 | APR_CHECK_TYPES_COMPATIBLE(size_t, unsigned long, [size_t_fmt="lu"]) |
| 52 | |
| 53 | -APR_CHECK_SIZEOF_EXTENDED([#include <sys/types.h>], ssize_t, 8) |
| 54 | +AC_CHECK_SIZEOF(ssize_t) |
| 55 | |
| 56 | AC_MSG_CHECKING([which format to use for apr_ssize_t]) |
| 57 | if test -n "$ssize_t_fmt"; then |
| 58 | @@ -1767,7 +1767,7 @@ fi |
| 59 | |
| 60 | ssize_t_fmt="#define APR_SSIZE_T_FMT \"$ssize_t_fmt\"" |
| 61 | |
| 62 | -APR_CHECK_SIZEOF_EXTENDED([#include <stddef.h>], size_t, 8) |
| 63 | +AC_CHECK_SIZEOF(size_t) |
| 64 | |
| 65 | AC_MSG_CHECKING([which format to use for apr_size_t]) |
| 66 | if test -n "$size_t_fmt"; then |
| 67 | @@ -1784,7 +1784,7 @@ fi |
| 68 | |
| 69 | size_t_fmt="#define APR_SIZE_T_FMT \"$size_t_fmt\"" |
| 70 | |
| 71 | -APR_CHECK_SIZEOF_EXTENDED([#include <sys/types.h>], off_t, 8) |
| 72 | +AC_CHECK_SIZEOF(off_t) |
| 73 | |
| 74 | if test "${ac_cv_sizeof_off_t}${apr_cv_use_lfs64}" = "4yes"; then |
| 75 | # Enable LFS |
| 76 | -- |
| 77 | 2.7.4 |
| 78 | |