Newbie question: cross-compile PPC860/LINUX

Mikael Pettersson mikpe@REDACTED
Wed Dec 22 12:48:06 CET 2004

On Wed, 22 Dec 2004 18:12:52 +0800, techieyang@REDACTED wrote:
>First Question: Failed when Cross-Compile R10B-2, target --
>PPC860/Linux, Host -- RedHat-ES3-X86
>Error Information got:
>ppc_8xx-gcc -g -O2
>-I/opt/erlang/test/otp_src_R10B-2/erts/i686-pc-linux-gnu -DHYBRID
>-DHAVE_CONFIG_H -Wall -Wstrict-prototypes -Wmissing-prototypes -Ibeam
>-Isys/unix -Isys/common -Ii686-pc-linux-gnu -Ii686-pc-linux-gnu/hybrid
>-Izlib -Ihipe -o
>-c > i686-pc-linux-gnu/hybrid/hipe_literals.h
>/bin/sh: line 1:
>cannot execute binary file
>make[4]: *** [i686-pc-linux-gnu/hybrid/hipe_literals.h] Error 126

The problem is that $HOST can't execute a file compiled for $TARGET.
Maybe I haven't looked sufficiently closely, but I have yet to find
any sensible cross-compilation infrastructure in Erlang/OTP.

In this case, rebuilding hipe_mkliterals with a non-cross-compiler
should allow you to make some progress.

(FWIW, I regularly cross-compile Linux kernels on x86 for x86-64
or ppc32, but that's easy since there's a built-in cross-compilation
infrastructure in the Linux kernel source code.)

>Question Two: How many files needed to run on the PPC860-target
>I can cross-compile the PPC860-Linux with R7B4. Then i will copy the
>built-files onto the target RAMDISK.

Given that you have compile a pile of .erl and .java files,
I'd suggest that you bootstrap on the host and install somewhere,
then remove the host-specific executables (not .beam or .class
files), rebuild them with a cross-compiler, and reinstall them.


More information about the erlang-questions mailing list