[asterisk-dev] Issues when cross-compiling Asterisk 1.8

Tilghman Lesher tlesher at digium.com
Thu Oct 28 13:10:57 CDT 2010


On Thursday 28 October 2010 08:04:40 Floimair Florian wrote:
> I'm using Asterisk on an embedded PowerPC module and for
> cross-compilation I used to have my own script, which always worked
> perfectly for all 1.4 versions. After adapting the script for Asterisk
> 1.8 I am able to build it but when starting Asterisk on the target I'm
> getting errors loading modules including a segmentation fault on
> chan_iax2.so.
> 
> 
> I don't want to put too much effort in it currently by myself but there
> is one question I would like to have answered by you:
> 
> Is there a "right" way to do cross-compilation and did anything change
> significantly in the configuration and make stages in the 1.8 series of
> Asterisk?
> 
> What I do now is simply setting the build host and target options during
> configure together with a few switches to point at the right
> directories (include, libs, ...) as well as setting the environment
> variables $CC $LD and so on to the appropriate paths of the executables
> of the cross-compilation toolchain before calling configure.

Aha.  Herein lies your problem.  You need to specify not the host and
target for the platform, but the build and host options.  The build option
is the platform on which you are compiling, and the host is the platform on
which the code will be running.  Target is ONLY for compiling a compiler,
and it specifies the type of code that the compiler that will run on the
host should emit.

You really should not be specifying the environment variables to the
configure script; as long as your PATH contains those executables (and they
are named as the GNU tools names them, with the triplet prefix), they will
be automatically found by the configure script.

-- 
Tilghman Lesher
Digium, Inc. | Senior Software Developer
twitter: Corydon76 | IRC: Corydon76-dig (Freenode)
Check us out at: www.digium.com & www.asterisk.org



More information about the asterisk-dev mailing list