hi peter!

Am Fri, 14 Oct 2011 13:14:51 +0200
schrieb czernitko <czerni...@gmail.com>:

> Hello!
> I started playing a little bit with cross compilation for ARM
> architecture. Using crossdev I created a toolchain for
> arm-none-linux-gnueabi tuple. Now I'd like to emerge some more
> packages, but perl constantly refuses to emerge and it is needed by
> many packages. For example when running
> 
> # arm-none-linux-gnueabi-emerge -av1 perl
> 
> [ebuild  N     ] dev-lang/perl-5.12.4-r1
> to /usr/arm-none-linux-gnueabi/ USE="berkdb gdbm -build -debug -doc
> -ithreads" 0 kB [ebuild  N     ] app-admin/perl-cleaner-2.10
> to /usr/arm-none-linux-gnueabi/ 0 kB
> 
> it fails right in configure phase.
> Relevant logs are attached, except for configure log which I couldn't
> find.
> 
> When I've read through
> /usr/arm-none-linux-gnueabi/tmp/portage/dev-lang/perl-5.12.4-r1/work/perl-5.12.4/Cross/README
> which is aimed to give more instructions for cross compiling,
> I've found out that I should run "make patch && make" from Cross
> directory. Unfortunately, I've got no clue how to combine that with
> the whole emerge process? 

there is probably a better way to do this, but it should be possible to
make a local overlay and modify the ebuild's src_compile to do emake in
the Cross directory.

http://devmanual.gentoo.org/ebuild-writing/index.html

> I know I could compile it by hand, but then
> portage would not know that perl is already installed and it would
> try to install it anyway...

there are some ways around that, but its still ugly.

a lot of the things you are finding out now might be *very* interesting
to me in a few months, i am also planning a small project that might
include cross compiling to arm.
are you documenting your progress somewhere? can you please point me to
the documents that helped you put together the cross compilation
toolchain?


from looking at build.log:

> Checking your choice of C compiler and flags for coherency...
> I've tried to compile and run the following simple program:
> 
> #include <stdio.h>
> int main() { printf("Ok\n"); return(0); }
> 
> I used the command:
> 
>       arm-none-linux-gnueabi-gcc -o try -O2 -pipe
> -fomit-frame-pointer -I/usr/arm-none-linux-gnueabi/usr/include/
> -I/usr/arm-none-linux-gnueabi/include/ -DOVR_DBL_DIG=14
> -L/usr/arm-none-linux-gnueabi/lib
> -L/usr/arm-none-linux-gnueabi/usr/lib -L/usr/local/lib try.c -lnsl
> -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc -lgdbm_compat ./try
> 
> and I got the following output:
> 
> /bin/sh: ./try: cannot execute binary file
> The program compiled OK, but exited with status 126.

that actually sounds like it successfully cross-compiled try.c, but
*of course* it does not run on your host platform! that check is
probably omitted in Cross/Makefile which might why they are telling you
to run that one.

> 
> Any help would be highly appreciated!
> Peter

Reply via email to