[v8-users] js2c.py throws error message

249 views
Skip to first unread message

Matthew

unread,
Apr 26, 2011, 2:49:00 AM4/26/11
to v8-users
When I compiled v8.sln, the message below is displayed,
2>Processing js files...
2>Traceback (most recent call last):
2> File "..\js2c.py", line 364, in <module>
2> main()
2> File "..\js2c.py", line 361, in main
2> JS2C(source_files, [natives], { 'TYPE': type })
2> File "..\js2c.py", line 294, in JS2C
2> lines = ReadFile(filename)
2> File "..\js2c.py", line 56, in ReadFile
2> file = open(filename, "rt")
2>IOError: [Errno 2] No such file or directory: 'CORE'
2>Project : error PRJ0002 : Error result 1 returned from 'C:\Windows
\system32\cmd.exe'.

I don't know which problem caused the error .please help me! thanks.

Peter Varga

unread,
Apr 26, 2011, 5:09:04 AM4/26/11
to v8-u...@googlegroups.com
Hi Matthew,

I'm not experienced in windows build system at all but I have already
run into the same problem on linux.
I think you should modify the tools/visual_studio/js2c.cmd:6 line:
remove the %TARGET_DIR%\natives-empty.cc argument.
The generating of the natives-empty.cc file isn't needed anymore.

Regards,
Peter

Alejandro F. Reimondo

unread,
Apr 26, 2011, 8:12:30 AM4/26/11
to v8-u...@googlegroups.com
Hi,
Same problem here (windows, at revision: 7679).
I removed the argument in js2c.cmd
but when linking v8_mksnapshot there are unresolved externals
reported; 4 entries related with NativesCollection
Ale.

> --
> v8-users mailing list
> v8-u...@googlegroups.com
> http://groups.google.com/group/v8-users
>

Peter Varga

unread,
Apr 26, 2011, 10:24:34 AM4/26/11
to v8-u...@googlegroups.com
Hi,

An experimental-libraries.cc file need to be generated for linking
v8_mksnapshot.
You can generate it with a similar command like at
tools/visual_studio/js2c.cmd:6.
Try to add the following line to the js2c.cmd file:

%PYTHON% ..\js2c.py %TARGET_DIR%\experimental-libraries.cc EXPERIMENTAL
%SOURCE_DIR%\macros.py %SOURCE_DIR%\proxy.js

I'm not sure it's correct because I couldn't try it. Probably you should
add the experimental-libraries object to the build system too.
The idea is based on the solution in src/SConscript (look
"experimental_libraries" term up in the SConscript file).

Regards,
Peter

Alejandro F. Reimondo

unread,
Apr 27, 2011, 2:41:23 PM4/27/11
to v8-u...@googlegroups.com
Thank you Peter for the information.
making teh changes you suggested, and
replacing "natives-empty.cc" with "experimental-libraries.cc"
under "v8/generated files" and "v8_snapshot/generated files"
makes the solution file compilation success in debug
and release mode (svn revision 7695).
cheers,

mathe...@gmail.com

unread,
Apr 28, 2011, 4:22:44 AM4/28/11
to v8-u...@googlegroups.com
After modification as Peter suggested, my js2c.cmd includes the following items,
---------------------------begin------------------------------
@echo off
set SOURCE_DIR=%1
set TARGET_DIR=%2
set PYTHON="..\..\..\third_party\python_24\python.exe"
if not exist %PYTHON% set PYTHON=python.exe

%PYTHON% ..\js2c.py %TARGET_DIR%\experimental-libraries.cc EXPERIMENTAL %SOURCE_DIR%\macros.py %SOURCE_DIR%\proxy.js
---------------------------end----------------------------

However, I even got more errors , as follows,
3>mksnapshot.obj : error LNK2019: unresolved external symbol "public: static int __cdecl v8::internal::NativesCollection<0>::GetBuiltinsCount(void)" (?GetBuiltinsCount@?$NativesCollection@$0A@@internal@v8@@SAHXZ) referenced in function _main
3>v8.lib(serialize.obj) : error LNK2001: unresolved external symbol "public: static int __cdecl v8::internal::NativesCollection<0>::GetBuiltinsCount(void)" (?GetBuiltinsCount@?$NativesCollection@$0A@@internal@v8@@SAHXZ)
3>v8.lib(heap.obj) : error LNK2001: unresolved external symbol "public: static int __cdecl v8::internal::NativesCollection<0>::GetBuiltinsCount(void)" (?GetBuiltinsCount@?$NativesCollection@$0A@@internal@v8@@SAHXZ)
3>v8.lib(bootstrapper.obj) : error LNK2001: unresolved external symbol "public: static int __cdecl v8::internal::NativesCollection<0>::GetBuiltinsCount(void)" (?GetBuiltinsCount@?$NativesCollection@$0A@@internal@v8@@SAHXZ)
3>v8.lib(lithium-gap-resolver-ia32.obj) : error LNK2001: unresolved external symbol "private: static enum v8::internal::Thread::LocalStorageKey v8::internal::Isolate::isolate_key_" (?isolate_key_@Isolate@internal@v8@@0W4LocalStorageKey@Thread@23@A)
...

thanks

Søren Gjesse

unread,
Apr 28, 2011, 4:50:25 AM4/28/11
to v8-u...@googlegroups.com
Hi,

I am afraid that the Visual Studio project files in the tools/visual_studio directory has not been updated recently, and therefore are not really usable. We are planning to remove these files and instead support generating Visual Studio files from GYP files in the same way as is used by Chromium.

To generate Visual Studio project files from GYP take a look at the README.txt in the build directory.

Sorry for the inconvenience.

Note that SCons is still the main build tool for V8.

Regards,
Søren

--

mathe...@gmail.com

unread,
Apr 28, 2011, 5:00:55 AM4/28/11
to v8-u...@googlegroups.com
My V8 revision: 7697
Does anyone know how to compile v8 code on Windows?

Mads Sig Ager

unread,
Apr 28, 2011, 5:27:04 AM4/28/11
to v8-u...@googlegroups.com

mathe...@gmail.com

unread,
Apr 28, 2011, 5:40:24 AM4/28/11
to v8-u...@googlegroups.com
Hi Mads,

Thanks.
However, If you compile V8 code( revision: 7697) by exactly followed http://code.google.com/p/v8/wiki/BuildingOnWindows , you can NOT compile success.

>Mads Sig Ager <ag...@chromium.org> to v8-u...@googlegroups.com
>5:27pm

Søren Gjesse

unread,
Apr 28, 2011, 7:05:20 AM4/28/11
to v8-u...@googlegroups.com
I found no problems building using SCons. I have Visual Studio 2008, Python 2.7 installed in C:\Python27 and Scons 2.0.1 on top of that.

From a "Visual Studio 2008 Command Prompt" I issue:

> set PATH=C:\Python27;C:\Python27\Scripts;%PATH%
> scons sample=shell env="INCLUDE:%INCLUDE%,LIB:%LIB%,PATH:%PATH%"
> shell
V8 version 3.3.3 (candidate)
> 1+1
2
>

Please provide some more information on the failing compile.

Regards,
Søren

--

Alejandro F. Reimondo

unread,
Apr 28, 2011, 9:34:23 AM4/28/11
to v8-u...@googlegroups.com
Add the experimental-libraries.cc file (in target dir)
 to v8 and v8_snapshot projects.
That makes a success on my side.
I attached an image with my project tree.
Ale.
 
--
Image1.jpg

Søren Gjesse

unread,
Apr 29, 2011, 8:10:08 AM4/29/11
to v8-u...@googlegroups.com

I found no problems building using SCons. I have Visual Studio 2008, Python 
2.7 installed in C:\Python27 and Scons 2.0.1 on top of that. 

From a "Visual Studio 2008 Command Prompt" I issue: 

> set PATH=C:\Python27;C:\Python27\Scripts;%PATH% 
> scons sample=shell env="INCLUDE:%INCLUDE%,LIB:%LIB%,PATH:%PATH%" 
> shell 

V8 version 3.3.3 (candidate) 

> 1+1 


Please provide some more information on the failing compile. 

Regards, 
Søren


mathe...@gmail.com

unread,
Apr 29, 2011, 1:35:39 PM4/29/11
to v8-u...@googlegroups.com
V8 revision: 7697 should contain some errors(I guess v8.sln causes the problem).

When I used VS2005 to compile V8 by followed http://code.google.com/p/v8/wiki/BuildingOnWindows , VS2005 complained the errors below,
1>virtual-frame-heavy.cc
1>c1xx : fatal error C1083: Cannot open source file: '..\..\src\virtual-frame-heavy.cc': No such file or directory
...

After I deleted the files(virtual-frame*, register-allocator* ...) from v8.sln, the following errors were occurred,

2>Processing js files...
2>Traceback (most recent call last):
2> File "..\js2c.py", line 364, in <module>
2> main()
2> File "..\js2c.py", line 361, in main
2> JS2C(source_files, [natives], { 'TYPE': type })
2> File "..\js2c.py", line 294, in JS2C
2> lines = ReadFile(filename)
2> File "..\js2c.py", line 56, in ReadFile
2> file = open(filename, "rt")
2>IOError: [Errno 2] No such file or directory: 'CORE'
2>Project : error PRJ0002 : Error result 1 returned from 'C:\Windows\system32\cmd.exe'.

Alejandro said he "makes a success". I want to know he choosed which V8 revision to compile.
Reply all
Reply to author
Forward
0 new messages