Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Fix build with GCC 4.8 #92

Closed
wants to merge 1 commit into from

1 participant

@randomguy3

GCC 4.8 introduces a warning for unused typedefs, which libv8 triggers,
so we need to turn off error-on-warnings (werror).

This is for the 3.11 branch. master is in another pull request.

@randomguy3 randomguy3 Fix build with GCC 4.8
GCC 4.8 introduces a warning for unused typedefs, which libv8 triggers,
so we need to turn off error-on-warnings (werror).
fb812e4
@ignisf ignisf closed this in #95
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Apr 9, 2013
  1. @randomguy3

    Fix build with GCC 4.8

    randomguy3 authored
    GCC 4.8 introduces a warning for unused typedefs, which libv8 triggers,
    so we need to turn off error-on-warnings (werror).
This page is out of date. Refresh to see the latest.
Showing with 10 additions and 0 deletions.
  1. +3 −0  ext/libv8/builder.rb
  2. +7 −0 ext/libv8/compiler.rb
View
3  ext/libv8/builder.rb
@@ -27,6 +27,9 @@ def make_flags(*flags)
# default.
flags << "ARFLAGS.target=crs"
+ # Fix the build with GCC 4.8 (the "unused typedef" warning)
+ flags << "werror=no" if compiler_is_gcc_48_plus(compiler)
+
"#{libv8_arch}.#{profile} #{flags.join ' '}"
end
View
7 ext/libv8/compiler.rb
@@ -36,6 +36,13 @@ def check_gcc_compiler(name)
compiler
end
+ def compiler_is_gcc_48_plus(name)
+ versionstr = `#{name} --version`.lines[0]
+ return false unless versionstr.include? "GCC"
+ return false unless versionstr =~ /([0-9]+\.[0-9]+\.[0-9]+)/
+ $1 >= "4.8"
+ end
+
def check_clang_compiler(name)
compiler = `which #{name} 2> /dev/null`
return nil unless $?.success?
Something went wrong with that request. Please try again.