Skip to content
This repository has been archived by the owner on Nov 27, 2017. It is now read-only.

v8 formula fails to install on Ubuntu 14.04 #917

Closed
kpkrishnamoorthy opened this issue Mar 12, 2016 · 8 comments
Closed

v8 formula fails to install on Ubuntu 14.04 #917

kpkrishnamoorthy opened this issue Mar 12, 2016 · 8 comments

Comments

@kpkrishnamoorthy
Copy link

On attempting to install the formula "v8", it appears that clang doesn't compile correctly due to the use of an unsupported parameter in the makefile.

It looks like the option -Wshorten-64-to-32 is used when compiling on OS X, but is not relevant to Linux/gcc? ruby-build appeared to have this issue: rbenv/ruby-build#325

Thanks a lot for your help!

Output below:

kp@kp-VirtualBox:~$ brew update
Already up-to-date.
kp@kp-VirtualBox:~$ brew doctor
Your system is ready to brew.
kp@kp-VirtualBox:~$ brew install v8
==> Downloading https://github.com/v8/v8-git-mirror/archive/4.8.271.20.tar.gz
Already downloaded: /home/kp/.cache/Homebrew/v8-4.8.271.20.tar.gz
==> Cloning https://chromium.googlesource.com/external/gyp.git
Updating /home/kp/.cache/Homebrew/v8--gyp--git
==> Checking out revision 2c1e6cced23554ce84806e570acea637f6473afc
==> Cloning https://chromium.googlesource.com/chromium/deps/icu.git
Updating /home/kp/.cache/Homebrew/v8--icu--git
==> Checking out revision 42c58d4e49f2250039f0e98d43e0b76e8f5ca024
==> Cloning https://chromium.googlesource.com/chromium/buildtools.git
Updating /home/kp/.cache/Homebrew/v8--buildtools--git
==> Checking out revision 4a95614772d9bcbd8bc197e1d9bd034e088fc740
==> Cloning https://chromium.googlesource.com/external/swarming.client.git
Updating /home/kp/.cache/Homebrew/v8--swarming_client--git
==> Checking out revision 8fce79620b04bbe5415ace1103db27505bdc4c06
==> Cloning https://chromium.googlesource.com/external/github.com/google/googletest.git
Updating /home/kp/.cache/Homebrew/v8--gtest--git
==> Checking out revision 6f8a66431cb592dad629028a50b3dd418a408c87
==> Cloning https://chromium.googlesource.com/external/googlemock.git
Updating /home/kp/.cache/Homebrew/v8--gmock--git
==> Checking out revision 0421b6f358139f02e102c9c332ce19a33faf75be
==> Cloning https://chromium.googlesource.com/chromium/src/tools/clang.git
Updating /home/kp/.cache/Homebrew/v8--clang--git
==> Checking out revision 66f5328417331216569e8beb244fd887f62e8997
==> make native library=shared snapshot=on console=readline i18nsupport=off strictaliasing=off
Last 15 lines from /home/kp/.cache/Homebrew/Logs/v8/01.make:
  CXX(target) /tmp/v820160311-20555-1soxiy6/v8-4.8.271.20/out/native/obj.target/v8_base/src/accessors.o
  CXX(target) /tmp/v820160311-20555-1soxiy6/v8-4.8.271.20/out/native/obj.target/v8_base/src/address-map.o
  CXX(target) /tmp/v820160311-20555-1soxiy6/v8-4.8.271.20/out/native/obj.target/v8_base/src/allocation.o
  CXX(target) /tmp/v820160311-20555-1soxiy6/v8-4.8.271.20/out/native/obj.target/v8_base/src/allocation-site-scopes.o
