From 2e2875818917484829c4423a90433a3567b67b3a Mon Sep 17 00:00:00 2001 From: Edouard Bonlieu Date: Tue, 8 Jul 2014 17:09:51 +0200 Subject: [PATCH] Compile libv8 on ARMv7 HF vfpv3 32bits --- ext/libv8/builder.rb | 2 +- patches/arm/do-not-use-vfp2.patch | 13 +++++++++++++ patches/fPIC-for-static.patch | 2 +- 3 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 patches/arm/do-not-use-vfp2.patch diff --git a/ext/libv8/builder.rb b/ext/libv8/builder.rb index 1ed8728..5b1362c 100755 --- a/ext/libv8/builder.rb +++ b/ext/libv8/builder.rb @@ -25,7 +25,7 @@ module Libv8 flags << "strictaliasing=off" if @compiler.is_a?(Compiler::GCC) and @compiler.version < '4.4' # Avoid compilation failures on the Raspberry Pi. - flags << "vfp2=off vfp3=off" if @compiler.target.include? "arm" + flags << "vfp2=off vfp3=on" if @compiler.target.include? "arm" # FIXME: Determine when to activate this instead of leaving it on by # default. diff --git a/patches/arm/do-not-use-vfp2.patch b/patches/arm/do-not-use-vfp2.patch new file mode 100644 index 0000000..7b413a4 --- /dev/null +++ b/patches/arm/do-not-use-vfp2.patch @@ -0,0 +1,13 @@ +diff --git a/build/common.gypi b/build/common.gypi +index 3a59639..594abe4 100644 +--- a/build/common.gypi ++++ b/build/common.gypi +@@ -173,7 +173,6 @@ + [ 'v8_use_arm_eabi_hardfloat=="true"', { + 'defines': [ + 'USE_EABI_HARDFLOAT=1', +- 'CAN_USE_VFP2_INSTRUCTIONS', + ], + 'target_conditions': [ + ['_toolset=="target"', { + diff --git a/patches/fPIC-for-static.patch b/patches/fPIC-for-static.patch index 00117d6..3e588f0 100644 --- a/patches/fPIC-for-static.patch +++ b/patches/fPIC-for-static.patch @@ -7,7 +7,7 @@ index 125c5bf..71641a3 100644 'cflags': [ '-fvisibility=hidden' ], }], - [ 'component=="shared_library"', { -+ [ 'component=="shared_library" or component=="static_library" and v8_target_arch=="x64"', { ++ [ 'component=="shared_library" or component=="static_library" and v8_target_arch=="x64" or v8_target_arch=="arm"', { 'cflags': [ '-fPIC', ], }], ],