[asterisk-dev] Update: Cross-compiling woes under openWRT

Kristian Kielhofner kristian.kielhofner at gmail.com
Fri Sep 7 16:51:37 CDT 2007


On 9/7/07, Brian Capouch <brianc at palaver.net> wrote:
>
> It does take a while, but the output is (almost) perfect for the kinds
> of things I'm doing.
>
> Now that trunk is working again there's an incentive to do more frequent
> builds so that show-stopper issues (like the one file fixed today) will
> be caught at commit time.
>
> Regarding the functions missing in the openWRT math lib (round() and
> trunc() )--could I solicit some guidance as to what the preferred way to
> get them would be?  I know just enough to be dangerous, so I'm not
> confident that my inability to find those functions in the math library
> sources means they're really not there.
>
> But if they aren't, is the proper approach to write them inline as part
> of ast_expr2?
>
> Thanks.
>
> b.
>

Brian,

  I knew I saw something about this somewhere...  Sorry that it took
me so long to find it.

  I can't find an exact doc, but it looks like those functions are
part of the C99 spec:

http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2002/n1354.txt

..cut from doc...
C99 adds all sorts of stuff:

-- macros FP_FAST_FMA, FP_FAST_FMAF, FP_FAST_FMAL to signal the presence of
fused multiply/add

-- macros FP_ILOGB0, FP_ILOGBNAN for error returns from function ilogb

-- macros FP_INFINITE, FP_NAN, FP_NORMAL, FP_SUBNORMAL, FP_ZERO for category
returns from macro fpclassify

-- macros HUGE_VALF, HUGE_VALL to supplement HUGE_VAL

-- macros INFINITY, NAN for special floating-point values

-- macros MATH_ERRNO, MATH_ERREXCEPT, math_errhandling to describe handling of
math errors

-- function macros signbit, fpclassify, isfinite, isinf, isnan, isnormal,
isgreater, isgreaterequal, isless, islessequal, islessgreater, isunordered
to test floating-point values

-- types double_t and float_t for tighter control over computational types

-- functions acosh, asinh, atanh, cbrt, copysign, erf, erfc, exp2, expm1,
fdim, fma, fmax, fmin, hypot, ilogb, lgamma, llrint, llround, log1p, log2,
logb, lrint, lround, nan, nearbyint, nextafter, nexttoward, remainder,
remquo, rint, round, scalbln, scanbn, tgamma, and trunc, plus float
versions (ending in f) and long double versions (ending in l)

...end cut...

  OpenWRT uses uclibc, no?  In my builds with uclibc I set
DO_C99_MATH=y in .config before I build uclibc.  According to the help
on this topic, it adds about 35K to builds on x86.  I don't know about
mips/mipsel/arm/ppc/etc.  Asterisk 1.4.11 compiles (and works, so far)
just perfectly with AstLinux trunk using uClibc 0.9.28 with
DO_C99_MATH=y.

  You should be able to tweak the uclibc config for OpenWRT to include
C99.  Let us know how much bigger it makes your libs (and if it works
or not)!

-- 
Kristian Kielhofner



More information about the asterisk-dev mailing list