Re: [Opalvoip-devel] Cross-compile PTLib/Opal for ARM architecture
Brought to you by:
csoutheren,
rjongbloed
|
From: Craig S. <cr...@po...> - 2012-09-10 21:56:38
|
On 10/09/2012 9:48 AM, Marco Costantini wrote:
> Hi there,
> Right now I am trying to cross-compile PTLib. The host machine is a
> 32bit Intel Linux (Ubuntu 10.04). The target is ARM iMX-53.
>
> I am able to build both PTLib and Opal on the native architecture (no
> cross-compile) but when I use my arm compiler I have some trouble.
>
> These are the commands that I run:
>
> ./configure --prefix=(myprefix) --host=i?86-*-linux*
> --target=arm-linux <--(this seems to work OK)
>
> make
>
> ^ the make command lost sight of the /usr/include path.
..deleted
This is correct behaviour.
Your cross compile should NOT be using /usr/include as those files are for
the host. You will need a copy of OpenSSL configured for the target in
order to include OpenSSL in your cross compile.
> This means
> that it fails to find its "openssl/ssl.h" header file. However, if I
> add this path as a CFLAG, I have problems about casting. To work
> around this I added
>
> #define P_SSL_USE_CONST 1 to ptlibdir/src/ptclib/pssl.cxx
>
> and commented
>
> ./include/ptbuildopts.h:356://#define P_d2i_DHparams_bio_OLD 1
>
> At this point, I am having these errors:
>
> ptclib/pdns.cxx: In function 'int DnsQuery_A(const char*, WORD, DWORD,
> _IP4_ARRAY*, DnsRecord**, void*)':
> ptclib/pdns.cxx:281: error: invalid 'asm': invalid operand for code 'w'
> ptclib/pdns.cxx:292: error: invalid 'asm': invalid operand for code 'w'
> ptclib/pdns.cxx:293: error: invalid 'asm': invalid operand for code 'w'
> ptclib/pdns.cxx:294: error: invalid 'asm': invalid operand for code 'w'
>
> I think that the native definition of "ntohs" is used, instead of the
> ARM version.
Your conclusion is most likely correct, as you have deliberately told
the compiler
to use the host include files while cross compling. This will create strange
behaviour, as you have seen
I suggest getting PTLib, Opal and your app to compile without OpenSSL,
then adding
it in. You will definitely need to create a cross compiled version of
OpenSSL to make this
work.
BTW: I have cross PTLib/Opal on several platforms using this method with
no problems.
Craig
|