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

Kristian Kielhofner kristian.kielhofner at gmail.com
Fri Sep 7 17:33:14 CDT 2007


On 9/7/07, Kristian Kielhofner <kristian.kielhofner at gmail.com> wrote:
>
> 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
>

Replying to myself,

  It looks like kamikaze (at least as of 7.07) does not build with C99
math functions enabled for architectures other than x86_64:

[kris at admin1 projects]$ grep C99 kamikaze_7.07/toolchain/uClibc/config/*
kamikaze_7.07/toolchain/uClibc/config/arm:# DO_C99_MATH is not set
kamikaze_7.07/toolchain/uClibc/config/armeb:# DO_C99_MATH is not set
kamikaze_7.07/toolchain/uClibc/config/avr32:# DO_C99_MATH is not set
kamikaze_7.07/toolchain/uClibc/config/cris:# DO_C99_MATH is not set
kamikaze_7.07/toolchain/uClibc/config/i386:# DO_C99_MATH is not set
kamikaze_7.07/toolchain/uClibc/config/mips:# DO_C99_MATH is not set
kamikaze_7.07/toolchain/uClibc/config/mipsel:# DO_C99_MATH is not set
kamikaze_7.07/toolchain/uClibc/config/powerpc:# DO_C99_MATH is not set
kamikaze_7.07/toolchain/uClibc/config/x86_64:DO_C99_MATH=y
[kris at admin1 projects]$

  This mini-patch should fix it on mipsel:

Index: toolchain/uClibc/config/mipsel
===================================================================
--- toolchain/uClibc/config/mipsel      (revision 8682)
+++ toolchain/uClibc/config/mipsel      (working copy)
@@ -50,7 +50,7 @@
 ARCH_HAS_MMU=y
 UCLIBC_HAS_FLOATS=y
 HAS_FPU=y
-# DO_C99_MATH is not set
+DO_C99_MATH=y
 KERNEL_SOURCE="./toolchain_build_mipsel/linux"
 C_SYMBOL_PREFIX=""
 HAVE_DOT_CONFIG=y

Again, let me know how it goes!

-- 
Kristian Kielhofner



More information about the asterisk-dev mailing list