Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERL-1123: Cannot compile 22.1.4 under Elbrus #4059

Closed
OTP-Maintainer opened this issue Dec 26, 2019 · 4 comments
Closed

ERL-1123: Cannot compile 22.1.4 under Elbrus #4059

OTP-Maintainer opened this issue Dec 26, 2019 · 4 comments
Labels
bug Issue is reported as a bug priority:medium team:VM Assigned to OTP team VM wontfix Issue will not be fixed by OTP

Comments

@OTP-Maintainer
Copy link

Original reporter: maxlapshin
Affected version: OTP-22.1.4
Component: erts
Migrated from: https://bugs.erlang.org/browse/ERL-1123


Cannot compile latest erlang under e2k-4c  (elbrus).

lcc compiler complains on reaching end of function with return type without return value.

I've added patch that helps to compile.

 
@OTP-Maintainer
Copy link
Author

mikael pettersson said:

Seems your lcc can't detect unreachable code properly.  I just attached a cleaner patch for the issue (otp22-lcc-workaround.patch).  Does it work for you?

@OTP-Maintainer
Copy link
Author

maxlapshin said:

I am afraid that it doesn't help:

 
{code:java}
// code placeholder
 CC obj/e2k-unknown-linux-gnu/opt/smp/erl_bif_counters.o 
 CC obj/e2k-unknown-linux-gnu/opt/smp/erl_bif_counters.o 
 CC obj/e2k-unknown-linux-gnu/opt/smp/erl_bif_trace.o
lcc: "beam/erl_bif_lists.c", line 959: error: missing return statement at end
          of non-void function "subtract_continue" [-Werror=return-type]
  }  ^
1 error detected in the compilation of "beam/erl_bif_lists.c".
{code}
Maybe it is a wrong behaviour of compiler and I should report it to them?

@OTP-Maintainer
Copy link
Author

mikael pettersson said:

Thanks for testing.  My patch would have required lcc to understand "noreturn" function calls, which it apparently doesn't.

I would be hesitant to add obviously dead code just to satisfy this version of lcc, especially since that may result in warnings from compilers with better control-flow analysis.

Your best bet is probably to compile without -Werror, or to carry a local patch kit of workarounds due to the compiler you're stuck with.

Also your compiler provider should consider upgrading to something more modern than lcc, e.g. a clang/llvm toolchain should be much more compatible with modern software (gcc would be great too, but that would also require a binutils port to the e2k).

@OTP-Maintainer
Copy link
Author

maxlapshin said:

They cannot port to llvm yet due to very specific nature of the CPU: it is a VLIW.  Ok, will work with ad-hoc patch for now.

@OTP-Maintainer OTP-Maintainer added wontfix Issue will not be fixed by OTP bug Issue is reported as a bug team:VM Assigned to OTP team VM priority:medium labels Feb 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue is reported as a bug priority:medium team:VM Assigned to OTP team VM wontfix Issue will not be fixed by OTP
Projects
None yet
Development

No branches or pull requests

1 participant