[asterisk-dev] [Code Review]: Rip out PROC selection in Asterisk makefiles

Kevin Fleming reviewboard at asterisk.org
Fri Apr 6 15:59:19 CDT 2012



> On April 6, 2012, 10:45 a.m., Paul Belanger wrote:
> > Are you proposing this for 1.8? or trunk only?  My vote is for trunk, since we've had problems in the past when changing the build process mid branch.
> 
> opticron wrote:
>     I was planning on 1.8+, but given that, I can switch 1.8 and 10 to "native" for PROC when building with x86_64 and only apply this to trunk.
> 
> Kevin Fleming wrote:
>     In order to do that you'll have to enhance the configure script to check whether -march=native is supported by the compiler, because it's a fairly recent addition to GCC. I have no objection to this being changed in all supported release branches and trunk; everyone who packages Asterisk has to work around this mess, and it doesn't provide much benefit.
>     
>     Another option would be to make '-march=native' be controlled via a menuselect option that defaults to 'on', thus providing the optimization that most users want but making it easy to disable when building packages.
> 
> opticron wrote:
>     The way that things are currently setup, the makefile will ignore PROC settings that gcc does not support and continue the build with whatever -march defaults to.

You have removed that logic in this patch, though. I still think that having the configure script check for '-march=native' support and then enabling it by default if it supported would solve the situation for most users; for anyone building Asterisk to run on the same machine it was built on, it will be built optimally if their compiler supports that mode. For anyone building Asterisk to run on a different machine from the build machine, they can disable the automatic '-march=native' build flag (to either use the compiler's default, or to provide their own).


- Kevin


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/1852/#review5949
-----------------------------------------------------------


On April 6, 2012, 10:18 a.m., opticron wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/1852/
> -----------------------------------------------------------
> 
> (Updated April 6, 2012, 10:18 a.m.)
> 
> 
> Review request for Asterisk Developers.
> 
> 
> Summary
> -------
> 
> The selection of PROC as k8 for -march on 64bit systems can cause gcc to create binaries that will not run on the local machine since it will optimize to use 3Dnow! and extended 3Dnow! instructions where possible.  This type of code shouldn't even really be in the Asterisk build system so I'm ripping it out in its entirety instead of changing k8 to native.
> 
> One downside of this change is that Asterisk will now be slightly less optimized by default than previously.
> 
> 
> This addresses bug ASTERISK-19462.
>     https://issues.asterisk.org/jira/browse/ASTERISK-19462
> 
> 
> Diffs
> -----
> 
>   branches/1.8/Makefile 361090 
>   branches/1.8/codecs/gsm/Makefile 361090 
>   branches/1.8/codecs/gsm/src/k6opt.s 361090 
>   branches/1.8/codecs/lpc10/Makefile 361090 
>   branches/1.8/makeopts.in 361090 
> 
> Diff: https://reviewboard.asterisk.org/r/1852/diff
> 
> 
> Testing
> -------
> 
> Ran this through the testsuite and it didn't break anything.
> 
> 
> Thanks,
> 
> opticron
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20120406/3c2d3ccc/attachment.htm>


More information about the asterisk-dev mailing list