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

Brian Capouch brianc at palaver.net
Sat Jul 7 03:10:38 CDT 2007


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'


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.




More information about the asterisk-dev mailing list