Missing -D_FILE_OFFSET_BITS=64 leads to files not opening (x86 /32bit)
Dear all,
thank you for all the effort putting a distriubtion together.
After upgrading to the lastly relased stable, I found
that pdflatex would not find (and therefore compile) the files
given on the command line, which were mounted by CIFS.
I traced the problem down to the kpathsea/readable.c library, where
the stat fails, but the error is not handled properly.
It fails because the offset is to large. The problem was solved
(following the stat 2 man page) defining -D_FILE_OFFSET_BITS=64.
(see also the attached patch).
Could that be that AC_SYS_LARGEFILE is missing in
configure.ac while it is listed in common.ac.orig
Happy to answer any further questions
Sincerely yours
Pierre Schnizer
--
+---------------------------------------------------------------------+
Pierre Schnizer <p.schnizer@gsi.de>
GSI Helmholtzzentrum fuer Schwerionenforschung GmbH
Planckstrasse 1
D-64291 Darmstadt
www.gsi.de
Gesellschaft mit beschraenkter Haftung
Sitz der Gesellschaft: Darmstadt
Handelsregister: Amtsgericht Darmstadt, HRB 1528
Geschaeftsfuehrung: Professor Dr. Dr. h.c. Horst Stoecker, Dr. Hartmut
Eickhoff
Vorsitzende des Aufsichtsrates: Dr. Beatrix Vierkorn-Rudolph
Stellvertreter: Ministerialdirigent Dr. Rolf Bernhardt
+---------------------------------------------------------------------+
diff -r -u -d texlive-bin-2009/debian/rules texlive-bin-2009-modified//debian/rules
--- texlive-bin-2009/debian/rules 2011-03-12 21:23:52.000000000 +0100
+++ texlive-bin-2009-modified//debian/rules 2011-03-11 17:43:19.000000000 +0100
@@ -18,6 +18,11 @@
ifneq (,$(filter $(DEB_BUILD_ARCH),$(GCC_44_ARCHES)))
export CC=gcc-4.4
export CXX=g++-4.4
+ export CC="$CC -g -ggdb"
+ export CXX="$CXX -g -ggdb"
+else
+ export CC=gcc -D_FILE_OFFSET_BITS=64
+ export CXX=g++ -D_FILE_OFFSET_BITS=64
endif
ifneq (,$(filter $(DEB_BUILD_ARCH),$(RELAX_ARCHES)))
diff -r -u -d texlive-bin-2009/texk/kpathsea/readable.c texlive-bin-2009-modified//texk/kpathsea/readable.c
--- texlive-bin-2009/texk/kpathsea/readable.c 2009-03-16 16:13:07.000000000 +0100
+++ texlive-bin-2009-modified//texk/kpathsea/readable.c 2011-03-11 17:59:52.000000000 +0100
@@ -58,9 +58,47 @@
!(st & FILE_ATTRIBUTE_DIRECTORY));
}
#else
+
+#if 0
+static int
+readdable(const char * fn, struct stat *st)
+{
+ int flag;
+
+ flag = access(fn, R_OK);
+ if(flag != 0){
+ fprintf(stderr, "%s:%d readdable: Failed on access for %s\n",
+ __FILE__, __LINE__, fn);
+ return 0;
+ }
+ flag = stat (fn, st);
+ if(flag != 0){
+ fprintf(stderr, "%s:%d readdable: Failed on stat for %s with errno %d ? EOVERFLOW = %d\n",
+ __FILE__, __LINE__, fn, errno, EOVERFLOW);
+ perror("Stat failed:");
+
+ return 0;
+ }
+
+ flag = S_ISDIR (st->st_mode);
+ if (flag == 0){
+ fprintf(stderr, "%s:%d file readdable %s\n",
+ __FILE__, __LINE__, fn);
+ return 1;
+ }
+
+ fprintf(stderr, "%s:%d readdable: Failed on stat for %s\n",
+ __FILE__, __LINE__, fn);
+ return 0;
+
+}
+#define READABLE(fn, st) readdable(fn, &(st))
+#else
#define READABLE(fn, st) \
(access (fn, R_OK) == 0 && stat (fn, &(st)) == 0 && !S_ISDIR (st.st_mode))
#endif
+#endif
+
/* POSIX invented the brain-damage of not necessarily truncating
filename components; the system's behavior is defined by the value of
Reply to: