there are a couple threads from last year on getting V8 to compile on mingw, steps I've taken so far:
I've got both msvc and mingw on my system, so this solved a huge headache: >The reason for this behavior is most likely caused by both Microsoft Visual >Studio and MinGW being installed. The current SCons setup for V8 depends on >the SCons autodetecting the toolchain, where MSVC is preferred over MinGW. >You could try patching SConstruct and src/SConscript files adding tools = >['mingw'] to Environment() calls (Environment(tools = ['mingw'])). >On a Windows installation with only MinGW installed V8 SCons build does not >cause problems. ...from Søren, which forces gcc/g++ if both msvc and mingw are present. scons toolchain=gcc didn't work, but a few changes to engine/SCons/ Tool/__init__.py forces gnu tools: > linkers = ['gnulink', 'mslink', 'ilink', 'linkloc', 'ilink32' ] > c_compilers = ['mingw', 'msvc', 'gcc', 'intelc', 'icl', 'icc', 'cc', 'bcc32' ] > cxx_compilers = ['g++', 'msvc', 'intelc', 'icc', 'c++', 'bcc32' ] > assemblers = ['nasm', 'masm', 'gas', '386asm' ] v8_exception.cpp, removed everything related to execinfo.h -- it's unsupported on non-glibc systems (like mingw) > #include "execinfo.h" > static void* stack[20]; > int size = backtrace(stack, 20); > backtrace_symbols_fd(stack, size, 2); everything compiles, but fails when linking a SO: > g++ -shared -s -o v8.so rr.o v8.o v8_array.o v8_callbacks.o v8_cxt.o > v8_date.o v8_exception.o v8_external.o v8_func.o v8_msg.o v8_obj.o v8_ref.o > v8_script.o v8_str.o v8_template.o v8_try_catch.o v8_value.o > -Lc:/git/therubyracer/ext/v8/upstream/build/v8 -L. -LC:/wxruby/ruby/lib -L. > -Wl,--enable-auto-image-base,--enable-auto-import -lmsvcrt-ruby191 > -lshell32 -lws2_32 -lwinmm -lv8 > v8.lib(obj/release/platform-win32.o):platform-win32.cc:(.text$_ZN2v88internal4Time16SetToCurrentTimeEv+0x2d): > undefined reference to `timegett...@0' > v8.lib(obj/release/platform-win32.o):platform-win32.cc:(.text$_ZN2v88internal4Time16SetToCurrentTimeEv+0x78): > undefined reference to `timegett...@0' > v8.lib(obj/release/platform-win32.o):platform-win32.cc:(.text$_ZN2v88internal2OS17TimeCurrentMillisEv+0x39): > undefined reference to `timegett...@0' here's where I'm stuck. the scons-generated Makefile omitted the - lwinmm flag above, added manually as it's the mingw library needed for timeGetTime, but apparently g++ still isn't finding/using it. any ideas? -- v8-users mailing list [email protected] http://groups.google.com/group/v8-users
