]> granicus.if.org Git - vim/commitdiff
patch 8.0.1444: missing -D_FILE_OFFSET_BITS=64 may cause problems v8.0.1444
authorBram Moolenaar <Bram@vim.org>
Wed, 31 Jan 2018 13:41:37 +0000 (14:41 +0100)
committerBram Moolenaar <Bram@vim.org>
Wed, 31 Jan 2018 13:41:37 +0000 (14:41 +0100)
Problem:    Missing -D_FILE_OFFSET_BITS=64 may cause problems if a library is
            compiled with it.
Solution:   Include -D_FILE_OFFSET_BITS if some CFLAGS has it. (James McCoy,
            closes #2600)

src/auto/configure
src/configure.ac
src/version.c

index 6a1677940855765d9fe8c7d3be643cbed3da4962..5657664a8ed8da345007a7e214db58bc99f1f014 100755 (executable)
@@ -14314,6 +14314,18 @@ $as_echo "no" >&6; }
 fi
 
 
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we need to force -D_FILE_OFFSET_BITS=64" >&5
+$as_echo_n "checking whether we need to force -D_FILE_OFFSET_BITS=64... " >&6; }
+if echo "$CFLAGS $LUA_CFLAGS $MZSCHEME_CFLAGS $PERL_CFLAGS $PYTHON_GETPATH_CFLAGS $PYTHON_CFLAGS $PYTHON3_CFLAGS $TCL_CFLAGS $RUBY_CFLAGS $GTK_CFLAGS" | grep -q D_FILE_OFFSET_BITS 2>/dev/null; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+  $as_echo "#define _FILE_OFFSET_BITS 64" >>confdefs.h
+
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking linker --as-needed support" >&5
 $as_echo_n "checking linker --as-needed support... " >&6; }
 LINK_AS_NEEDED=
index d78ec7a2b119ace05f335127385c6a8828b9d5b4..274ba5907422d2192a644e13b16f59d5c6c4279d 100644 (file)
@@ -4366,6 +4366,20 @@ if test "$GCC" = yes; then
 fi
 AC_SUBST(DEPEND_CFLAGS_FILTER)
 
+dnl On some systems AC_SYS_LARGEFILE determines that -D_FILE_OFFSET_BITS=64
+dnl isn't required, but the CFLAGS for some of the libraries we're using
+dnl include the define.  Since the define changes the size of some datatypes
+dnl (e.g. ino_t and off_t), all of Vim's modules must be compiled with a
+dnl consistent value.  It's therefore safest to force the use of the define
+dnl if it's present in any of the *_CFLAGS variables.
+AC_MSG_CHECKING(whether we need to force -D_FILE_OFFSET_BITS=64)
+if echo "$CFLAGS $LUA_CFLAGS $MZSCHEME_CFLAGS $PERL_CFLAGS $PYTHON_GETPATH_CFLAGS $PYTHON_CFLAGS $PYTHON3_CFLAGS $TCL_CFLAGS $RUBY_CFLAGS $GTK_CFLAGS" | grep -q D_FILE_OFFSET_BITS 2>/dev/null; then
+  AC_MSG_RESULT(yes)
+  AC_DEFINE(_FILE_OFFSET_BITS, 64)
+else
+  AC_MSG_RESULT(no)
+fi
+
 dnl link.sh tries to avoid overlinking in a hackish way.
 dnl At least GNU ld supports --as-needed which provides the same functionality
 dnl at linker level. Let's use it.
index 2c0306d6d957e58d57ab476facae3629f874fd29..bab773660fc7042913fdb727afc8e215e5778555 100644 (file)
@@ -771,6 +771,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1444,
 /**/
     1443,
 /**/