|
From: Chris B. <ch...@cn...> - 2008-03-21 14:18:36
|
Cristi Ciocaltea wrote: > Hi, > > I made some investigations regarding the problem with .wav files > processing ending up with the error message "Could not find data chunk". > Bellow is the environment configuration I've used: > gcc version 3.4.5 20051201 (Red Hat 3.4.5-2) > Red Hat Enterprise Linux ES release 4 (Nahant Update 3) running on > 32-bit architecture > Kernel 2.6.21.1 > > SoX is trying to use 64 bit offset values through "#define > _FILE_OFFSET_BITS 64". > The issue applies only for a C program when the offset parameter is > given as off_t type. > It seems like the gcc compiler does not bind fseeko to the fseeko64 > function implementation. > Note that it works OK for a similar CPP program (g++ is used instead > of gcc). > > In order to fix the issue, we have to use "#define _LARGEFILE_SOURCE". > The SoX configure script already performs a test for deciding whether > to use or not > this definition, but the final answer is "no": > "checking for _LARGEFILE_SOURCE value needed for large files... no" > Any ideas on what does the test consist of and how can it be improved? > > Trying to use CLFAGS=-D_LARGEFILE_SOURCE as an argument to configure > does not solve > the problem because the environment variable is never used during the > compilation process. > Could that be a bug in the configure script? Note that I've tried to > use also the > "export CLFAGS=-D_LARGEFILE_SOURCE" before running the configure > script, but I've got > the same result. > > The workarround is to manually modify the src/soxconfig.h file > generated after running configure: > > /* Define to 1 to make fseeko visible on some hosts (e.g. glibc 2.2). */ > #define _LARGEFILE_SOURCE 1 > > Best regards, > Cristian > > ------------------------------------------------------------------------ Couple of quick notes... Haven't been able to study it much more yet. First, try passing in CPPFLAGS=-D_LARGEFILE_SOURCE as the work around. Thats what is passed to pre-processor which is most important time for this. I'd be interested in hearing if that does work for you. Next, the macros that check for large file support are defined under Fedora at /usr/share/autoconf/autoconf/specific.m4. Look for AC_SYS_LARGEFILE and probably more important is AC_SYS_LARGEFILE_TEST_INCLUDES. Would you mind emailing me directly a copy of the autoconf macro file (specific.m4 probably) that contains your AC_SYS_LARGEFILE? I'd like to compare it to my version and see if any bugfixes exist in recent versions. There is a note in that file about different behavior between C and C++ compilers which validates part of what your seeing. Chris |