[asterisk-dev] ast_expr2.c woes in trunk when cross-compiling

Michiel van Baak michiel at vanbaak.info
Sat Jul 7 07:02:54 CDT 2007


On 04:10, Sat 07 Jul 07, Brian Capouch wrote:
> I try to keep trunk built up against the openWRT kamikaze trunk. 
> Tonight, for the first time in a long time, things failed spectacularly. 
> I finally got things to go, but only after an awful, awful hack.
> 
> I just built 73771; the last one that built OK for me was 68575.  I 
> hadn't done any in between.
> 
> Synopsis: There appears to be a fairly recent, major rewrite of 
> ast_expr2.c, found in ~/main.  This led to two problems with my 
> cross-build for openWRT.
> 
> First, __USE_ISOC99 got deffed--is it supposed to be?--and that caused 
> the "l" versions of all the functions to be chosen, e.g. floorl for 
> FUNC_FLOOR, ceill for FUNC_CEIL, etc.  Neither my compiler nor loader 
> liked that one little bit, as none of those functions are in the math lib.
> 
> So I hacked around that and #undeffed __USE_ISOC99.  But that still 
> resulted in the definition of some functions that are missing in my math 
> library, which caused problems--the full error output is at the end of 
> the mail.
> 
> The fix?  I'm ashamed to say that completely removing the following in 
> ast_expr2.c allowed me to complete the build:
> 
> FUNC_REMAINDER
> FUNC_TRUNC
> FUNC_LOG2
> FUNC_EXP2
> FUNC_ROUND
> 
> Will that lead me to tears here in a few minutes, when I fire up my 
> server?  Time will tell :-)
> 
> B.
> 
> ****  Below are (most of--fat fingers cut a bit) the errors I got once I 
> undeffed __USE_ISOC99 ******
> 
> ast_expr2.y: In function 'op_func':
> ast_expr2.y:773: warning: implicit declaration of function 'round'
> ast_expr2.y:773: warning: incompatible implicit declaration of built-in 
> function 'round'
> ast_expr2.y:791: warning: implicit declaration of function 'trunc'
> ast_expr2.y:791: warning: incompatible implicit declaration of built-in 
> function 'trunc'
> ast_expr2.y:809: warning: implicit declaration of function 'exp2'
> ast_expr2.y:809: warning: incompatible implicit declaration of built-in 
> function 'exp2'
> ast_expr2.y:827: warning: implicit declaration of function 'log2'
> ast_expr2.y:827: warning: incompatible implicit declaration of built-in 
> function 'log2'
> 
> ast_expr2.o: In function `op_func':
> /usr/src/brianc/trunk/build_mipsel/asterisk-svn-trunk/utils/ast_expr2.y:846: 
> undefined reference to `remainder'
> /usr/src/brianc/trunk/build_mipsel/asterisk-svn-trunk/utils/ast_expr2.y:809: 
> undefined reference to `exp2'
> /usr/src/brianc/trunk/build_mipsel/asterisk-svn-trunk/utils/ast_expr2.y:827: 
> undefined reference to `log2'
> ast_expr2.o: In function `make_number':
> /usr/src/brianc/trunk/build_mipsel/asterisk-svn-trunk/utils/ast_expr2.y:773: 
> undefined reference to `round'
> /usr/src/brianc/trunk/build_mipsel/asterisk-svn-trunk/utils/ast_expr2.y:791: 
> undefined reference to `trunc'

Hi,

I tried to build trunk on my OpenBSD dev box and also failed
because of the errors in ast_expr2.y

   [LD] aelparse.o aelbison.o pbx_ael.o ael_main.o
   ast_expr2f.o ast_expr2.o strcompat.o -> aelparse
   aelbison.o(.text+0x128f): In function `ael_yyparse':
   /home/michiel/dev/personal/asterisk/asterisk-trunk/utils/ael.y:450:
   warning: strcpy() is almost always misused, please use
   strlcpy()
   pbx_ael.o(.text+0x4ab2): In function `pbx_load_module':
   /home/michiel/dev/personal/asterisk/asterisk-trunk/utils/pbx_ael.c:4097:
   warning: sprintf() is often misused, please use
   snprintf()
   aelbison.o(.text+0x129c): In function `ael_yyparse':
   /home/michiel/dev/personal/asterisk/asterisk-trunk/utils/ael.y:451:
   warning: strcat() is almost always misused, please use
   strlcat()
   ast_expr2.o(.text+0x2555): In function `op_func':
   /home/michiel/dev/personal/asterisk/asterisk-trunk/utils/ast_expr2.y:385:
   undefined reference to `exp2'
   ast_expr2.o(.text+0x27c0):/home/michiel/dev/personal/asterisk/asterisk-trunk/utils/ast_expr2.y:385:
   undefined reference to `log2'
   collect2: ld returned 1 exit status
   gmake[1]: *** [aelparse] Error 1
   gmake: *** [utils] Error 2

see also http://bugs.digium.com/view.php?id=10145
-- 

Michiel van Baak
michiel at vanbaak.eu
http://michiel.vanbaak.eu
GnuPG key: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x71C946BD

"Why is it drug addicts and computer afficionados are both called users?"

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.digium.com/pipermail/asterisk-dev/attachments/20070707/a5ab1d7a/attachment.pgp 


More information about the asterisk-dev mailing list