Menu

#7 v8sh build fails on Mac OS X 10.6.3 with 64-bit CPU

open
lpsantil
5
2015-02-25
2010-04-29
No

Building the v8sh fails on Mac OS X 10.6.3 with a 64-bit CPU:

In file included from ./v8/src/v8.h:56,
from v8sh.cc:39:
./v8/src/globals.h:78:2: error: #error Target architecture is not supported by v8
make: *** [v8/v8sh] Error 1

After explicitly adding -DV8_TARGET_ARCH_IA32 to g++ arguments I got:

In file included from ./v8/src/v8.h:56,
from v8sh.cc:39:
./v8/src/globals.h:58:2: error: #error Target architecture ia32 is only supported on ia32 host
make: *** [v8/v8sh] Error 1

Finally, adding -m32 too made the build work. That is, I changed the line 57 of Makefile.v8 to:

    g++ -DV8\_TARGET\_ARCH\_IA32 -m32 -O3 -o v8sh v8sh.cc -I./v8/src -L./v8 -lv8 -lpthread

(I went for a 32-bit build since v8 itself is also built with 32-bit. Any idea whether it'd work as a 64-bit build?) I guess the build process should figure out these flags somehow on its own.

Discussion

  • beachcoder

    beachcoder - 2010-05-17

    Thanks for your help we'll fix this soon.

     
  • beachcoder

    beachcoder - 2010-05-17
    • assigned_to: nobody --> lpsantil
     
  • lpsantil

    lpsantil - 2010-05-17

    > Building the v8sh fails on Mac OS X 10.6.3 with a 64-bit CPU:

    > In file included from ./v8/src/v8.h:56,
    > from v8sh.cc:39:
    > ./v8/src/globals.h:78:2: error: #error Target architecture is not supported by v8
    > make: *** [v8/v8sh] Error 1

    > After explicitly adding -DV8_TARGET_ARCH_IA32 to g++ arguments I got:

    > In file included from ./v8/src/v8.h:56,
    > from v8sh.cc:39:
    > ./v8/src/globals.h:58:2: error: #error Target architecture ia32 is only supported on ia32 host
    > make: *** [v8/v8sh] Error 1

    > Finally, adding -m32 too made the build work. That is, I changed the line 57 of Makefile.v8 to:

    > g++ -DV8_TARGET_ARCH_IA32 -m32 -O3 -o v8sh v8sh.cc -I./v8/src -L./v8 -lv8 -lpthread

    > (I went for a 32-bit build since v8 itself is also built with 32-bit. Any idea whether it'd work as a 64-bit build?) I guess the build process should figure out these flags somehow on its own.

    Jan: Fixing this is pretty easy. An if statement, a few vars, and a change to one line in the Makefile should do the trick. What do you want the default behavior to be? 32-bit build or 64-bit build?

    Attila: My 10.6.3 install broke on me and I'm in the process of rebuilding it. So I need you to help me with the debugging. What does "uname -m" & "uname -a" return for you?

     
  • lpsantil

    lpsantil - 2010-05-18

    Attila,

    Try the newly attached make file.

     
  • lpsantil

    lpsantil - 2010-05-18

    NM. Something is not linking right.

     
  • Attila Szegedi

    Attila Szegedi - 2010-05-18

    Hi,

    thanks for looking into this. FWIW here are my uname -m and uname -a:

    $ uname -m
    i386
    $ uname -a
    Darwin MyMachineName.local 10.3.0 Darwin Kernel Version 10.3.0: Fri Feb 26 11:58:09 PST 2010; root:xnu-1504.3.12~1/RELEASE_I386 i386

     
  • lpsantil

    lpsantil - 2010-05-18

    Makefile with arch fixes...

     
  • lpsantil

    lpsantil - 2010-05-18

    Try the uploaded makefile. Seems like the g++ macros on OSX are kinda broken (they don't follow the format that Linux does).

     
  • Deepali

    Deepali - 2011-10-25

    I got the same error on fedora,

    CXX(host) out/Release/obj.host/v8_nosnapshot/gen/libraries.o
    In file included from v8/src/v8globals.h:31:0,
    from v8/src/v8.h:53,
    from out/Release/obj/gen/libraries.cc:7:
    v8/src/globals.h:116:2: error: #error Target architecture x64 is only
    supported on x64 host
    In file included from v8/src/isolate.h:37:0,
    from v8/src/objects-inl.h:43,
    from v8/src/v8.h:60,
    from out/Release/obj/gen/libraries.cc:7:
    v8/src/execution.h:251:74: error: a function call cannot appear in a
    constant-expression
    v8/src/execution.h:252:72: error: a function call cannot appear in a
    constant-expression
    make: *** [out/Release/obj.host/v8_nosnapshot/gen/libraries.o] Error 1

    Any one???

     

Log in to post a comment.