From 44f2f04cb1b5f024ba6934e6cf350b1ffbcaa3ee Mon Sep 17 00:00:00 2001 From: Anthony Ramine Date: Sat, 16 Aug 2014 18:23:25 +0200 Subject: Fix HiPE debug lock checking on OS X 64bit Position-independent code is mandatory on OS X. We use r11 as an intermediate register to fill BIF_P->hipe.bif_callee. This fixes the following error when doing `make debug FLAVOR=smp`: clang -cc1as: fatal error: error in backend: 32-bit absolute addressing is not supported in 64-bit mode --- erts/emulator/hipe/hipe_amd64_bifs.m4 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'erts/emulator/hipe') diff --git a/erts/emulator/hipe/hipe_amd64_bifs.m4 b/erts/emulator/hipe/hipe_amd64_bifs.m4 index 0de69a617f..a3219c7586 100644 --- a/erts/emulator/hipe/hipe_amd64_bifs.m4 +++ b/erts/emulator/hipe/hipe_amd64_bifs.m4 @@ -39,7 +39,10 @@ define(HANDLE_GOT_MBUF,` jmp 2b') `#if defined(ERTS_ENABLE_LOCK_CHECK) && defined(ERTS_SMP) -# define CALL_BIF(F) movq $CSYM(F), P_BIF_CALLEE(P); call CSYM(hipe_debug_bif_wrapper) +# define CALL_BIF(F) \ + movq CSYM(F)@GOTPCREL(%rip), %r11; \ + movq %r11, P_BIF_CALLEE(P); \ + call CSYM(hipe_debug_bif_wrapper) #else # define CALL_BIF(F) call CSYM(F) #endif' -- cgit v1.2.3