Summary:ASTERISK-10584: compiling with MTX_PROFILE broken
Reporter:snuffy (snuffy)Labels:
Date Opened:2007-10-21 21:45:44Date Closed:2007-10-25 11:20:01
Versions:Frequency of
Description:   [CC] ast_expr2.c -> ast_expr2.o
In file included from /home/bradl/asterisk-latest/include/asterisk/linkedlists.h:23,
                from /home/bradl/asterisk-latest/include/asterisk/frame.h:37,
                from /home/bradl/asterisk-latest/include/asterisk/channel.h:146,
                from /home/bradl/asterisk-latest/include/asterisk/pbx.h:27,
                from ../main/ast_expr2.y:202:
/home/bradl/asterisk-latest/include/asterisk/lock.h: In function `__ast_pthread_mutex_lock':
/home/bradl/asterisk-latest/include/asterisk/lock.h:318: error: `mtx_prof' undeclared (first use in this function)
/home/bradl/asterisk-latest/include/asterisk/lock.h:318: error: (Each undeclared identifier is reported only once
/home/bradl/asterisk-latest/include/asterisk/lock.h:318: error: for each function it appears in.)
make[1]: *** [ast_expr2.o] Error 1
make: *** [utils] Error 2
Comments:By: Andrey S Pankov (casper) 2007-10-22 09:26:32

That's because ASTERISK_FILE_VERSION is missing after including asterisk.h

By: Jason Parker (jparker) 2007-10-22 10:53:03

I could have sworn I already fixed this..  Can you run a make dist-clean, and give it another shot?

By: snuffy (snuffy) 2007-10-22 17:41:59

Done a make dist-clean still same result, i do remember you fixing compilation before but it appears broken again.

With mtx_profile on failed build on centos 4.4 and opensolaris ON 64

By: Andrey S Pankov (casper) 2007-10-23 05:27:01

It's broken in trunk again.


By: Steve Murphy (murf) 2007-10-24 18:09:05

uh, what menuselect options do you turn on for this to happen?

By: Steve Murphy (murf) 2007-10-25 10:33:35


OK, I'm reproducing this. Didn't notice the MTX option before!

By: Steve Murphy (murf) 2007-10-25 11:09:52

OK, I see why this faked everyone out! The problem is, that ast_expr2.c is generated by bison from ast_expr2.y. NEVER change the .c file, because your
changes will be lost, when someone makes a change and regenerates ast_expr2.c.

So, change the .y file instead, and then follow the rules in the
Makefile to generate the .c, which has to be done by hand, then
commit them BOTH to svn, so users out there don't have to try using bison
themselves. Oh, and make sure you are using the correct version of bison,
or disaster will result.

There were 2 files in trunk that needed this fix; so I'll use the commit template to close this bug here in a second.

By: Digium Subversion (svnbot) 2007-10-25 11:20:00

Repository: asterisk
Revision: 87024

U   trunk/main/ast_expr2.c
U   trunk/main/ast_expr2.y
U   trunk/res/res_config_sqlite.c

r87024 | murf | 2007-10-25 11:19:58 -0500 (Thu, 25 Oct 2007) | 1 line

closes issue ASTERISK-10584 - each file needs to define ASTERISK_FILE_VERSION, if you are going to set MTX_PROFILE in the compiler flags; the problem was that the fixes were getting made to the generated .c file, and erased the next time someone regenerated that file from the corresponding .y or .flex file. Moral of story: keep your eyes open and make mods to the .y (or flex input file) and re-run bison (or flex) as the Makefile directs for that file, and then check in both. Also, res_config_sqlite was kinda missed, and has the same issue.