Bug#720440: mpg123: mpg123 does not build LFS wrappers on kfreebsd-i386

Reinhard Tartler siretart at gmail.com
Tue Aug 27 21:49:08 UTC 2013


severity 720440 serious
stop

On Thu, Aug 22, 2013 at 8:39 AM, Thomas Orgis <thomas-forum at orgis.org> wrote:

> The long-term fix would make the mpg123 build aware of that and trigger
> generation of _64 functions as direct api calls, without suffix as
> alias to those and _32 wrapper functions that map long int offsets to
> the 64 bit ones. I cannot promise a time scale to work on that myself,
> due to RL pressure. One needs to modify configure.ac to check the size
> of off_t in case of empty _FILE_OFFSET_BITS setting from
> AC_SYS_LARGEFILE and trigger generation of _64 functions (or, rather
> _(8*sizeof(off_t) functions) if sizeof(off_t) != sizeof(long). This
> should only cover modification of
>
> configure.ac
> src/libmpg123/lfs_wrap.c
> src/libmpg123/lfs_alias.c
> src/libmpg123/mpg123.h.in

I've started with this patch to configure.ac

diff --git a/configure.ac b/configure.ac
index d00fbce..3fd54ae 100644
--- a/configure.ac
+++ b/configure.ac
@@ -934,12 +934,29 @@ AC_CHECK_SIZEOF(off_t,4)
 AC_CHECK_SIZEOF(int32_t)
 AC_CHECK_SIZEOF(long,4)

+dnl unless we are on e.g., kfreebsd-i386, then enable it anyways,
here off_t is wide
+dnl cf. http://lists.gnu.org/archive/html/autoconf/2003-01/msg00010.html
+AC_MSG_CHECKING(whether system is 32bit but has 64bit off_t)
+ac_cv_sys_wide_off_t="no"
+if test ".$ac_cv_sizeof_int32_t$ac_cv_sys_file_offset_bits$ac_cv_sizeof_off_t"
= ".4no8"; then
+       # Add dual-mode wrapper code.anyways
+       LFS_LOBJ=lfs_wrap.lo
+       ac_cv_sys_wide_off_t="yes"
+       AC_DEFINE(LARGEFILE_WIDE64_OFF_T, 1,
+       [whether the system is 32bit, but has 64bit off_t])
+fi
+AC_MSG_RESULT([$ac_cv_sys_wide_off_t])
+
 # The alias functions want to know the native off_t bits.
 # "Native" also means large file offsets, if enabled, it's what is
native to the mpg123 library.
 if test "x$ac_cv_sizeof_long" = "x"; then
   AC_MSG_ERROR([Cannot determine sizeof(long)?])
 else
-  LFS_ALIAS_BITS=`expr "$ac_cv_sizeof_long" "*" "8"`
+  if test ".$ac_cv_sys_wide_off_t" = ".no"; then
+     LFS_ALIAS_BITS=`expr "$ac_cv_sizeof_long" "*" "8"`
+  else
+     LFS_ALIAS_BITS=`expr "$ac_cv_sizeof_off_t" "*" "8"`
+  fi
   AC_DEFINE_UNQUOTED([LFS_ALIAS_BITS], $LFS_ALIAS_BITS,
     [Define this to the size of long type in bits, used for LFS
small/native alias functions.])
 fi

does this go into the right direction?

(the compilation itself fails with errors about multiple definition of
some symbols, i need more time to sort out the twisted ifdefs in
lfs_alias.c)


> Yeah, I'm convinced now: The mpg123 build is broken right now on this
> platform, as long as any user decides to define _FILE_OFFSET_BITS. The
> result will either be unresolved symbols (=64) or undefined behaviour
> (=32 ... handing 32 bit values into 64 bit arguments).

I agree. This makes this bug release-critical then.


-- 
regards,
    Reinhard



More information about the pkg-multimedia-maintainers mailing list