[Home]

Summary:ASTERISK-26342: [patch] Disable -march=native when cross-compiling
Reporter:abelbeck (abelbeck)Labels:patch
Date Opened:2016-09-06 15:58:49Date Closed:
Priority:MajorRegression?Yes
Status:Open/NewComponents:General
Versions:13.11.0 Frequency of
Occurrence
Constant
Related
Issues:
is caused byASTERISK-25289 Build System does not respect CFLAGS and CXXFLAGS when building menuselect
Environment:AstLinux 1.2.7 x86_64 (cross-compiled via Buildroot)Attachments:( 0) asterisk-13-configure-arch-native.patch
Description:The resulting fix for issue ASTERISK-25289 did not take into account for "cross-compiling".
http://git.asterisk.org/gitweb/?p=asterisk/asterisk.git;a=commit;h=3be6fa1e4b920fe1ccec67e4a78e101354a767d9

Our project has cross-compiled Asterisk for many years, we pass CFLAGS and the resulting AST_NATIVE_ARCH was undefined, it worked.

Then with Asterisk 13.11.0 the resulting binary crashed with illegal operand at startup, shortly after reading "/etc/localtime".

After much head-scratching and hair-pulling I discovered this change where -march=native was being defined behind our back.

Adding:
{noformat}
menuselect/menuselect --disable BUILD_NATIVE menuselect.makeopts
{noformat}
solves the problem, but it would seem less fragile and better to first test for "cross-compiling" and set AST_NATIVE_ARCH=0, then proceed as per the previous fix.

Patch attached.  Works in my testing.
Comments:By: Asterisk Team (asteriskteam) 2016-09-06 15:58:50.113-0500

Thanks for creating a report! The issue has entered the triage process. That means the issue will wait in this status until a Bug Marshal has an opportunity to review the issue. Once the issue has been reviewed you will receive comments regarding the next steps towards resolution.

A good first step is for you to review the [Asterisk Issue Guidelines|https://wiki.asterisk.org/wiki/display/AST/Asterisk+Issue+Guidelines] if you haven't already. The guidelines detail what is expected from an Asterisk issue report.

Then, if you are submitting a patch, please review the [Patch Contribution Process|https://wiki.asterisk.org/wiki/display/AST/Patch+Contribution+Process].

By: abelbeck (abelbeck) 2016-09-06 16:01:48.663-0500

asterisk-13-configure-arch-native.patch

By: Rusty Newton (rnewton) 2016-09-07 20:37:52.397-0500

Thanks for the patch! Once you've followed the Code Review process [1] and submitted your code to Gerrit [2] be sure to edit this JIRA issue and add the Gerrit review URL in the appropriate field.

Thanks!

[1] https://wiki.asterisk.org/wiki/display/AST/Code+Review
[2] https://wiki.asterisk.org/wiki/display/AST/Gerrit+Usage



By: abelbeck (abelbeck) 2016-09-07 22:22:44.335-0500

Sorry, time limits my contribution to discussion here.

If someone else want to follow the Review / Gerrit process, feel free.