[asterisk-bugs] [JIRA] (ASTERISK-26342) [patch] Disable -march=native when cross-compiling

Rusty Newton (JIRA) noreply at issues.asterisk.org
Wed Sep 7 20:38:01 CDT 2016


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

Rusty Newton commented on ASTERISK-26342:
-----------------------------------------

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



> [patch] Disable -march=native when cross-compiling
> --------------------------------------------------
>
>                 Key: ASTERISK-26342
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-26342
>             Project: Asterisk
>          Issue Type: Bug
>      Security Level: None
>          Components: General
>    Affects Versions: 13.11.0
>         Environment: AstLinux 1.2.7 x86_64 (cross-compiled via Buildroot)
>            Reporter: abelbeck
>         Attachments: asterisk-13-configure-arch-native.patch
>
>
> 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.



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



More information about the asterisk-bugs mailing list