[erlang-questions] HiPE on ARM Build Issue

Andrew Wiley wiley.andrew.j@REDACTED
Sat Apr 14 19:54:55 CEST 2012


On Sat, Apr 14, 2012 at 12:48 PM, Andrew Wiley <wiley.andrew.j@REDACTED>wrote:

> On Sat, Apr 14, 2012 at 3:12 AM, Kostis Sagonas <kostis@REDACTED> wrote:
>>
>> In the HiPE team we would very much like to support the ARM architecture
>> but the problem these days - for quite some time actually - is that we do
>> not have access to any machine with an ARM processor. It's very painful to
>> be testing ARM using QEMU, esp. all sorts of different ARMs that exist
>> these days. Hence, occasionally code tends to rot or, as in this case which
>> involves a newer ARMv7, code has never been tested on newer architectures.
>>
>> (I do not know what sort of access to ARM machines the Erlang/OTP team at
>> Ericsson has, but I suspect that they do not have access to all possible
>> ARMs either.)
>>
>> In this particular case, I would recommend that you extend the following
>> lines in erts/configure.in
>>
>>    armv5b)     ARCH=arm;;
>>    armv5teb)   ARCH=arm;;
>>    armv5tel)   ARCH=arm;;
>>
>> with the line that corresponds to your newer armv7 and test to see what
>> happens.  If all goes well, please submit a patch using git.
>>
>
> I added:
>      armv5b)    ARCH=arm;;
>      armv5teb)  ARCH=arm;;
>      armv5tel)  ARCH=arm;;
> +    armv7l)     ARCH=arm;;
>
> to configure.in and reran autotools.
>
>
>>
>> Also, since you are on an unexplored territory, I would recommend to
>> build Erlang/OTP in two steps. First do:
>>
>>        ./configure --enable-hipe ...
>>
>> which will test if Erlang/OTP can be built with HiPE support, and only if
>> that works do:
>>
>>        make clean  // or start from a fresh copy, for extra safety
>>        ./configure --enable-hipe ... --enable-native-libs
>>
>
> I kicked off the build before you replied, and a build with both
> --enable-hipe and --enable-native libs completed successfully. However,
> when I try to get Hipe to build native code afterwards:
> [wiley@REDACTED erlang]$ erlc -W  +debug_info +native +inline main.erl
>
> Crash dump was written to: erl_crash.dump
> Invalid tag in make_hash2(0x735F7374)
> Aborted
> [wiley@REDACTED erlang]$ erlc -W +native +inline main.erl
> Segmentation fault
> [wiley@REDACTED erlang]$ erlc -W +native main.erl
> Segmentation fault
> [wiley@REDACTED erlang]$ gdb erlc
> GNU gdb (GDB) 7.4
> [...cut...]
> Reading symbols from /usr/bin/erlc...(no debugging symbols found)...done.
> (gdb) set args -W +native main.erl
> (gdb) run
> Starting program: /usr/bin/erlc -W +native main.erl
> process 20137 is executing new program: /bin/bash
> process 20137 is executing new program:
> /usr/lib/erlang/erts-5.9.1/bin/erlexec
> process 20137 is executing new program:
> /usr/lib/erlang/erts-5.9.1/bin/beam.smp
> [Thread debugging using libthread_db enabled]
> Using host libthread_db library "/lib/libthread_db.so.1".
> [New Thread 0x40da8470 (LWP 20143)]
> [New Thread 0x415a8470 (LWP 20144)]
> [New Thread 0x4002c470 (LWP 20145)]
> [New Thread 0x41da8470 (LWP 20146)]
> [New Thread 0x425a8470 (LWP 20147)]
> [New Thread 0x42da8470 (LWP 20148)]
>
> Program received signal SIGSEGV, Segmentation fault.
> [Switching to Thread 0x41da8470 (LWP 20146)]
> 0x0007b9a4 in make_hash2 ()
> (gdb) bt
> #0  0x0007b9a4 in make_hash2 ()
> #1  0x000a9fbc in put_2 ()
> #2  0x0014dca4 in nbif_put_2 ()
> #3  0x0014dca4 in nbif_put_2 ()
> Backtrace stopped: previous frame identical to this frame (corrupt stack?)
>
>
>> PS. We welcome support, for example, donations of ARM-based machines that
>> we can be using to test the HiPE compiler or its newer LLVM-based back-end
>> (see http://erllvm.softlab.ntua.gr/**) more regularly. Similar with
>> other exotic architectures that people these days care about. Minimally, if
>> you want native code for some configuration other than x86 and x86_64-based
>> machines, give us some form of remote access to it.
>>
>
> I'm a college student who randomly felt like learning Erlang might be
> useful, I'm not really in a position to donate hardware, and I'm a bit
> leery about giving out shell accounts on what's essentially my router, but
> I'll see what I can do.
>

Oh, yes, the main.erl I was using to test HiPE:
-module(main).

-export([main/0]).

main() ->
  io:format("fib(42): ~B~n", [fib(42)]).

fib(0) -> 1;
fib(1) -> 1;
fib(N) when N > 1, is_integer(N) -> fib(N-1) + fib(N-2).
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20120414/535208a9/attachment.htm>


More information about the erlang-questions mailing list