Errors when linking to bottled v8 #41091
Comments
The bottle is built with clang, but the deployment target is being set to 10.5 which forces it to link against libstdc++. I'm not sure if it's intentional on the part of the v8 developers, but I've seen this before with other gyp-based software. |
That explains a lot. Where is that defined? And would it make sense for the homebrew formula to patch that? |
This problem also seems to be the cause of Node misbehaving in certain situations when built with Theoretically in V8 it's possible to set the |
@jacknagel, @DomT4: Ping. Do you have recommendations for what to do here? (And could you give me details on how to configure this?) |
Does the error reproduce for you when you build |
It definitely did at the time I filed this issue. I haven't tried since then. |
Ping. Can you offer any help with this? |
Have you tried changing the deployment target, like @DomT4 suggested? This gets v8 to link against libc++ instead of libstdc++, although there ought to be a more elegant way: �diff --git a/Library/Formula/v8.rb b/Library/Formula/v8.rb
index 3ed6484..556c9d3 100644
--- a/Library/Formula/v8.rb
+++ b/Library/Formula/v8.rb
@@ -49,6 +49,9 @@ class V8 < Formula
"'OTHER_LDFLAGS': ['-dynamiclib', '-all_load']",
"\\0, 'DYLIB_INSTALL_NAME_BASE': '#{opt_lib}'"
+ inreplace "build/standalone.gypi", "'mac_deployment_target%': '10.5'",
+ "'mac_deployment_target%': '#{MacOS.version}'"
+
# Download gyp ourselves because running "make dependencies" pulls in ICU.
(buildpath/"build/gyp").install resource("gyp")
(buildpath/"testing/gmock").install resource("gmock") I still can't get google-js-test to build, though: https://gist.github.com/dunn/d1143fe888a63011d4e9#file-01-make-L49 This is the formula I'm using: class GoogleJsTest < Formula
homepage "https://github.com/google/gjstest"
url "https://github.com/google/gjstest/archive/v1.0.tar.gz"
sha256 "085b7ea5a9233fdd6a8aee535bf925baff002e5b0ffb9c71d86824850639405e"
head "https://github.com/google/gjstest.git"
depends_on :macos => :snow_leopard
depends_on "gflags"
depends_on "glog"
depends_on "protobuf"
depends_on "re2"
depends_on "v8"
def install
system "make", "PREFIX=#{prefix}", "install"
end
end |
The whole V8 formula needs updating and rewriting from the ground up, to be honest. I wonder if the V8 built inside Node works against the |
It gets further, but not quite: https://gist.github.com/anonymous/04b95ecb10dddab65615 |
@dunn: I didn't know how to do that, which is why I asked you how above. :-) But thanks for showing me; it totally worked for me at google/gjstest@3a92963. Can we get that into the official v8 formula, and then I'll update the gjstest formula accordingly? |
I'll file a V8 PR in a minute. I've spent the last two hours bullying/being bullied by GYP 😒 |
@jacobsa Your tweak works against the upcoming V8 PR:
👍 |
@DomT4: Awesome! Thanks for taking care of this. |
(To be clear: I'm happy to fix the gjstest problem myself once the v8 change is in.) |
We track Chrome Stable in terms of V8 releases & updates, if that's at all useful knowledge for future. It'd fallen out of sync for the last few months because of various build issues. |
For the longest time I couldn't reproduce these because I couldn't begin to build, due to the ancient and messed up version of v8 in Homebrew (see Homebrew/legacy-homebrew#41091). As of Homebrew/legacy-homebrew@9dae089 we now have v8 4.4.63.31 to work with, and after this commit we build and our tests pass with the following dependencies installed by homebrew: gflags glog libxml2 protobuf re2 v8
Closes Homebrew#41091. Closes Homebrew#43428. Signed-off-by: Dominyk Tiller <dominyktiller@gmail.com>
I'm attempting to get Google JS Test working with Homebrew (again, now that re2 has a non-head-only formula). The problem is that it no longer compiles with the bottle of v8 in homebrew:
Note that this is against v8 installed from
v8-4.1.0.27.yosemite.bottle.tar.gz
.As far as I can tell this is due to the version of v8 installed by homebrew having been built with g++, and gjstest compiling with clang. Supposedly you can work around this by setting
-stdlib=libstdc++
, but this doesn't seem to work for me due to C++11 features not being available that way.Since g++ isn't around on most Macs these days, would it make sense to bottle v8 using clang instead? Or am I just misconfiguring something?
The text was updated successfully, but these errors were encountered: