Skip to content
This repository was archived by the owner on Dec 4, 2023. It is now read-only.

Commit 96c830d

Browse files
committed
Merge branch 'disable-warnings'
2 parents 72633b8 + e5524b2 commit 96c830d

11 files changed

Lines changed: 29 additions & 168 deletions

ext/libv8/builder.rb

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def make_target
2020
profile = enable_config('debug') ? 'debug' : 'release'
2121
"#{libv8_arch}.#{profile}"
2222
end
23-
23+
2424
def make_flags(*flags)
2525
# FreeBSD uses gcc 4.2 by default which leads to
2626
# compilation failures due to warnings about aliasing.
@@ -49,24 +49,29 @@ def make_flags(*flags)
4949
end
5050

5151
def build_libv8!
52+
checkout!
53+
setup_python!
5254
Dir.chdir(V8_Source) do
53-
fail 'No compilers available' if @compiler.nil?
54-
checkout!
55-
setup_python!
5655
setup_build_deps!
57-
patch! *patch_directories_for(@compiler)
56+
fail 'No compilers available' if @compiler.nil?
57+
patch!
5858
print_build_info
59+
puts 'Beginning compilation. This will take some time.'
60+
61+
command = "env CXX=#{@compiler} LINK=#{@compiler}"
5962

6063
case RUBY_PLATFORM
6164
when /mingw/
6265
# use a script that will fix the paths in the generated Makefiles
6366
# don't use make_flags otherwise it will trigger a rebuild of the Makefiles
6467
system "env CXX=#{@compiler} LINK=#{@compiler} bash #{PATCH_DIRECTORY}/mingw-generate-makefiles.sh"
65-
system "env CXX=#{@compiler} LINK=#{@compiler} make #{make_target}"
66-
68+
command += " make #{make_target}"
6769
else
68-
puts `env CXX=#{@compiler} LINK=#{@compiler} #{make} #{make_flags}`
70+
command += " #{make} #{make_flags}"
6971
end
72+
73+
puts "Building v8 with #{command}"
74+
system command
7075
end
7176
return $?.exitstatus
7277
end

ext/libv8/patcher.rb

Lines changed: 4 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -4,52 +4,15 @@ module Patcher
44

55
module_function
66

7-
def patch_directories_for(compiler)
8-
patch_directories = []
9-
10-
case
11-
when compiler.target =~ /arm/
12-
patch_directories << 'arm'
13-
end
14-
15-
case compiler
16-
when Compiler::GCC
17-
patch_directories << 'gcc48' if compiler.version >= '4.8'
18-
when Compiler::Clang
19-
patch_directories << 'clang'
20-
patch_directories << 'clang33' if compiler.version >= '3.3'
21-
patch_directories << 'clang51' if compiler.version >= '5.1'
22-
patch_directories << 'clang70' if compiler.version >= '7.0'
23-
patch_directories << 'clang73' if compiler.version >= '7.3'
24-
end
25-
26-
patch_directories
27-
end
28-
29-
def patch_directories(*additional_directories)
30-
absolute_paths = [PATCH_DIRECTORY]
31-
32-
additional_directories.each do |directory|
33-
absolute_paths << File.join(PATCH_DIRECTORY, directory)
34-
end
35-
36-
absolute_paths.uniq
37-
end
38-
39-
def patches(*additional_directories)
40-
patch_directories(*additional_directories).map do |directory|
41-
Dir.glob(File.join directory, '*.patch')
42-
end.flatten.sort
43-
end
44-
45-
def patch!(*additional_directories)
7+
def patch!
468
File.open(".applied_patches", File::RDWR|File::CREAT) do |f|
47-
available_patches = patches *additional_directories
9+
available_patches = Dir.glob(File.join(PATCH_DIRECTORY, '*.patch'))
4810
applied_patches = f.readlines.map(&:chomp)
4911

5012
(available_patches - applied_patches).each do |patch|
13+
puts "Applying #{patch}"
5114
`patch -p1 -N < #{patch}`
52-
fail 'failed to apply patch' unless $?.success?
15+
fail "failed to apply patch #{patch}" unless $?.success?
5316
f.puts patch
5417
end
5518
end

patches/clang/no-unused-private-field.patch

Lines changed: 0 additions & 28 deletions
This file was deleted.

patches/clang33/silence-nested-anon-types-and-unused-function-warnings.patch

Lines changed: 0 additions & 28 deletions
This file was deleted.

patches/clang51/no-unused-variable.patch

Lines changed: 0 additions & 12 deletions
This file was deleted.

patches/clang70/no-unused-local-typedefs.patch

Lines changed: 0 additions & 13 deletions
This file was deleted.

patches/clang73/no-shift-negative-value.patch

Lines changed: 0 additions & 10 deletions
This file was deleted.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
diff --git a/build/standalone.gypi b/build/standalone.gypi
2+
index 125c5bf..de1924c 100644
3+
--- a/build/standalone.gypi
4+
+++ b/build/standalone.gypi
5+
@@ -194,7 +194,6 @@
6+
'GCC_INLINES_ARE_PRIVATE_EXTERN': 'YES',
7+
'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES', # -fvisibility=hidden
8+
'GCC_THREADSAFE_STATICS': 'NO', # -fno-threadsafe-statics
9+
- 'GCC_TREAT_WARNINGS_AS_ERRORS': 'YES', # -Werror
10+
'GCC_VERSION': 'com.apple.compilers.llvmgcc42',
11+
'GCC_WARN_ABOUT_MISSING_NEWLINE': 'YES', # -Wnewline-eof
12+
# MACOSX_DEPLOYMENT_TARGET maps to -mmacosx-version-min
File renamed without changes.

0 commit comments

Comments
 (0)