diff --git a/Rakefile b/Rakefile index aea124d..5c5cf5c 100644 --- a/Rakefile +++ b/Rakefile @@ -22,6 +22,7 @@ task :checkout do # Fix gyp trying to build platform-linux on FreeBSD 9 and FreeBSD 10. # Based on: https://chromiumcodereview.appspot.com/10079030/patch/1/2 sh "patch -N -p0 -d vendor/v8 < patches/add-freebsd9-and-freebsd10-to-gyp-GetFlavor.patch" + sh "patch -N -p1 -d vendor/v8 < patches/fPIC-on-linux-x64.patch" end desc "compile v8 via the ruby extension mechanism" diff --git a/patches/fPIC-on-linux-x64.patch b/patches/fPIC-on-linux-x64.patch new file mode 100644 index 0000000..44d82e0 --- /dev/null +++ b/patches/fPIC-on-linux-x64.patch @@ -0,0 +1,14 @@ +diff --git a/build/standalone.gypi b/build/standalone.gypi +index ebdf557..c7a59bc 100644 +--- a/build/standalone.gypi ++++ b/build/standalone.gypi +@@ -98,6 +98,9 @@ + [ 'OS=="linux"', { + 'cflags': [ '-ansi' ], + }], ++ [ 'OS=="linux" and v8_target_arch=="x64" and component=="static_library"', { ++ 'cflags': [ '-fPIC', ], ++ }], + [ 'visibility=="hidden"', { + 'cflags': [ '-fvisibility=hidden' ], + }],