[vbox-dev] Building on Windows x64

Oliver Loch grimeton at gmx.net
Wed Sep 26 20:39:43 GMT 2012


Hi,

I finally have a working build environment on Windows x32 and x64.

While building on x64 I faced some errors that I was able to fix, but I'm not sure if they really require to be fixed. Are the builds working on other build systems/environments?

When running configure.vbs in the VS2010SP1 Professional x64 Win64 Command Prompt, the following error pops up:

====== SNIP ====== 8< =========

Shell inheritance test: OK
Source path: OK
Checking for kBuild...
 Found kBuild: C:/vbox/kBuild
 Found kBuild binaries: C:/vbox/kBuild/bin/win.x86
Checking for Windows DDK v7.1...
 Found Windows DDK v7.1: C:/WinDDK/7600.16385.1
Checking for Visual C++...
error: Executing '' (which we believe to be the Visual C++ compiler driver) failed. 

===== >8 ========= SNAP=============

The compiler is not found, and the script tries to execute an empty string. It is there, and one can start it by simply writing cl on the prompt. The generated env.bat file also contains a path that points to an x86 version of the toolset. I patched configure.vbs to work, but how is it done in other build environments? What am I missing?

Next  thing I see are varying OpenSSL linker errors:

======= >8 ======== SNIP =================
VBoxRT.def : error LNK2001: unresolved external symbol CRYPTO_dbg_pop_info
VBoxRT.def : error LNK2001: unresolved external symbol CRYPTO_dbg_push_info
VBoxRT.def : error LNK2001: unresolved external symbol CRYPTO_dbg_remove_all_info
VBoxRT.def : error LNK2001: unresolved external symbol CRYPTO_malloc_debug_init
VBoxRT.def : error LNK2001: unresolved external symbol CRYPTO_set_mem_info_functions
VBoxRT.def : error LNK2001: unresolved external symbol OBJ_bsearch
VBoxRT.def : error LNK2001: unresolved external symbol OBJ_bsearch_ex
VBoxRT.def : error LNK2001: unresolved external symbol RSAPrivateKey_asn1_meth
VBoxRT.def : error LNK2001: unresolved external symbol X509_asn1_meth
VBoxRT.def : error LNK2001: unresolved external symbol _CONF_get_section
VBoxRT.def : error LNK2001: unresolved external symbol _CONF_get_string
C:/vbox/out/win.amd64/release/obj/VBoxRT/VBoxRT.lib : fatal error LNK1120: 11 unresolved externals
kmk: *** [C:/vbox/out/win.amd64/release/obj/VBoxRT/VBoxRT.dll] Error 1120
The failing command:
@ C:/PROGRA~2/MICROS~2.0/VC/bin/amd64/link.exe -nologo -machine:amd64                                                                            /NOD /INCREMENT
AL:NO /MAPINFO:EXPORTS /LARGEADDRESSAWARE /DEBUG /DISALLOWLIB:libc.lib /DISALLOWLIB:libcd.lib /DISALLOWLIB:libcmt.lib /DISALLOWLIB:libcmtd.lib /DISALLOWLIB:msvc
rtd.lib /DISALLOWLIB:msvcprtd.lib    /MANIFEST    /OUT:C:/vbox/out/win.amd64/release/obj/VBoxRT/VBoxRT.dll /IMPLIB:C:/vbox/out/win.amd64/release/obj/VBoxRT/VBox
RT.lib /MAPINFO:EXPORTS /INCREMENTAL:NO /MAP:C:/vbox/out/win.amd64/release/obj/VBoxRT/VBoxRT.map /DLL  /DEF:C:/vbox/out/win.amd64/release/obj/VBoxRT/VBoxRT.def
  /LIBPATH:C:/PROGRA~1/MIA713~1/Windows/v7.1/Lib/x64  /LIBPATH:C:/WinDDK/7600.16385.1/lib/wlh/amd64  /LIBPATH:C:/PROGRA~1/MIA713~1/Windows/v7.1/Lib/x64 @C:/vbox
/out/win.amd64/release/obj/VBoxRT/VBoxRT.rsp
kmk: *** Deleting file `C:/vbox/out/win.amd64/release/obj/VBoxRT/VBoxRT.dll'
kmk: *** [C:/vbox/out/win.amd64/release/obj/VBoxRT/VBoxRT.dll] Deleting file `C:/vbox/out/win.amd64/release/obj/VBoxRT/VBoxRT.rsp' 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
=========== SNAP ======== 8< ====================

When checking the .def files in src\VBox\Runtime\r3\win\, they show that the files were generated against a debug build of the lib. Is this the default, and are the files patched to build a release version?

I checked several available versions of OpenSSL in binary and source form, and could only reproduce some of the debug symbols on x32 builds, but not on x64. I can patch the .def files to make it work, after checking the usage of those functions/symbols in the VBox source. Is this also a developer thing to get debug builds and are the release versions patched, too?

Next problem I hit is:

======== SNIP ========== >8 ==============

Microsoft (R) Windows (R) Resource Compiler Version 6.1.7600.16385
Copyright (C) Microsoft Corporation.  All rights reserved.

