Uploaded image for project: 'FreeSWITCH'
  1. FreeSWITCH
  2. FS-6292 NetBSD Support
  3. FS-6309

lrintl is missing from NetBSD's libm

    XMLWordPrintable

    Details

    • Type: Sub-task
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.5
    • Component/s: Build-System
    • Labels:
      None
    • Environment:
      NetBSD dagonet.omniscient.local 6.1.3 NetBSD 6.1.3 (GENERIC_HZ) #1: Sat Mar 1 19:18:46 EST 2014 met@dagonet.omniscient.local:/data/netbsd/obj/usr/src/sys/arch/i386/compile/GENERIC_HZ i386
    • CPU Architecture:
      x86
    • Kernel:
      NetBSD
    • Userland:
      NetBSD
    • Distribution:
      NetBSD
    • Distribution Version:
      NetBSD 6.x
    • Compiler:
      gcc
    • FreeSWITCH GIT Revision:
      fd38a255f8f1fa3fa18b1b5263990af8ac4bc632
    • GIT Master Revision hash::
      fd38a255f8f1fa3fa18b1b5263990af8ac4bc632
    • Target Version:
      1.5

      Description

      Compilation stops with:

      cc1: warnings being treated as errors
      In file included from libs/spandsp/src/plc.c:48:0:
      libs/spandsp/src/spandsp/saturated.h: In function 'fsaturate':
      libs/spandsp/src/spandsp/saturated.h:184:5: error: implicit declaration of function 'lrintl'
      libs/spandsp/src/spandsp/saturated.h:184:22: error: incompatible implicit declaration of built-in function 'lrintl'
      Makefile:1785: recipe for target 'libfreeswitch_la-plc.lo' failed

      A call to lrint() is made

      Which is defined in:
      /usr/include/gcc-4.5/tgmath.h
      as a macro that chooses between lrintf, lrint & lrintl (for floar, double & long double) respectively.
      See: http://man7.org/linux/man-pages/man3/lrintl.3.html for the three functions.

      But NetBSD only defines two of those three choices (missing lrintl)
      See: http://mail-index.netbsd.org/netbsd-bugs/2012/10/24/msg030745.html for a hostorical bug report

      Even though saturated.h only needs the float version, the macro still expands all three options, hence the error.

      My current hack is to #undef the lrint macro

      #if defined(HAVE_TGMATH_H)
      #include <tgmath.h>
      #endif
      +#if defined(_NetBSD_)
      +#undef lrint
      +#endif
      #if defined(HAVE_MATH_H)
      #include <math.h>
      #endif

        Attachments

          Activity

            People

            • Assignee:
              mikej Mike Jerris
              Reporter:
              metay1 Michael Taylor
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: