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.
Thanks for your help we'll fix this soon.
> 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?
Attila,
Try the newly attached make file.
NM. Something is not linking right.
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
Makefile with arch fixes...
Try the uploaded makefile. Seems like the g++ macros on OSX are kinda broken (they don't follow the format that Linux does).
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???