Hide Forgot
Description of problem: gcc/ld options in menuselect/Makefile & utils/Makefile are hard-coded (worse still, previously set CFLAGS/LDFLAGS/ASTFLAGS are completely ignored, even if they are included!) causing cross-compilation to fail. Version-Release number of selected component (if applicable): 10.0.0 (RAWHIDE) How reproducible: Always Steps to Reproduce: 1. rpmbuild --target=i686 asterisk.spec (assuming the build=x86_64 or anything other than the target - i686) 2. 3. Actual results: Output similar to the following: /usr/bin/ld: i386 architecture of input file `mxml/libmxml.a(mxml-file.o)' is incompatible with i386:x86-64 output /usr/bin/ld: i386 architecture of input file `mxml/libmxml.a(mxml-node.o)' is incompatible with i386:x86-64 output /usr/bin/ld: i386 architecture of input file `mxml/libmxml.a(mxml-search.o)' is incompatible with i386:x86-64 output /usr/bin/ld: i386 architecture of input file `mxml/libmxml.a(mxml-private.o)' is incompatible with i386:x86-64 output /usr/bin/ld: i386 architecture of input file `mxml/libmxml.a(mxml-string.o)' is incompatible with i386:x86-64 output /usr/bin/ld: i386 architecture of input file `mxml/libmxml.a(mxml-entity.o)' is incompatible with i386:x86-64 output collect2: ld returned 1 exit status make[1]: *** [menuselect] Error 1 make[1]: Leaving directory `/home/mr-4/rpmbuild/BUILD/asterisk-10.0.0/menuselect' make: *** [menuselect/menuselect] Error 2 make: *** Waiting for unfinished jobs.... main res addons error: Bad exit status from /var/tmp/rpm-tmp.qRUoKX (%build) [...] gcc -g -c -I/home/mr-4/rpmbuild/BUILD/asterisk-10.0.0/include -DSTANDALONE /home/mr-4/rpmbuild/BUILD/asterisk-10.0.0/main/ast_expr2f.c -o ast_expr2fz.o gcc -g -c -I/home/mr-4/rpmbuild/BUILD/asterisk-10.0.0/include -DSTANDALONE2 /home/mr-4/rpmbuild/BUILD/asterisk-10.0.0/main/ast_expr2.c -o ast_expr2z.o gcc -g -o check_expr2 ast_expr2fz.o ast_expr2z.o -lm The above produces build arch binary (x86_64 instead of i686): "check_expr2" in this case. Expected results: menuselect & utils Makefile(s) to honour ASTCFLAGS/CFLAGS/LDFLAGS as set during build (better still, use Makefile.in and autoconf instead) Additional info: I am attaching two patches - asterisk-cross.patch, as well as asterisk-spec.patch. Together they should make cross-compilation of asterisk possible. Please note that asterisk-spec.patch contains *all* changes I've made to the original asterisk.spec file - that includes what I reported in Bug 787389 as well as Bug 787387. Some necessary dependencies were also omitted from the original file (like SDL*), so they were added back in that patch. With these two patches applied cross-compilation is enabled and made possible.
Created attachment 559702 [details] asterisk patch allowing cross-compilation
Created attachment 559703 [details] menuselect/Makefile & utils/Makefile corrections allowing cross-compilation
The changes to the Asterisk makefiles should be taken upstream. I really don't want to be adding more patches that would need to be maintained locally, there are already too many as it is. I'll take a look at the patches to the specfile soon as I need to get some updates out soon.
I can't just "take them upstream" because both patches need to be applied in tandem - one without the other won't help much in cross-compilation environment, simply because the CFLAGS/ASTCFLAGS/LDFLAGS environment variables are not set/respected by a "vanilla" build (the build would simply fail). The .spec patch first enables this and it also fixes some important dependency issues where cross-compilation is concerned (setting the correct bit-ness as well as host-arch libraries dependencies).
Obviously, the .spec file patch can't go upstream, but the changes to the Makefiles certainly can. I'm sure that there are people that would like to cross-compile Asterisk on platforms other than Fedora that would appreciate the patches.
This bug appears to have been reported against 'rawhide' during the Fedora 19 development cycle. Changing version to '19'. (As we did not run this process for some time, it could affect also pre-Fedora 19 development cycle bugs. We are very sorry. It will help us with cleanup during Fedora 19 End Of Life. Thank you.) More information and reason for this action is here: https://fedoraproject.org/wiki/BugZappers/HouseKeeping/Fedora19
This message is a notice that Fedora 19 is now at end of life. Fedora has stopped maintaining and issuing updates for Fedora 19. It is Fedora's policy to close all bug reports from releases that are no longer maintained. Approximately 4 (four) weeks from now this bug will be closed as EOL if it remains open with a Fedora 'version' of '19'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version. Thank you for reporting this issue and we are sorry that we were not able to fix it before Fedora 19 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora, you are encouraged change the 'version' to a later Fedora version prior this bug is closed as described in the policy above. Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete.
Fedora 19 changed to end-of-life (EOL) status on 2015-01-06. Fedora 19 is no longer maintained, which means that it will not receive any further security or bug fix updates. As a result we are closing this bug. If you can reproduce this bug against a currently maintained version of Fedora please feel free to reopen this bug against that version. If you are unable to reopen this bug, please file a new report against the current release. If you experience problems, please add a comment to this bug. Thank you for reporting this bug and we are sorry it could not be fixed.