[asterisk-bugs] [JIRA] (ASTERISK-27563) Build process ignores DONT_OPTIMIZE and always sets -O3 -g3 gcc options

Corey Farrell (JIRA) noreply at issues.asterisk.org
Mon Jan 8 13:53:39 CST 2018


    [ https://issues.asterisk.org/jira/browse/ASTERISK-27563?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=241419#comment-241419 ] 

Corey Farrell commented on ASTERISK-27563:
------------------------------------------

The {{-g3}} option is always correct and we should never strip symbols.  If we did GDB would only be able to find global symbols.  Standard build process is for us to create binaries which include debug symbols, then the person who runs make && make install can strip if they want.  We absolutely should not change this or even create a menuselect option such as STRIP_DEBUG.  I don't know about Debian but rpmbuild will copy the symbols to asterisk-debuginfo RPM before stripping them from the binaries.  So when you build an RPM you get a huge asterisk-debuginfo package but your /usr/sbin/asterisk will be 3MB instead of 14MB.

I haven't tested to confirm this issue but if we are using {{-O3}} when DONT_OPTIMIZE is set that is an important bug.  Do you know what version this started in?  This is important enough to strongly consider dealing with it as a regression (posting to 13.19 and 15.2).  When people post backtraces from optimized binaries we ask them to recompile with DONT_OPTIMIZE, it's very important for that to work properly.

About your build, please confirm you did not use {{./configure --enable-coverage}}.

> Build process ignores DONT_OPTIMIZE and always sets -O3 -g3 gcc options
> -----------------------------------------------------------------------
>
>                 Key: ASTERISK-27563
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-27563
>             Project: Asterisk
>          Issue Type: Bug
>      Security Level: None
>          Components: Core/BuildSystem
>    Affects Versions: 13.18.5, GIT, 15.1.5
>            Reporter: George Joseph
>
> Somehow the DONT_OPTIMIZE process got messed up and we're always setting -O3 -g3 on gcc command lines.  The -O3 probably isn't too bad but -g3 adds a ton of debugging symbols to what should be a production release.
> {noformat}
> $ ls -al main/asterisk
> -rwxrwxr-x. 1 gtjoseph gtjoseph 14615664 Jan  8 06:27 main/asterisk
> $ strip -g main/asterisk
> $ ls -al main/asterisk
> -rwxrwxr-x. 1 gtjoseph gtjoseph 3128432 Jan  8 06:30 main/asterisk
> {noformat}
> We should also use -ggdb3 instead of just -g3 to get gdb extensions which include macro processing.   Actually, we should ALWAYS compile with -ggdb3 and then do a strip on the binaries during install if DON"T OPTIMIZE wasn't set.  Actually, actually, we should probably change DONT_OPTIMIZE so it only controls -O and create a new option for STRIP_DEBUG that defaults to yes for non-dev-mode builds.



--
This message was sent by Atlassian JIRA
(v6.2#6252)



More information about the asterisk-bugs mailing list