[erlang-questions] Cross compiling R13B04 for MIPS CPU running linux works

Rickard Green rickard@REDACTED
Tue Mar 2 22:54:44 CET 2010


2010/3/1 Matthias Lang <matthias@REDACTED>:
> Hi,
>
> R13B04 has brand-new support for cross-compiling. Big thanks to
> Rickard Green for tackling that ugly job.
>
> Compiling R13B for a MIPS-32 big endian CPU running linux worked first
> try (!), all I did was make an erl-xcomp file with three lines changed
> from the template:
>
>  erl_xcomp_build=guess
>  erl_xcomp_host=mips-linux
>  CFLAGS=-Os
>

Always nice to hear that it works.

> Questions:
>
>  1. Do you want the erl-xcomp file I made?
>
>     On one hand: I don't know of anyone else running Erlang on that
>     CPU (an Au1000, which runs the control system on Corelatus' GTH
>     hardware).
>
>     On the other hand: the next person with a weird target would probably
>     be happy to see that they're not setting off into "only OTP have
>     done this" territory.
>

Yes, please. I think it's good with example configurations that people
can have a look at when creating their own configurations.

>  2. On targets where disk space is precious, it's nice if the .beams
>     are compressed. On earlier releases, I did that that by including
>     +compressed in ERL_COMPILE_FLAGS (by patching the makefile).
>
>     Is there a better way to do that now?
>
>     I had a quick look, couldn't find one, thought I'd ask before
>     I invent my own method, possibly putting the .beams in an archive
>     while I'm at it.
>


I haven't looked at this, but this is of course interesting for small
embedded systems.

I had a look in beam_lib and it seems that the strip_release/1
function also compresses the result, so invoking the following after
building the system should get you a slim system:
  $ERL_TOP/bootstrap/bin/erl -noshell -noinput -eval
"beam_lib:strip_release(\"$ERL_TOP\"),init:stop()"

This will however remove the debug info too, which perhaps isn't what
you wanted. I think it would be nice to be able to add the +compressed
flag without having to patch the makefiles, so I'll try to have a look
at it before R14.

Regards,
Rickard

> Matt
>
>
________________________________________________________________
> erlang-questions (at) erlang.org mailing list.
> See http://www.erlang.org/faq.html
> To unsubscribe; mailto:erlang-questions-unsubscribe@REDACTED
>
>


More information about the erlang-questions mailing list