]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/blob
b7affed40d3db6cbd2581a5f576e126d7e5f98a1
[thirdparty/openembedded/openembedded-core-contrib.git] /
1 From 103514e40da5f20aebf83a3446452ccebe5172bb Mon Sep 17 00:00:00 2001
2 From: Paul Eggert <eggert@cs.ucla.edu>
3 Date: Mon, 19 Jun 2023 14:04:29 -0700
4 Subject: [PATCH 25/29] Fix AC_SYS_LARGEFILE on GNU/Linux alpha, s390x
5
6 Problem reported by Matoro <https://bugs.gnu.org/64123>.
7 * lib/autoconf/specific.m4 (_AC_SYS_LARGEFILE_TEST_CODE):
8 New overridable macro FTYPE, to test types other than off_t.
9 (_AC_SYS_LARGEFILE_TEST_CODE): Test ino_t for
10 -D_FILE_OFFSETBITS=64 too, if no flags are needed for off_t.
11 Needed for GNU/Linux on alpha and s390x.
12
13 Upstream-Status: Backport
14 Signed-off-by: Khem Raj <raj.khem@gmail.com>
15 ---
16 lib/autoconf/specific.m4 | 21 +++++++++++++++------
17 1 file changed, 15 insertions(+), 6 deletions(-)
18
19 diff --git a/lib/autoconf/specific.m4 b/lib/autoconf/specific.m4
20 index 91f20bf0d..9d5974548 100644
21 --- a/lib/autoconf/specific.m4
22 +++ b/lib/autoconf/specific.m4
23 @@ -238,13 +238,16 @@ AS_IF([test "$enable_year2038,$ac_have_year2038" = yes,no],
24 # C code used to probe for large file support.
25 m4_define([_AC_SYS_LARGEFILE_TEST_CODE],
26 [@%:@include <sys/types.h>
27 - /* Check that off_t can represent 2**63 - 1 correctly.
28 - We can't simply define LARGE_OFF_T to be 9223372036854775807,
29 +@%:@ifndef FTYPE
30 +@%:@ define FTYPE off_t
31 +@%:@endif
32 + /* Check that FTYPE can represent 2**63 - 1 correctly.
33 + We can't simply define LARGE_FTYPE to be 9223372036854775807,
34 since some C++ compilers masquerading as C compilers
35 incorrectly reject 9223372036854775807. */
36 -@%:@define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31))
37 - int off_t_is_large[[(LARGE_OFF_T % 2147483629 == 721
38 - && LARGE_OFF_T % 2147483647 == 1)
39 +@%:@define LARGE_FTYPE (((FTYPE) 1 << 31 << 31) - 1 + ((FTYPE) 1 << 31 << 31))
40 + int FTYPE_is_large[[(LARGE_FTYPE % 2147483629 == 721
41 + && LARGE_FTYPE % 2147483647 == 1)
42 ? 1 : -1]];[]dnl
43 ])
44 # Defined by Autoconf 2.71 and circa 2022 Gnulib unwisely depended on it.
45 @@ -284,7 +287,13 @@ AC_DEFUN([_AC_SYS_LARGEFILE_PROBE],
46 AS_IF([test x"$ac_opt" != x"none needed"],
47 [CC="$ac_save_CC $ac_opt"])
48 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([_AC_SYS_LARGEFILE_TEST_CODE])],
49 - [ac_cv_sys_largefile_opts="$ac_opt"
50 + [AS_IF([test x"$ac_opt" = x"none needed"],
51 + [# GNU/Linux s390x and alpha need _FILE_OFFSET_BITS=64 for wide ino_t.
52 + CC="$CC -DFTYPE=ino_t"
53 + AC_COMPILE_IFELSE([], [],
54 + [CC="$CC -D_FILE_OFFSET_BITS=64"
55 + AC_COMPILE_IFELSE([], [ac_opt='-D_FILE_OFFSET_BITS=64'])])])
56 + ac_cv_sys_largefile_opts=$ac_opt
57 ac_opt_found=yes])
58 test $ac_opt_found = no || break
59 done
60 --
61 2.41.0
62