kBuild: Compiling VBoxSVC - C:/vbox/src/VBox/Main/src-server/win/VBoxComEvents.cpp
VBoxComEvents.cpp
kBuild: Compiling VBoxSVC - C:/vbox/src/VBox/Main/src-server/win/USBProxyServiceWindows.cpp
USBProxyServiceWindows.cpp
kBuild: Compiling VBoxSVC - C:/vbox/src/VBox/Main/src-server/win/PerformanceWin.cpp
PerformanceWin.cpp
kBuild: Compiling VBoxSVC - C:/vbox/src/VBox/Main/src-server/win/NetIf-win.cpp
NetIf-win.cpp
kBuild: Linking vbox-img
   Creating library C:/vbox/out/win.amd64/release/obj/vbox-img/vbox-img.lib and object C:/vbox/out/win.amd64/release/obj/vbox-img/vbox-img.exp
C:\vbox\src\VBox\Main\include\netif.h(151) : warning C4267: 'initializing' : conversion from 'size_t' to 'int', possible loss of data
kBuild: Compiling tstVMStructSize - C:/vbox/src/VBox/VMM/testcase/tstVMStructSize.cpp
tstVMStructSize.cpp
kBuild: Generating tstVMStructSize - C:/vbox/out/win.amd64/release/obj/VMM/tstAsmStructsHC.h
kmk_redirect.exe: error: _spawnvp(_P_WAIT, "/bin/nm.exe", ...) failed: No such file or directory
kmk: *** [C:/vbox/out/win.amd64/release/obj/VMM/tstAsmStructsHC.h] Error 1
kmk: *** Waiting for unfinished jobs....
kmk: *** Exiting with status 2
 
IMPLIB:C:/vbox/out/win.amd64/release/obj/VBoxRT/VBoxRT.lib /MAPINFO:EXPORTS /INCREMENTAL:NO /MAP:C:/vbox/out/win.amd64/release/obj/VBoxRT/VBoxRT.map /DLL  /DEF:C:/vbox/out/win.amd64/release/obj/VBoxRT/VBoxRT.def
  /LIBPATH:C:/PROGRA~1/MIA713~1/Windows/v7.1/Lib/x64  /LIBPATH:C:/WinDDK/7600.16385.1/lib/wlh/amd64  /LIBPATH:C:/PROGRA~1/MIA713~1/Windows/v7.1/Lib/x64 @C:/vbox
/out/win.amd64/release/obj/VBoxRT/VBoxRT.rsp
kmk: *** Deleting file `C:/vbox/out/win.amd64/release/obj/VBoxRT/VBoxRT.dll'
kmk: *** [C:/vbox/out/win.amd64/release/obj/VBoxRT/VBoxRT.dll] Deleting file `C:/vbox/out/win.amd64/release/obj/VBoxRT/VBoxRT.rsp' 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
========== 8< =========== SNAP =================

This error comes from an empty "PATH_TOOL_MINGW32" which is not defined on x64 builds. I patched "Makefile.kmk" in src\vbox\vmm\testcase\ to check for x64 builds and to use the x64 toolchain. But then I see a different error:

==== SNIP ==== 8< ================================

kBuild: Compiling tstVMStructSize - C:/vbox/src/VBox/VMM/testcase/tstVMStructSize.cpp
kBuild: Generating tstVMStructSize - C:/vbox/out/win.amd64/release/obj/VMM/tstVMStructSize.cpp
tstAsmStructsHC.h
kmk_redirect.exe: error: _spawnvp(_P_WAIT, "C:/vbox/out/win.amd64/release/obj/VMM/tstAsmStructsAsm.o", ...) failed: Exec format error
kmk: *** [C:/vbox/out/win.amd64/release/obj/VMM/tstAsmStructsHC.h] Error 1
kmk: *** Waiting for unfinished jobs....
kmk: *** Exiting with status 2
 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
=============>8 ======== SNAP ======================

Looks like something could not be/ was not linked and so it errors out. The only solution at the moment is to comment the include statement of the testcase out and build VBox without it.
Is it necessary to have the 32bit toolchain to build/link the asm stuff? And how is this handled for release versions?

The above errors appear in revision 43313 as well as 43422 and 43434.

The last one is not present in 43434 as a different error comes up before:

==== SNIP ==== 8< =========================

kBuild: Compiling VBoxOGLfeedbackspu - C:/vbox/out/win.amd64/release/obj/VBoxOGLgen/feedbackspu_state.c
feedbackspu_state.c
kBuild: Pass - Programs
kBuild: Installing C:/vbox/out/win.amd64/release/bin/sdk/bindings/mscom/lib/VirtualBox_i.c
kBuild: Linking tstVMStructRC
kmk: *** No rule to make target `C:/vbox/src/VBox/VMM/include/HWACCMInternal.mac', needed by `C:/vbox/out/win.amd65/release/obj/VMM/tstAsmStructsAsm.mac'.  Stop
.
kmk: *** Waiting for unfinished jobs....
kmk: *** Exiting with status 2

 ==== >8 ==== SNAP ==============================

Didn't have the time to investigate this any further.

I hope I can get some answers to the questions above, to have a proper build environment.

Thanks!

KR,

Oliver

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4343 bytes
Desc: not available
URL: <http://www.virtualbox.org/pipermail/vbox-dev/attachments/20120926/d8ea158a/attachment.p7s>


More information about the vbox-dev mailing list