[erlang-questions] erlang 20.0 under elbrus: compilation problems
Mikael Pettersson
mikpelinux@REDACTED
Fri Aug 4 09:45:22 CEST 2017
Max Lapshin writes:
> Hi.
>
> trying to build erlang 20 under elbrus computer (arch e2k), it goes with
> compiler lcc
>
> trying to configure with:
>
> ./configure --prefix=/opt/flussonic --enable-smp-support
> --enable-kernel-poll --enable-hipe --without-java --enable-dirty-schedulers
>
> erts/configure fails, in erts/config.log I see:
>
>
>
>
> | #define SIZEOF_TIME_T 8
>
> | /* end confdefs.h. */
>
> |
>
> | /* pr36339.c */
>
> | extern void abort (void);
>
> |
>
> | typedef unsigned long my_uintptr_t;
>
> |
>
> | int check_a(my_uintptr_t tagged_ptr);
>
> |
>
> | int __attribute__((noinline)) try_a(my_uintptr_t x)
>
> | {
>
> | my_uintptr_t heap[2];
>
> | my_uintptr_t *hp = heap;
>
> |
>
> | hp[0] = x;
>
> | hp[1] = 0;
>
> | return check_a((my_uintptr_t)(void*)((char*)hp + 1));
>
> | }
>
> |
>
> | int __attribute__((noinline)) check_a(my_uintptr_t tagged_ptr)
>
> | {
>
> | my_uintptr_t *hp = (my_uintptr_t*)(void*)((char*)tagged_ptr - 1);
>
> |
>
> | if (hp[0] == 42 && hp[1] == 0)
>
> | return 0;
>
> | return -1;
>
> | }
>
> |
>
> | int main(void)
>
> | {
>
> | if (try_a(42) < 0)
>
> | abort ();
>
> | return 0;
>
> | }
>
> |
>
> configure:34880: result: yes
>
> configure:34883: error: This gcc miscompiles the Erlang runtime system;
> please use a different version
>
>
> I have commented this place in configure and after some other patches it
> has compiled.
>
>
> Is it a fatal error?
Yes. This is a test for GCC's bug PR36339, which appeared with gcc-4.3.0
and which broke the Erlang VM. Note that it actually checks for the
miscompile, not for a compiler version, so the bug is really present.
The solution, as configure correctly says, is to use a different compiler.
More information about the erlang-questions
mailing list