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

Merge pull request #71 from ignisf/freebsd-gcc42

Add no-strict-aliasing to FreeBSD/gcc42 builds, remove vestigial patches.
This commit is contained in:
Charles Lowell 2013-01-07 06:48:43 -08:00
commit a9f44f20fd
5 changed files with 13 additions and 44 deletions

View file

@ -28,7 +28,6 @@ task :checkout do
# 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-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
desc "compile v8 via the ruby extension mechanism"
@ -42,7 +41,7 @@ task :manual_compile do
require File.expand_path '../ext/libv8/arch.rb', __FILE__
include Libv8::Arch
Dir.chdir(V8_Source) do
sh %Q{#{make} -j2 #{libv8_arch}.release GYPFLAGS="-Dhost_arch=#{libv8_arch}"}
sh %Q{#{make} -j2 #{libv8_arch}.release}
end
end

View file

@ -1,3 +1,4 @@
require 'mkmf'
require File.expand_path '../compiler', __FILE__
require File.expand_path '../arch', __FILE__
require File.expand_path '../make', __FILE__
@ -8,11 +9,20 @@ module Libv8
include Libv8::Compiler
include Libv8::Make
def build_libv8!
def make_flags(*flags)
profile = enable_config('debug') ? 'debug' : 'release'
# FreeBSD uses gcc 4.2 by default which leads to
# compilation failures due to warnings about aliasing.
# http://svnweb.freebsd.org/ports/head/lang/v8/Makefile?view=markup
flags << "strictaliasing=off" if RUBY_PLATFORM.include?("freebsd") and !check_gcc_compiler(compiler)
"#{libv8_arch}.#{profile} #{flags.join ' '}"
end
def build_libv8!
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} #{make_flags}`
end
return $?.exitstatus
end

View file

@ -1,16 +0,0 @@
diff --git a/SConstruct b/SConstruct
index 4a7e182..b462335 100644
--- a/SConstruct
+++ b/SConstruct
@@ -124,6 +124,10 @@ LIBRARY_FLAGS = {
'LIBPATH' : ['/usr/local/lib'],
'CCFLAGS': ['-ansi'],
- 'LIBS': ['execinfo']
+ 'LIBS': ['execinfo'],
+ 'arch:x64': {
+ 'CCFLAGS': ['-fPIC'],
+ 'CXXFLAGS': ['-fPIC']
+ },
},
'os:openbsd': {
'CPPPATH' : ['/usr/local/include'],

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' ],
}],

View file

@ -1,10 +0,0 @@
--- src/platform-freebsd.cc.orig 2012-05-12 16:47:50.556202492 +0100
+++ src/platform-freebsd.cc 2012-05-12 16:37:59.924934272 +0100
@@ -554,6 +554,7 @@
ASSERT(result == 0);
result = pthread_mutex_init(&mutex_, &attrs);
ASSERT(result == 0);
+ USE(result);
}
virtual ~FreeBSDMutex() { pthread_mutex_destroy(&mutex_); }