[Home]

Summary:ASTERISK-24923: Enabling DONT_OPTIMIZE can cause link errors to be lost.
Reporter:Corey Farrell (coreyfarrell)Labels:
Date Opened:2015-03-30 07:17:25Date Closed:2017-12-29 16:08:59.000-0600
Priority:MajorRegression?
Status:Closed/CompleteComponents:Core/BuildSystem
Versions:SVN 11.16.0 13.2.0 Frequency of
Occurrence
Related
Issues:
Environment:Attachments:
Description:To see this issue in action, checkout trunk revision 433524.  Enable build of utils/aelparse.  Build with DONT_OPTIMIZE enabled will succeed, build with DONT_OPTIMIZE disabled will fail:
{noformat}
  [LD] aelparse.o aelbison.o pbx_ael.o hashtab.o lock.o ael_main.o ast_expr2f.o ast_expr2.o strcompat.o pval.o extconf.o -> aelparse
hashtab.o: In function `_ast_calloc':
include/asterisk/utils.h:568: undefined reference to `ast_log_safe'
...
hashtab.o:include/asterisk/utils.h:568: more undefined references to `ast_log_safe' follow
{noformat}

This seems to be the case with or without AST_DEVMODE, it doesn't matter what other options are chosen, DONT_OPTIMIZE somehow causes the call to ast_log_safe to disappear.  I'm unsure how this is possible.

Although these instructions are for testing against trunk I believe this issue applies to all branches.
Comments:By: Corey Farrell (coreyfarrell) 2017-12-29 16:08:59.569-0600

I don't think this can be fixed.  To detect link errors you should build Asterisk twice, once with and once without DONT_OPTIMIZE.  If running the full build twice COMPILE_DOUBLE should be disabled as it would only make the build take longer.