[Klone-users] Cross compilation

thomas fossati tho at koanlogic.com
Tue Dec 18 10:18:44 EST 2007


Hi Peter,

I've set up the ELDK environment for PPC (a good 3 hours of batch  
computing :)) and I've tried to cross compile the sample klone-app at  
http://www.koanlogic.com/download/klone/klapp-minimal-lib-1.0.0.tar.gz  
.

The only modification it needed was against the top level Makefile, to  
which the line "MAKL_PLATFORM = linux-powerpc" has been added:

--- Makefile.orig       2007-12-18 16:05:52.000000000 +0100
+++ Makefile    2007-12-18 15:57:47.000000000 +0100
@@ -1,5 +1,7 @@
  KLONE_VERSION = 2.0.0

+MAKL_PLATFORM = linux-powerpc
+
  # uncommment to enable debugging
  # KLONE_CONF_ARGS = --enable_debug

then:

$ export PATH=$PATH:/home/eldk/usr/bin:/home/eldk/bin

and finally:

$ make

at the end of the build process I got a kloned executable which seems  
to be quite good - at least as a proof-of-concept:

$ file kloned
kloned: ELF 32-bit MSB executable, PowerPC or cisco 4500, version 1  
(SYSV), for GNU/Linux 2.4.3, dynamically linked (uses shared libs), for  
GNU/Linux 2.4.3, not stripped

ciao, t.

On Dec 18, 2007, at 12:08 PM, Iring, Peter wrote:
> Thanks for quick responses :)
>
> OK. I will try to ask little bit different way
> :)
>
> This step with MAKL_PLATFORM was the first I have tried. At first I  
> have
> set up
> My linux variables. (I use eldk4.1 for cross compilation)
>
> So I export variables:
>
> ARCH=ppc
> CROSS_COMPILE=ppc_8xx-
> DEPMOD=/hit73_sw/tools/eldk4.1/usr/bin/depmod.pl
> PATH=/hit73_sw/tools/eldk4.1/usr/bin:/hit73_sw/tools/eldk4.1/bin:/usr/ 
> lo
> cal/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
>
> Now if I run powerpc-linux-gcc -v from any path I can see gcc version:
> gcc version 4.0.0 (DENX ELDK 4.1 4.0.0)
>
> So I expect that modification of MAKL_PLATFORM should tell to make to
> use powerpc-linux-gcc compiler.
>
> But if I run "./configure --cross_compile" and "sudo make" I can see
> that gcc is compiling source code:
>
> gcc
> -I/hit73_sw/tools/klone-2.0.0/build/host/klone-core-2.0.0/libu/include
> -I/hit73_sw/tools/klone-2.0.0/build/host/klone-core-2.0.0 -DHAVE_CONF_H
> -O2  -c webapp.c -o webapp.o
> ===> building standard webapp library
> rm -f libwebapp.a
> ar cq libwebapp.a
> `/hit73_sw/tools/klone-2.0.0/build/host/klone-core-2.0.0/makl/helpers/ 
> lo
> rder webapp.o | tsort`
> ranlib libwebapp.a
>
> What am I doing wrong?
>
> Peter
>
>
> -----Original Message-----
> From: klone-users-bounces at koanlogic.com
> [mailto:klone-users-bounces at koanlogic.com] On Behalf Of thomas fossati
> Sent: 18. decembra 2007 11:20
> To: Klone users
> Subject: Re: [Klone-users] Cross compilation
>
> On Dec 18, 2007, at 10:54 AM, Iring, Peter wrote:
>> I have got embedded linux based on 2.4 kernel.
>> It runs on Motorola MPC855.
>
> If you already have a cross compilation environment up and running it
> is probably the GNU one, right ?
>
> In which case you can try to add:
>
> 	MAKL_PLATFORM = linux-powerpc
>
> on the top level klone2 Makefile (the one with KLONE_VERSION,
> KLONE_CONF_ARGS and such in it).
>
> ciao, t.
>
>
> _______________________________________________
> Klone-users mailing list
> Klone-users at koanlogic.com
> http://koanlogic.com/cgi-bin/mailman/listinfo/klone-users
>
> _______________________________________________
> Klone-users mailing list
> Klone-users at koanlogic.com
> http://koanlogic.com/cgi-bin/mailman/listinfo/klone-users
>





More information about the klone-users mailing list