[HiPE] Link failed when building with TYPE=valgrind

Haitao Li <>
Sat Oct 9 16:46:10 CEST 2010


Hi,

Building beam with valgrind failed when linking.

$ cd erts/emulator
$ make valgrind FLAVOR=smp

obj/x86_64-unknown-linux-gnu/valgrind/smp/hipe_amd64_bifs.o: In
function `nbif_handle_fp_exception':
(.text+0x9): undefined reference to `erts_restore_fpu'
collect2: ld returned 1 exit status

$ nm ./obj/x86_64-unknown-linux-gnu/valgrind/smp/sys_float.o | grep
erts_restore_fpu
$ nm obj/x86_64-unknown-linux-gnu/valgrind/smp/hipe_amd64_bifs.o |
grep erts_restore_fpu
                 U erts_restore_fpu

The problem is erts_restore_fpu is not defined when build for valgrind.

In beam/sys.h:
#if defined(VALGRIND) && !defined(NO_FPE_SIGNALS)
#  define NO_FPE_SIGNALS
#endif

In sys/unix/sys_float.c:

#ifdef NO_FPE_SIGNALS
......
#else
......
<definition of erts_restore_fpu>
......
#endif

/Haitao Li


More information about the erlang-bugs mailing list