Skip to content

Commit

Permalink
Merge pull request rubyjs#71 from ignisf/freebsd-gcc42
Browse files Browse the repository at this point in the history
Add no-strict-aliasing to FreeBSD/gcc42 builds, remove vestigial patches.
  • Loading branch information
cowboyd committed Jan 7, 2013
2 parents 3090180 + 98715b9 commit a9f44f2
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 44 deletions.
3 changes: 1 addition & 2 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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

Expand Down
14 changes: 12 additions & 2 deletions ext/libv8/builder.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
require 'mkmf'
require File.expand_path '../compiler', __FILE__
require File.expand_path '../arch', __FILE__
require File.expand_path '../make', __FILE__
Expand All @@ -8,11 +9,20 @@ class Builder
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
Expand Down
16 changes: 0 additions & 16 deletions lib/libv8/fpic-on-freebsd-amd64.patch

This file was deleted.

14 changes: 0 additions & 14 deletions patches/gcc42-on-freebsd.patch

This file was deleted.

10 changes: 0 additions & 10 deletions patches/src_platform-freebsd.cc.patch

This file was deleted.

0 comments on commit a9f44f2

Please sign in to comment.