From 6f05fa95ad949298f5175fc3a25fea52a7a3788d Mon Sep 17 00:00:00 2001 From: Mikael Pettersson Date: Wed, 6 May 2015 15:40:15 +0200 Subject: erts: Increase buffer in erts_fp_check_init_error The current size is too small for 64-bit machines, causing messages to be truncated and making debugging more difficult. --- erts/emulator/sys/unix/sys_float.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erts/emulator/sys/unix/sys_float.c b/erts/emulator/sys/unix/sys_float.c index 2ffa649767..c30ef7cce2 100644 --- a/erts/emulator/sys/unix/sys_float.c +++ b/erts/emulator/sys/unix/sys_float.c @@ -85,7 +85,7 @@ static void set_current_fp_exception(unsigned long pc) void erts_fp_check_init_error(volatile unsigned long *fpexnp) { - char buf[64]; + char buf[128]; snprintf(buf, sizeof buf, "ERTS_FP_CHECK_INIT at %p: detected unhandled FPE at %p\r\n", __builtin_return_address(0), (void*)*fpexnp); if (write(2, buf, strlen(buf)) <= 0) -- cgit v1.2.3 From b5ab6ded99afb0978dd4722d0d43b755555ac549 Mon Sep 17 00:00:00 2001 From: Mikael Pettersson Date: Wed, 6 May 2015 15:44:54 +0200 Subject: erts: Disable float exceptions for clang/llvm Change erts/configure.in to force-disable FP exceptions if the VM is compiled by clang/llvm. clang/llvm generates FP code which does not work with FP exceptions (whether unmasked as used in the Erlang VM, or masked followed by tests of which are signalled). This is a known long-standing problem. --- erts/configure.in | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/erts/configure.in b/erts/configure.in index 873e1e30fe..795ce0639b 100644 --- a/erts/configure.in +++ b/erts/configure.in @@ -2916,6 +2916,10 @@ else #include #include +#if defined(__clang__) || defined(__llvm__) +#error "Clang/LLVM generates broken code for FP exceptions" +#endif + volatile int erl_fp_exception; /* -- cgit v1.2.3