Skip to content

Commit

Permalink
Fix build failure on Linux amd64 with gcc 7
Browse files Browse the repository at this point in the history
Fixes this build failure:

/usr/bin/ld: ffi_stub_linux64.o: relocation R_X86_64_32S against
  symbol `c_callback_double_x64' can not be used when making a
  shared object; recompile with -fPIC

The stub now uses R_X86_64_REX_GOTPCRELX.
  • Loading branch information
Göran Weinholt committed Dec 17, 2017
1 parent 7b48b06 commit 4e338f9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/ffi_stub_linux64.s
Original file line number Diff line number Diff line change
Expand Up @@ -162,15 +162,15 @@ sse_done:
ret

c_callback_stub_double_x64:
movq $c_callback_double_x64, %r11
movq c_callback_double_x64@GOTPCREL(%rip), %r11
jmp callback_stub_common

c_callback_stub_float_x64:
movq $c_callback_float_x64, %r11
movq c_callback_float_x64@GOTPCREL(%rip), %r11
jmp callback_stub_common

c_callback_stub_intptr_x64:
movq $c_callback_intptr_x64, %r11
movq c_callback_intptr_x64@GOTPCREL(%rip), %r11
jmp callback_stub_common

callback_stub_common:
Expand Down

0 comments on commit 4e338f9

Please sign in to comment.