g++-4.8: error: unrecognized command line option ‘-Wshorten-64-to-32’
g++-4.8: error: unrecognized command line option ‘-Wshorten-64-to-32’
g++-4.8: error: unrecognized command line option ‘-Wshorten-64-to-32’
make[1]: *** [/tmp/v820160311-20555-1soxiy6/v8-4.8.271.20/out/native/obj.target/v8_base/src/address-map.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: *** [/tmp/v820160311-20555-1soxiy6/v8-4.8.271.20/out/native/obj.target/v8_base/src/accessors.o] Error 1
make[1]: *** [/tmp/v820160311-20555-1soxiy6/v8-4.8.271.20/out/native/obj.target/v8_base/src/allocation.o] Error 1
g++-4.8: error: unrecognized command line option ‘-Wshorten-64-to-32’
make[1]: *** [/tmp/v820160311-20555-1soxiy6/v8-4.8.271.20/out/native/obj.target/v8_base/src/allocation-site-scopes.o] Error 1
make[1]: Leaving directory `/tmp/v820160311-20555-1soxiy6/v8-4.8.271.20/out'
make: *** [native] Error 2

READ THIS: https://github.com/Linuxbrew/linuxbrew/blob/master/share/doc/homebrew/Troubleshooting.md#troubleshooting

brew gist-logs <formula>: https://gist.github.com/7672fc41be2fce3b850c

@sjackman sjackman self-assigned this Mar 12, 2016
@sjackman
Copy link
Member

It looks as though it fails to build with GCC 4.8. Try
brew install gcc v8

@kpkrishnamoorthy
Copy link
Author

Thanks for the suggestion! I tried that, but with what looks to be the same results...

On running brew gist-logs v8, I see that the Linuxbrew GCC version is now 5.3.0 (was previously n/a): https://gist.github.com/37f1cb7c4f0ee3eaeece

Running gcc --version on the same shell that I'm attempting the brew installation yields 5.3.0.

Does this information help in any way? Thanks a lot for your time!

kp@kp-VirtualBox:~$ brew install v8
==> Downloading https://github.com/v8/v8-git-mirror/archive/4.8.271.20.tar.gz
Already downloaded: /home/kp/.cache/Homebrew/v8-4.8.271.20.tar.gz
==> Cloning https://chromium.googlesource.com/external/gyp.git
Updating /home/kp/.cache/Homebrew/v8--gyp--git
==> Checking out revision 2c1e6cced23554ce84806e570acea637f6473afc
==> Cloning https://chromium.googlesource.com/chromium/deps/icu.git
Updating /home/kp/.cache/Homebrew/v8--icu--git
==> Checking out revision 42c58d4e49f2250039f0e98d43e0b76e8f5ca024
==> Cloning https://chromium.googlesource.com/chromium/buildtools.git
Updating /home/kp/.cache/Homebrew/v8--buildtools--git
==> Checking out revision 4a95614772d9bcbd8bc197e1d9bd034e088fc740
==> Cloning https://chromium.googlesource.com/external/swarming.client.git
Updating /home/kp/.cache/Homebrew/v8--swarming_client--git
==> Checking out revision 8fce79620b04bbe5415ace1103db27505bdc4c06
==> Cloning https://chromium.googlesource.com/external/github.com/google/googletest.git
Updating /home/kp/.cache/Homebrew/v8--gtest--git
==> Checking out revision 6f8a66431cb592dad629028a50b3dd418a408c87
==> Cloning https://chromium.googlesource.com/external/googlemock.git
Updating /home/kp/.cache/Homebrew/v8--gmock--git
==> Checking out revision 0421b6f358139f02e102c9c332ce19a33faf75be
==> Cloning https://chromium.googlesource.com/chromium/src/tools/clang.git
Updating /home/kp/.cache/Homebrew/v8--clang--git
==> Checking out revision 66f5328417331216569e8beb244fd887f62e8997
==> make native library=shared snapshot=on console=readline i18nsupport=off strictaliasing=off
Last 15 lines from /home/kp/.cache/Homebrew/Logs/v8/01.make:
  CXX(target) /tmp/v820160311-1908-7dioe8/v8-4.8.271.20/out/native/obj.target/v8_base/src/accessors.o
  CXX(target) /tmp/v820160311-1908-7dioe8/v8-4.8.271.20/out/native/obj.target/v8_base/src/address-map.o
  CXX(target) /tmp/v820160311-1908-7dioe8/v8-4.8.271.20/out/native/obj.target/v8_base/src/allocation.o
  CXX(target) /tmp/v820160311-1908-7dioe8/v8-4.8.271.20/out/native/obj.target/v8_base/src/allocation-site-scopes.o
g++-5: error: unrecognized command line option '-Wshorten-64-to-32'
g++-5: error: unrecognized command line option '-Wshorten-64-to-32'
g++-5: error: unrecognized command line option '-Wshorten-64-to-32'
g++-5: error: unrecognized command line option '-Wshorten-64-to-32'
make[1]: *** [/tmp/v820160311-1908-7dioe8/v8-4.8.271.20/out/native/obj.target/v8_base/src/address-map.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: *** [/tmp/v820160311-1908-7dioe8/v8-4.8.271.20/out/native/obj.target/v8_base/src/accessors.o] Error 1
make[1]: *** [/tmp/v820160311-1908-7dioe8/v8-4.8.271.20/out/native/obj.target/v8_base/src/allocation.o] Error 1
make[1]: *** [/tmp/v820160311-1908-7dioe8/v8-4.8.271.20/out/native/obj.target/v8_base/src/allocation-site-scopes.o] Error 1
make[1]: Leaving directory `/tmp/v820160311-1908-7dioe8/v8-4.8.271.20/out'
make: *** [native] Error 2

READ THIS: https://github.com/Linuxbrew/linuxbrew/blob/master/share/doc/homebrew/Troubleshooting.md#troubleshooting

These open issues may also help:
v8 formula fails to install on Ubuntu 14.04 https://github.com/Linuxbrew/linuxbrew/issues/917
kp@kp-VirtualBox:~$ gcc --version
gcc (Homebrew gcc 5.3.0) 5.3.0
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
kp@kp-VirtualBox:~$ which gcc
/home/kp/.linuxbrew/bin/gcc

@sjackman
Copy link
Member

Try removing this line from the formula with brew edit v8

    ENV["GYP_DEFINES"] = "clang=1 mac_deployment_target=#{MacOS.version}"

@kpkrishnamoorthy
Copy link
Author

I tried that, no difference in behavior.

Edited install function below:

def install
    # Bully GYP into correctly linking with c++11
    ENV.cxx11
    # https://code.google.com/p/v8/issues/detail?id=4511#c3
    ENV.append "GYP_DEFINES", "v8_use_external_startup_data=0"

    if build.with? "icu4c"
      ENV.append "GYP_DEFINES", "use_system_icu=1"
      i18nsupport = "i18nsupport=on"
    else
      i18nsupport = "i18nsupport=off"
    end

    # fix up libv8.dylib install_name
    # https://github.com/Homebrew/homebrew/issues/36571
    # https://code.google.com/p/v8/issues/detail?id=3871
    inreplace "tools/gyp/v8.gyp",
              "'OTHER_LDFLAGS': ['-dynamiclib', '-all_load']",
              "\\0, 'DYLIB_INSTALL_NAME_BASE': '#{opt_lib}'"

    (buildpath/"build/gyp").install resource("gyp")
    (buildpath/"third_party/icu").install resource("icu")
    (buildpath/"buildtools").install resource("buildtools")
    (buildpath/"tools/swarming_client").install resource("swarming_client")
    (buildpath/"testing/gtest").install resource("gtest")
    (buildpath/"testing/gmock").install resource("gmock")
    (buildpath/"tools/clang").install resource("clang")

    system "make", "native", "library=shared", "snapshot=on",
                   "console=readline", i18nsupport,
                   "strictaliasing=off"

    include.install Dir["include/*"]

    cd "out/native" do
      rm ["libgmock.a", "libgtest.a"]
      lib.install Dir["lib*"]
      bin.install "d8", "mksnapshot", "process", "shell" => "v8"
    end
end

Command output below:

kp@kp-VirtualBox:~$ brew install v8
==> Downloading https://github.com/v8/v8-git-mirror/archive/4.8.271.20.tar.gz
Already downloaded: /home/kp/.cache/Homebrew/v8-4.8.271.20.tar.gz
==> Cloning https://chromium.googlesource.com/external/gyp.git
Updating /home/kp/.cache/Homebrew/v8--gyp--git
==> Checking out revision 2c1e6cced23554ce84806e570acea637f6473afc
==> Cloning https://chromium.googlesource.com/chromium/deps/icu.git
Updating /home/kp/.cache/Homebrew/v8--icu--git
==> Checking out revision 42c58d4e49f2250039f0e98d43e0b76e8f5ca024
==> Cloning https://chromium.googlesource.com/chromium/buildtools.git
Updating /home/kp/.cache/Homebrew/v8--buildtools--git
==> Checking out revision 4a95614772d9bcbd8bc197e1d9bd034e088fc740
==> Cloning https://chromium.googlesource.com/external/swarming.client.git
Updating /home/kp/.cache/Homebrew/v8--swarming_client--git
==> Checking out revision 8fce79620b04bbe5415ace1103db27505bdc4c06
==> Cloning https://chromium.googlesource.com/external/github.com/google/googletest.git
Updating /home/kp/.cache/Homebrew/v8--gtest--git
==> Checking out revision 6f8a66431cb592dad629028a50b3dd418a408c87
==> Cloning https://chromium.googlesource.com/external/googlemock.git
Updating /home/kp/.cache/Homebrew/v8--gmock--git
==> Checking out revision 0421b6f358139f02e102c9c332ce19a33faf75be
==> Cloning https://chromium.googlesource.com/chromium/src/tools/clang.git
Updating /home/kp/.cache/Homebrew/v8--clang--git
==> Checking out revision 66f5328417331216569e8beb244fd887f62e8997
==> make native library=shared snapshot=on console=readline i18nsupport=off strictaliasing=off
Last 15 lines from /home/kp/.cache/Homebrew/Logs/v8/01.make:
  CXX(target) /tmp/v820160311-10833-1p2pvlo/v8-4.8.271.20/out/native/obj.target/v8_base/src/accessors.o
  CXX(target) /tmp/v820160311-10833-1p2pvlo/v8-4.8.271.20/out/native/obj.target/v8_base/src/address-map.o
  CXX(target) /tmp/v820160311-10833-1p2pvlo/v8-4.8.271.20/out/native/obj.target/v8_base/src/allocation.o
  CXX(target) /tmp/v820160311-10833-1p2pvlo/v8-4.8.271.20/out/native/obj.target/v8_base/src/allocation-site-scopes.o
g++-5: error: unrecognized command line option '-Wshorten-64-to-32'
make[1]: *** [/tmp/v820160311-10833-1p2pvlo/v8-4.8.271.20/out/native/obj.target/v8_base/src/accessors.o] Error 1
make[1]: *** Waiting for unfinished jobs....
g++-5: error: unrecognized command line option '-Wshorten-64-to-32'
make[1]: *** [/tmp/v820160311-10833-1p2pvlo/v8-4.8.271.20/out/native/obj.target/v8_base/src/address-map.o] Error 1
g++-5: error: unrecognized command line option '-Wshorten-64-to-32'
g++-5: error: unrecognized command line option '-Wshorten-64-to-32'
make[1]: *** [/tmp/v820160311-10833-1p2pvlo/v8-4.8.271.20/out/native/obj.target/v8_base/src/allocation.o] Error 1
make[1]: *** [/tmp/v820160311-10833-1p2pvlo/v8-4.8.271.20/out/native/obj.target/v8_base/src/allocation-site-scopes.o] Error 1
make[1]: Leaving directory `/tmp/v820160311-10833-1p2pvlo/v8-4.8.271.20/out'
make: *** [native] Error 2

READ THIS: https://github.com/Linuxbrew/linuxbrew/blob/master/share/doc/homebrew/Troubleshooting.md#troubleshooting

These open issues may also help:
v8 formula fails to install on Ubuntu 14.04 https://github.com/Linuxbrew/linuxbrew/issues/917

@maxim-belkin
Copy link
Contributor

shorten-64-to-32 is Apple's extension to gcc. First, try a combination of two things:

  1. Shaun's suggestion (comment out a line with Mac.os version)
  2. Add a brute-force inreplace:
inreplace "build/standalone.gypi", /-Wshorten-64-to-32/, ""

Then it should fail with a message about ld

@sjackman
Copy link
Member

I don't have an easy fix for you, I'm afraid. With some luck someone will stumble on this issue and be able to help you out.

@18601673727
Copy link

18601673727 commented Apr 30, 2016

Same issue here, please help

@sjackman
Copy link
Member

This issue was moved to Linuxbrew/homebrew-core#81

@Linuxbrew Linuxbrew locked and limited conversation to collaborators Apr 30, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants