[erlang-questions] cross compile of Erlang/OTP

Stoutchinine, Mark Mark.Stoutchinine@REDACTED
Wed Apr 2 17:54:34 CEST 2014


Hello Everyone,

I am looking for help with cross compilation. I am following the instruction on how to cross compile Erlang/OTP and it seems worked, I got bin/<TARGET>/. built and there are multiple utilities/apps/executables exist in it:

>> ls -al
-rwxrwxr-x 1 mstoutch mstoutch   176653 Apr  2 11:19 epmd
-rwxrwxr-x 1 mstoutch mstoutch   108341 Apr  2 11:19 erlc
-rwxrwxr-x 1 mstoutch mstoutch   165065 Apr  2 11:19 erlexec
-rwxrwxr-x 1 mstoutch mstoutch   105782 Apr  2 11:19 escript
-rwxrwxr-x 1 mstoutch mstoutch    37746 Apr  2 11:19 heart
-rwxrwxr-x 1 mstoutch mstoutch   154805 Apr  2 11:19 inet_gethost
-rwxrwxr-x 1 mstoutch mstoutch    66273 Apr  2 11:19 run_erl
-rwxrwxr-x 1 mstoutch mstoutch    32142 Apr  2 11:19 to_erl
-rwxrwxr-x 1 mstoutch mstoutch    99598 Apr  2 11:19 typer

erlc is definetly cross compiled:

>> file ./bin/powerpc-none-linux-gnu/erlc
./bin/powerpc-none-linux-gnu/erlc: ELF 32-bit MSB executable, PowerPC or cisco 4500, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.16, BuildID[sha1]=0x07b32270e1dd4993ea729db6af2e3b42e1024c96, with unknown capability 0x41000000 = 0xf676e75, with unknown capability 0x10000 = 0x70401, not stripped

Now at later stages when build process is trying to build some applications like asn1, it fails because it is trying to run cross built erlc on host system, which is incorrect - wrong architecture:

.....
make[1]: Leaving directory `/home/shares/public/mstoutch/otp_src_R16B03-1/erts'
cd lib && \
          ERL_TOP=/home/shares/public/mstoutch/otp_src_R16B03-1 PATH=/home/shares/public/mstoutch/otp_src_R16B03-1/bootstrap/bin:"${PATH}" \
                make opt SECONDARY_BOOTSTRAP=true
make[1]: Entering directory `/home/shares/public/mstoutch/otp_src_R16B03-1/lib'
make[2]: Entering directory `/home/shares/public/mstoutch/otp_src_R16B03-1/lib/asn1/src'
erlc -W  -bbeam -o../ebin +debug_info -I/home/shares/public/mstoutch/otp_src_R16B03-1/lib/stdlib -Werror -Dvsn=\"2.0.4\" asn1ct.erl
/home/shares/public/mstoutch/otp_src_R16B03-1/bootstrap/bin/erlc: 1: /home/shares/public/mstoutch/otp_src_R16B03-1/bootstrap/bin/erlc: Syntax error: end of file unexpected
make[2]: *** [../ebin/asn1ct.beam] Error 2
....

Does anyone know how to turn this off, configure the build not to do that, or maybe I am doing something wrong and it is not supposed to use host erlc? Or I need to rebuild these applications on target? Anyone had this problem before?

Thank a lot to everyone.
Mark

______________________________________________________________________
This email has been scanned by the Symantec Email Security.cloud service.
For more information please visit http://www.symanteccloud.com
______________________________________________________________________
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20140402/d98bc7f4/attachment.htm>


More information about the erlang-questions mailing list