From 4e338f9482058ac2f90c5443dc6d7add9ded9bf5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=B6ran=20Weinholt?= Date: Sun, 17 Dec 2017 13:29:00 +0100 Subject: [PATCH] Fix build failure on Linux amd64 with gcc 7 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. --- src/ffi_stub_linux64.s | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ffi_stub_linux64.s b/src/ffi_stub_linux64.s index a63f0e80..6dd32f1e 100644 --- a/src/ffi_stub_linux64.s +++ b/src/ffi_stub_linux64.s @@ -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: