1
0
Fork 0
mirror of https://github.com/rubyjs/libv8 synced 2023-03-27 23:21:48 -04:00

Add no-strict-aliasing to FreeBSD/gcc42 builds

Remove the patch that was not getting applied on rake build on a
buildhost and add a conditional make flag in builder.rb. This commit
fixes #68
This commit is contained in:
ignisf 2013-01-06 11:58:14 +02:00
parent 433be139bf
commit 35c198a3fb
3 changed files with 4 additions and 16 deletions

View file

@ -28,7 +28,6 @@ task :checkout do
# Based on: https://chromiumcodereview.appspot.com/10079030/patch/1/2 # 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 -p0 -d vendor/v8 < patches/add-freebsd9-and-freebsd10-to-gyp-GetFlavor.patch"
sh "patch -N -p1 -d vendor/v8 < patches/fPIC-on-x64.patch" sh "patch -N -p1 -d vendor/v8 < patches/fPIC-on-x64.patch"
sh "patch -N -p1 -d vendor/v8 < patches/gcc42-on-freebsd.patch" if RUBY_PLATFORM.include?("freebsd") && !system("pkg_info | grep gcc-4")
end end
desc "compile v8 via the ruby extension mechanism" desc "compile v8 via the ruby extension mechanism"

View file

@ -11,8 +11,11 @@ module Libv8
def build_libv8! def build_libv8!
profile = enable_config('debug') ? 'debug' : 'release' profile = enable_config('debug') ? 'debug' : 'release'
gypflags = ["-Dhost_arch=#{libv8_arch}"]
gypflags << "-Dv8_no_strict_aliasing=1" if RUBY_PLATFORM.include?("freebsd") && !check_gcc_compiler(compiler)
Dir.chdir(File.expand_path '../../../vendor/v8', __FILE__) do Dir.chdir(File.expand_path '../../../vendor/v8', __FILE__) do
puts `env CXX=#{compiler} LINK=#{compiler} #{make} #{libv8_arch}.#{profile} GYPFLAGS="-Dhost_arch=#{libv8_arch}"` puts `env CXX=#{compiler} LINK=#{compiler} #{make} #{libv8_arch}.#{profile} GYPFLAGS="#{gypflags.join ' '}"`
end end
return $?.exitstatus return $?.exitstatus
end end

View file

@ -1,14 +0,0 @@
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=="freebsd"', {
+ 'cflags': [ '-fno-strict-aliasing', ],
+ }],
[ 'visibility=="hidden"', {
'cflags': [ '-fvisibility=hidden' ],
}],