|
From: Sam S. <sd...@gn...> - 2011-07-29 14:16:46
|
> * Vladimir Tzankov <igm...@tz...> [2011-07-29 02:08:48 +0300]:
>
> On Fri, Jul 29, 2011 at 1:24 AM, Sam Steingold <sd...@gn...> wrote:
>>> * Vladimir Tzankov <igm...@tz...> [2011-07-29 00:17:37 +0300]:
>>>
>>> $ grep SIZEOF_OFF_T clisp.h config.h syscalls/config.h
>>> clisp.h:#define SIZEOF_OFF_T 8
>>> config.h:#define SIZEOF_OFF_T 8
>>> syscalls/config.h:#define SIZEOF_OFF_T 4
>>>
>>> $ grep SIZEOF_RLIM_T clisp.h config.h syscalls/config.h
>>> clisp.h:#define SIZEOF_RLIM_T 8
>>> config.h:#define SIZEOF_RLIM_T 8
>>> syscalls/config.h:#define SIZEOF_RLIM_T 4
>>
>> this is eminently wrong and warrants an investigation.
>> could you please take a look at config.log and syscalls/config.log to
>> find out why these SIZEOF's are defined differently?
>
> Not sure how helpful is information below:
>
> config.log:
> configure:33813: gcc -o conftest -g -O2 conftest.c -lavcall -lcallback >&5
> configure:33813: $? = 0
> configure:33813: ./conftest
> configure:33813: $? = 0
> configure:33828: result: 8
>
> syscall/config.log:
> configure:4795: checking size of off_t
> configure:4800: gcc -o conftest -g -O2 conftest.c >&5
> configure:4800: $? = 0
> configure:4800: ./conftest
> configure:4800: $? = 0
> configure:4815: result: 4
>
> Similar rlim_t.
>
> machine is:
> Linux vtz 2.6.32-27-generic #49-Ubuntu SMP Wed Dec 1 23:52:12 UTC 2010
> i686 GNU/Linux
>
> following prints 4:
> #include <sys/types.h>
> main () { printf("%u", sizeof(off_t)); }
This just means that conftest.c from the main configure contains
includes and defines before #include <sys/types.h> which make it define
off_t to be a 64-bit type. It would be nice if you could edit the
configure files by hand and make them save the appropriate conftest.c
files as, e.g., off_t.c.
Also, please try the appended patch. I am not sure it is the right one,
but it is worth a try...
We could, of course, just remove the offending tests from
syscall/configure, but that would be clearly wrong because there are
other sizeof tests there and, if syscall/configure gets off_t and rlim_t
wrong, chances are it gets the other ones wrong too.
--
Sam Steingold (http://sds.podval.org/) on CentOS release 5.6 (Final) X 11.0.60900031
http://mideasttruth.com http://honestreporting.com http://iris.org.il
http://jihadwatch.org http://palestinefacts.org http://dhimmi.com
Winners never quit; quitters never win; idiots neither win nor quit.
diff -r 0fcd98504516 modules/syscalls/config.h.in
--- a/modules/syscalls/config.h.in Thu Jul 28 17:37:16 2011 -0400
+++ b/modules/syscalls/config.h.in Fri Jul 29 10:10:30 2011 -0400
@@ -432,6 +432,17 @@
/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS
+/* Enable large inode numbers on Mac OS X. */
+#ifndef _DARWIN_USE_64_BIT_INODE
+# define _DARWIN_USE_64_BIT_INODE 1
+#endif
+
+/* Number of bits in a file offset, on hosts where this is settable. */
+#undef _FILE_OFFSET_BITS
+
+/* Define for large files, on AIX-style hosts. */
+#undef _LARGE_FILES
+
/* Define to 1 if on MINIX. */
#undef _MINIX
diff -r 0fcd98504516 modules/syscalls/configure
--- a/modules/syscalls/configure Thu Jul 28 17:37:16 2011 -0400
+++ b/modules/syscalls/configure Fri Jul 29 10:10:30 2011 -0400
@@ -718,6 +718,7 @@ ac_user_opts='
enable_option_checking
with_clisp
enable_dependency_tracking
+enable_largefile
'
ac_precious_vars='build_alias
host_alias
@@ -1349,6 +1350,7 @@ Optional Features:
--enable-FEATURE[=ARG] include FEATURE [ARG=yes]
--disable-dependency-tracking speeds up one-time build
--enable-dependency-tracking do not reject slow dependency extractors
+ --disable-largefile omit support for large files
Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
@@ -4788,6 +4790,206 @@ done
if test "$ac_cv_header_shlobj_h" = yes ; then
LIBS=${LIBS}' -luser32 -lole32 -loleaut32 -luuid';
fi
+# Check whether --enable-largefile was given.
+if test "${enable_largefile+set}" = set; then :
+ enableval=$enable_largefile;
+fi
+
+if test "$enable_largefile" != no; then
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5
+$as_echo_n "checking for special C compiler options needed for large files... " >&6; }
+if test "${ac_cv_sys_largefile_CC+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_cv_sys_largefile_CC=no
+ if test "$GCC" != yes; then
+ ac_save_CC=$CC
+ while :; do
+ # IRIX 6.2 and later do not support large files by default,
+ # so use the C compiler's -n32 option if that helps.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/types.h>
+ /* Check that off_t can represent 2**63 - 1 correctly.
+ We can't simply define LARGE_OFF_T to be 9223372036854775807,
+ since some C++ compilers masquerading as C compilers
+ incorrectly reject 9223372036854775807. */
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+ && LARGE_OFF_T % 2147483647 == 1)
+ ? 1 : -1];
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+ if ac_fn_c_try_compile "$LINENO"; then :
+ break
+fi
+rm -f core conftest.err conftest.$ac_objext
+ CC="$CC -n32"
+ if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_sys_largefile_CC=' -n32'; break
+fi
+rm -f core conftest.err conftest.$ac_objext
+ break
+ done
+ CC=$ac_save_CC
+ rm -f conftest.$ac_ext
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_CC" >&5
+$as_echo "$ac_cv_sys_largefile_CC" >&6; }
+ if test "$ac_cv_sys_largefile_CC" != no; then
+ CC=$CC$ac_cv_sys_largefile_CC
+ fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5
+$as_echo_n "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; }
+if test "${ac_cv_sys_file_offset_bits+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ while :; do
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/types.h>
+ /* Check that off_t can represent 2**63 - 1 correctly.
+ We can't simply define LARGE_OFF_T to be 9223372036854775807,
+ since some C++ compilers masquerading as C compilers
+ incorrectly reject 9223372036854775807. */
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+ && LARGE_OFF_T % 2147483647 == 1)
+ ? 1 : -1];
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_sys_file_offset_bits=no; break
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#define _FILE_OFFSET_BITS 64
+#include <sys/types.h>
+ /* Check that off_t can represent 2**63 - 1 correctly.
+ We can't simply define LARGE_OFF_T to be 9223372036854775807,
+ since some C++ compilers masquerading as C compilers
+ incorrectly reject 9223372036854775807. */
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+ && LARGE_OFF_T % 2147483647 == 1)
+ ? 1 : -1];
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_sys_file_offset_bits=64; break
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ ac_cv_sys_file_offset_bits=unknown
+ break
+done
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_file_offset_bits" >&5
+$as_echo "$ac_cv_sys_file_offset_bits" >&6; }
+case $ac_cv_sys_file_offset_bits in #(
+ no | unknown) ;;
+ *)
+cat >>confdefs.h <<_ACEOF
+#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits
+_ACEOF
+;;
+esac
+rm -rf conftest*
+ if test $ac_cv_sys_file_offset_bits = unknown; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5
+$as_echo_n "checking for _LARGE_FILES value needed for large files... " >&6; }
+if test "${ac_cv_sys_large_files+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ while :; do
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/types.h>
+ /* Check that off_t can represent 2**63 - 1 correctly.
+ We can't simply define LARGE_OFF_T to be 9223372036854775807,
+ since some C++ compilers masquerading as C compilers
+ incorrectly reject 9223372036854775807. */
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+ && LARGE_OFF_T % 2147483647 == 1)
+ ? 1 : -1];
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_sys_large_files=no; break
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#define _LARGE_FILES 1
+#include <sys/types.h>
+ /* Check that off_t can represent 2**63 - 1 correctly.
+ We can't simply define LARGE_OFF_T to be 9223372036854775807,
+ since some C++ compilers masquerading as C compilers
+ incorrectly reject 9223372036854775807. */
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+ && LARGE_OFF_T % 2147483647 == 1)
+ ? 1 : -1];
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_sys_large_files=1; break
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ ac_cv_sys_large_files=unknown
+ break
+done
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_large_files" >&5
+$as_echo "$ac_cv_sys_large_files" >&6; }
+case $ac_cv_sys_large_files in #(
+ no | unknown) ;;
+ *)
+cat >>confdefs.h <<_ACEOF
+#define _LARGE_FILES $ac_cv_sys_large_files
+_ACEOF
+;;
+esac
+rm -rf conftest*
+ fi
+
+
+fi
+
# The cast to long int works around a bug in the HP C Compiler
# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
diff -r 0fcd98504516 modules/syscalls/configure.in
--- a/modules/syscalls/configure.in Thu Jul 28 17:37:16 2011 -0400
+++ b/modules/syscalls/configure.in Fri Jul 29 10:10:30 2011 -0400
@@ -20,6 +20,7 @@ sys/statvfs.h sys/statfs.h sys/param.h f
if test "$ac_cv_header_shlobj_h" = yes ; then
LIBS=${LIBS}' -luser32 -lole32 -loleaut32 -luuid';
fi
+AC_SYS_LARGEFILE
AC_CHECK_SIZEOF(off_t)
AC_CHECK_SIZEOF(gid_t)
AC_CHECK_SIZEOF(pid_t)
|