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

abelbeck (JIRA) noreply at issues.asterisk.org
Tue Sep 6 16:03:01 CDT 2016


     [ https://issues.asterisk.org/jira/browse/ASTERISK-26342?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

abelbeck updated ASTERISK-26342:
--------------------------------

    Attachment: asterisk-13-configure-arch-native.patch

asterisk-13-configure-arch-native.patch

> [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