[erlang-bugs] [HiPE] Link failed when building with TYPE=valgrind

Mikael Pettersson mikpe@REDACTED
Sat Oct 9 17:59:37 CEST 2010


Haitao Li writes:
 > 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

You apparently have to ./configure --disable-hipe if you want
to make a valgrind build.  I don't know why they want to disable
FP signals in valgrind builds, but FP signals are required for
HiPE/AMD64.


More information about the erlang-bugs mailing list