mirror of
https://github.com/rubyjs/libv8
synced 2023-03-27 23:21:48 -04:00
Merge pull request #95 from cowboyd/gcc48
Add GCC 4.8 compilation support
This commit is contained in:
commit
f9d8917d0d
4 changed files with 81 additions and 2 deletions
17
Rakefile
17
Rakefile
|
@ -25,8 +25,21 @@ task :checkout do
|
|||
end
|
||||
end
|
||||
|
||||
desc "apply the libv8 gem patches to the vendored v8 source"
|
||||
task :patch do
|
||||
File.open("#{V8_Source}/.applied_patches", File::RDWR|File::CREAT) do |f|
|
||||
available_patches = Dir.glob('patches/*.patch').sort
|
||||
applied_patches = f.readlines.map(&:chomp)
|
||||
|
||||
(available_patches - applied_patches).each do |patch|
|
||||
sh "patch -p1 -N -d vendor/v8 < #{patch}"
|
||||
f.puts patch
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
desc "compile v8 via the ruby extension mechanism"
|
||||
task :compile do
|
||||
task :compile => :patch do
|
||||
sh "ruby ext/libv8/extconf.rb"
|
||||
end
|
||||
|
||||
|
@ -90,4 +103,4 @@ task :vulcan => directory("tmp/vulcan") do
|
|||
end
|
||||
|
||||
task :default => [:checkout, :compile, :spec]
|
||||
task :build => [:clean, :checkout]
|
||||
task :build => [:clean, :checkout, :patch]
|
||||
|
|
25
patches/disable-building-tests.patch
Normal file
25
patches/disable-building-tests.patch
Normal file
|
@ -0,0 +1,25 @@
|
|||
diff --git a/Makefile b/Makefile
|
||||
index 0cdae4b..2bf8aa5 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -153,7 +153,7 @@ ANDROID_ARCHES = android_ia32 android_arm
|
||||
# List of files that trigger Makefile regeneration:
|
||||
GYPFILES = build/all.gyp build/common.gypi build/standalone.gypi \
|
||||
preparser/preparser.gyp samples/samples.gyp src/d8.gyp \
|
||||
- test/cctest/cctest.gyp tools/gyp/v8.gyp
|
||||
+ tools/gyp/v8.gyp
|
||||
|
||||
# Generates all combinations of ARCHES and MODES, e.g. "ia32.release".
|
||||
BUILDS = $(foreach mode,$(MODES),$(addsuffix .$(mode),$(ARCHES)))
|
||||
diff --git a/build/all.gyp b/build/all.gyp
|
||||
index 4b2fe52..9885678 100644
|
||||
--- a/build/all.gyp
|
||||
+++ b/build/all.gyp
|
||||
@@ -11,7 +11,6 @@
|
||||
'../preparser/preparser.gyp:*',
|
||||
'../samples/samples.gyp:*',
|
||||
'../src/d8.gyp:d8',
|
||||
- '../test/cctest/cctest.gyp:*',
|
||||
],
|
||||
}
|
||||
]
|
13
patches/fPIC-for-static.patch
Normal file
13
patches/fPIC-for-static.patch
Normal file
|
@ -0,0 +1,13 @@
|
|||
diff --git a/build/standalone.gypi b/build/standalone.gypi
|
||||
index 125c5bf..71641a3 100644
|
||||
--- a/build/standalone.gypi
|
||||
+++ b/build/standalone.gypi
|
||||
@@ -107,7 +107,7 @@
|
||||
[ 'visibility=="hidden" and v8_enable_backtrace==0', {
|
||||
'cflags': [ '-fvisibility=hidden' ],
|
||||
}],
|
||||
- [ 'component=="shared_library"', {
|
||||
+ [ 'component=="shared_library" or component=="static_library" and v8_target_arch=="x64"', {
|
||||
'cflags': [ '-fPIC', ],
|
||||
}],
|
||||
],
|
28
patches/gcc48-wno-unused-local-typedefs.patch
Normal file
28
patches/gcc48-wno-unused-local-typedefs.patch
Normal file
|
@ -0,0 +1,28 @@
|
|||
diff --git a/build/common.gypi b/build/common.gypi
|
||||
index 3a59639..365178a 100644
|
||||
--- a/build/common.gypi
|
||||
+++ b/build/common.gypi
|
||||
@@ -376,7 +376,8 @@
|
||||
}],
|
||||
['OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="netbsd"', {
|
||||
'cflags': [ '-Wall', '<(werror)', '-W', '-Wno-unused-parameter',
|
||||
- '-Wnon-virtual-dtor', '-Woverloaded-virtual' ],
|
||||
+ '-Wnon-virtual-dtor', '-Woverloaded-virtual',
|
||||
+ '-Wno-unused-local-typedefs' ],
|
||||
}],
|
||||
['OS=="linux" and v8_enable_backtrace==1', {
|
||||
# Support for backtrace_symbols.
|
||||
diff --git a/build/standalone.gypi b/build/standalone.gypi
|
||||
index 125c5bf..32eaf85 100644
|
||||
--- a/build/standalone.gypi
|
||||
+++ b/build/standalone.gypi
|
||||
@@ -98,7 +98,8 @@
|
||||
'target_defaults': {
|
||||
'cflags': [ '-Wall', '<(werror)', '-W', '-Wno-unused-parameter',
|
||||
'-Wnon-virtual-dtor', '-pthread', '-fno-rtti',
|
||||
- '-fno-exceptions', '-pedantic' ],
|
||||
+ '-fno-exceptions', '-pedantic',
|
||||
+ '-Wno-unused-local-typedefs' ],
|
||||
'ldflags': [ '-pthread', ],
|
||||
'conditions': [
|
||||
[ 'OS=="linux"', {
|
Loading…
Add table
Reference in a new issue