Errors building OSE 3.2.8 on Mac OS X 10.6 Snow Leopard

Discussions related to using the OSE version of VirtualBox.
Post Reply
Phil6379
Posts: 8
Joined: 17. Sep 2010, 22:40
Primary OS: Mac OS X other
VBox Version: OSE self-compiled
Guest OSses: FreeBSD

Errors building OSE 3.2.8 on Mac OS X 10.6 Snow Leopard

Post by Phil6379 »

Hi,

I'm trying to compile VirtualBox OSE 3.2.8 under Mac OS X Snow Leopard. My goal is to install FreeBSD in VB.
I chose the OSE because I like the open-source philosophy, that's all. I have literally no compiling background and very rudimentary Unix background. (I know how to cd but that's pretty much it.) But I am a little geeky so I decided to try to compile the OSE myself.

I downloaded the source and read the instructions at http://www.virtualbox.org/wiki/Mac%20OS ... structions. As I was doing everything step by step, some differences (and/or not mentionned things) occurred :

1. When installing doxygen from MacPorts, I got the message to complete python installation (doxygen dependency) :

Code: Select all

--->  Fetching python26
--->  Attempting to fetch Python-2.6.6.tar.bz2 from http://distfiles.macports.org/python26
--->  Verifying checksum(s) for python26
--->  Extracting python26
--->  Applying patches to python26
--->  Configuring python26
--->  Building python26
--->  Staging python26 into destroot
--->  Installing python26 @2.6.6_0+no_tkinter
--->  Activating python26 @2.6.6_0+no_tkinter

To fully complete your installation and make python 2.6 the default,  please run:
 	sudo port install python_select
 	sudo python_select python26

--->  Cleaning python26
So I did that.

2. The link provided for the QT/Mac packages (http://qt.nokia.com/downloads/mac-os-cpp) are for version 4.6.2, but the latest Qt version is 4.6.3. I found the 4.6.3 package at http://qt.nokia.com/downloads/qt-for-op ... n-mac-os-x. I took the first Cocoa package, qt-mac-cocoa-opensource-4.6.3.dmg and installed that.

3. Since I want to use VB just for myself, I don't care about backward compatibility with Leopard, so I created LocalConfig.kmk as it is indicated at http://www.virtualbox.org/wiki/Mac%20OS ... structions with this content :

Code: Select all

VBOX_DEF_MACOSX_VERSION_MIN = 10.6
VBOX_DARWIN_NO_COMPACT_LINKEDIT =
VBOX_MACOS_10_5_WORKAROUND =
I did that with TextEdit in txt mode (Is this Ok?)

4. When I did ./configure --disable-hardening, I had a message saying I didn't have the right version of openssl :

Code: Select all

Checking for ssl: found version OpenSSL 0.9.7l 28 Sep 2006, expected version 0.9.8 or higher
I checked openssl version in MacPorts and found I had 1.0.0 installed, so I figured the configure script found the Apple bundled one instead of the MacPorts one. I managed to get it to work with

Code: Select all

./configure --disable-hardening --with-openssl-dir=/opt/local
Everything was OK or enabled.

So I was ready to build. I did

Code: Select all

. ./env.sh
and

Code: Select all

kmk
It went Ok for the first 2356 lines, and then I got curl-related (or so I think) errors :

Code: Select all

kBuild: Compiling VBoxRT - /Developer/Sources/VirtualBox-3.2.8_OSE/src/VBox/Runtime/common/misc/s3.cpp
/opt/local/include/curl/curlrules.h:143: error: size of array ‘__curl_rule_01__’ is negative
/opt/local/include/curl/curlrules.h:153: error: size of array ‘__curl_rule_02__’ is negative
kmk[2]: *** [/Developer/Sources/VirtualBox-3.2.8_OSE/out/darwin.x86/release/obj/VBoxRT/common/misc/s3.o] Error 1
The failing command:
@g++-4.0 -c -O2 -g -pipe -pedantic -Wshadow -Wall -Wextra -Wno-missing-field-initializers -Wno-unused -Wno-trigraphs  -Wno-long-long -Wno-variadic-macros -O2 -mtune=generic -fno-omit-frame-pointer -fno-strict-aliasing -fvisibility=hidden -DVBOX_HAVE_VISIBILITY_HIDDEN -DRT_USE_VISIBILITY_DEFAULT -fvisibility-inlines-hidden -Werror -mmacosx-version-min=10.6 -isysroot /Developer/SDKs/MacOSX10.6.sdk -m32 -I/Developer/Sources/VirtualBox-3.2.8_OSE/src/VBox/Runtime/include -I/Developer/Sources/VirtualBox-3.2.8_OSE/src/libs/liblzf-3.4 -I/Developer/Sources/VirtualBox-3.2.8_OSE/src/libs/kStuff/kStuff/include -I/opt/local/include -I/Developer/Sources/VirtualBox-3.2.8_OSE/src/libs/libxml2-2.6.30/include -I/Developer/Sources/VirtualBox-3.2.8_OSE/src/libs/boost-1.37.0 -I/Developer/Sources/VirtualBox-3.2.8_OSE/include -I/Developer/Sources/VirtualBox-3.2.8_OSE/out/darwin.x86/release -DVBOX -DVBOX_OSE -DVBOX_WITH_64_BITS_GUESTS -DRT_OS_DARWIN -D__DARWIN__ -DRT_ARCH_X86 -D__X86__ -D_REENTRANT -DBOOST_DISABLE_ASSERTS -DBUILDING_LIBCURL -DIN_RING3 -DHC_ARCH_BITS=32 -DGC_ARCH_BITS=64 -DIN_RING3 -DHC_ARCH_BITS=32 -DGC_ARCH_BITS=64 -DIN_RT_R3 -DIN_SUP_R3 -DLDR_WITH_NATIVE -DLDR_WITH_ELF32 -DLDR_WITH_PE -DRT_WITH_VBOX -DLDR_WITH_KLDR -DRT_WITH_ICONV_CACHE -DIN_SUP_R3 -DIN_SUP_R3 -DMAC_OS_X_VERSION_MIN_REQUIRED=1060 -DMAC_OS_X_VERSION_MAX_ALLOWED=1060 -DPIC -Wp,-MD,/Developer/Sources/VirtualBox-3.2.8_OSE/out/darwin.x86/release/obj/VBoxRT/common/misc/s3.o.dep -Wp,-MT,/Developer/Sources/VirtualBox-3.2.8_OSE/out/darwin.x86/release/obj/VBoxRT/common/misc/s3.o -Wp,-MP -o /Developer/Sources/VirtualBox-3.2.8_OSE/out/darwin.x86/release/obj/VBoxRT/common/misc/s3.o /Developer/Sources/VirtualBox-3.2.8_OSE/src/VBox/Runtime/common/misc/s3.cpp
kmk[2]: *** Waiting for unfinished jobs....
kmk[2]: Leaving directory `/Developer/Sources/VirtualBox-3.2.8_OSE'
kmk[2]: Entering directory `/Developer/Sources/VirtualBox-3.2.8_OSE'
kmk[2]: *** Exiting with status 2
kmk[1]: *** [pass_dlls_this] Error 2
kmk[1]: Leaving directory `/Developer/Sources/VirtualBox-3.2.8_OSE'
kmk: *** [pass_dlls_order] Error 2
I did search the forums using the built-in search engine and Google, I also just Googled my errors and found nothing of interest. (Except maybe this http://forums.virtualbox.org/viewtopic. ... pard+build, post 5) (Is my LocalConfig.kmk file equivalent to the procedure described in this post ?)

One thing I noticed is that the configure script tells me I have version 7.16.3 of libcurl installed

Code: Select all

Checking for libcurl: found version 7.16.3, OK.
but MacPorts tells me I have curl version 7.21.1.0 installed.

Code: Select all

***:VirtualBox-3.2.8_OSE ***$ port installed curl
The following ports are currently installed:
  curl @7.21.1_0+ssl (active)
Are these the same ? Would linking to the good one resolve my problem ? If so, how do I do it ?

Any help in helping me build would be warmly welcomed.

P.S. I also got a lot of warnings during the first 2356 lines, would it be relevant to post them ? (They are mostly about things being deprecated, ex :

Code: Select all

kBuild: Compiling RuntimeR0Drv - /Developer/Sources/VirtualBox-3.2.8_OSE/src/VBox/Runtime/r0drv/darwin/assert-r0drv-darwin.cpp
/Developer/Sources/VirtualBox-3.2.8_OSE/src/VBox/Runtime/r0drv/darwin/alloc-r0drv-darwin.cpp: In function ‘void* RTMemContAlloc(RTCCPHYS*, size_t)’:
/Developer/Sources/VirtualBox-3.2.8_OSE/src/VBox/Runtime/r0drv/darwin/alloc-r0drv-darwin.cpp:84: warning: ‘IOMallocContiguous’ is deprecated (declared at /Developer/SDKs/MacOSX10.6.sdk/System/Library/Frameworks/Kernel.framework/Headers/IOKit/IOLib.h:116)
Phil6379
Posts: 8
Joined: 17. Sep 2010, 22:40
Primary OS: Mac OS X other
VBox Version: OSE self-compiled
Guest OSses: FreeBSD

Re: Errors building OSE 3.2.8 on Mac OS X 10.6 Snow Leopard

Post by Phil6379 »

Hi,
I got it to build ! I really am happy.

What I did is I upgraded all the installed ports from MacPorts to their +universal variant, as was suggested here http://forums.virtualbox.org/viewtopic. ... pard+build (post 5):
thecloud wrote:First, I made sure to add "+universal" to /opt/local/etc/macports/variants.conf, as mentioned on the http://www.virtualbox.org/wiki/Mac%20OS ... structions build instructions page. In addition, since I had installed openssl prior to setting that flag, I made sure that MacPorts rebuilt everything with the universal variant (i.e. 32-bit and 64-bit architectures) by executing this command:
sudo port upgrade --enforce-variants installed +universal
I had read that post before opening my topic (I mention it in my first post) but I was not sure if thecloud was referring to the +universal version of libidl only, since the Mac OS X build instructions page (http://www.virtualbox.org/wiki/Mac%20OS ... structions) he is himself referring to only mentions libidl, and I was not sure which page was the most recent since the build instructions page doesn't have a Last updated date.
Anyway, when I redid ./configure, source and kmk, everything went allright and it built in 15 minutes.

On to install FreeBSD...
Phil6379
Posts: 8
Joined: 17. Sep 2010, 22:40
Primary OS: Mac OS X other
VBox Version: OSE self-compiled
Guest OSses: FreeBSD

Re: Errors building OSE 3.2.8 on Mac OS X 10.6 Snow Leopard

Post by Phil6379 »

I'm still wondering about the different version numbers for curl and libcurl, though... (see 1st post)
philoertel
Posts: 1
Joined: 4. Oct 2010, 16:45
Primary OS: Mac OS X other
VBox Version: OSE self-compiled
Guest OSses: Ubuntu 10.04

Re: Errors building OSE 3.2.8 on Mac OS X 10.6 Snow Leopard

Post by philoertel »

Phil, thank you SO MUCH for posting your experiences. I've successfully installed OSE 3.2.8 on OS X 10.6 following your instructions, and my first guest os is installing as I write this.

On a hunch, I did this without rebuilding all my installed packages with the +universal variant, and I was successful. Since kmk complained about curl, I did the following:

Code: Select all

sudo port upgrade --enforce-variants curl +universal
And that was enough! Unfortunately I don't have a fresh 10.6 lying around to try. I've installed a lot of ports, and I could have some required universal package already from some other installation. In other words, YMMV.
emperorcezar
Posts: 2
Joined: 31. Aug 2011, 23:44
Primary OS: Mac OS X other
VBox Version: OSE other
Guest OSses: Linux

Re: Errors building OSE 3.2.8 on Mac OS X 10.6 Snow Leopard

Post by emperorcezar »

I'm to step 4 in the OP.

I get the error.

Code: Select all

Checking for libIDL: found version 0.8.14, OK.
Checking for ssl: 
  libcrypto not found at -I/opt/local/include /opt/local/lib/libcrypto.a /opt/local/lib/libssl.a or openssl headers not found
  Check the file /Users/cezar/vbox/configure.log for detailed error information.
My log contains:

Code: Select all

***** Checking ssl *****
compiling the following source file:
#include <cstdio>
#include <openssl/opensslv.h>
#include <openssl/ssl.h>
extern "C" int main(void)
{
  printf("found version %s", OPENSSL_VERSION_TEXT);
  SSL_library_init();
#if OPENSSL_VERSION_NUMBER >= 0x00908000
  printf(", OK.\n");
  return 0;
#else
  printf(", expected version 0.9.8 or higher\n");
  return 1;
#endif
}
using the following command line:
g++ -mmacosx-version-min=10.5 -isysroot /Developer/SDKs/MacOSX10.5.sdk -Wl,-syslibroot,/Developer/SDKs/MacOSX10.5.sdk -g -O -Wall -o /Users/cezar/vbox/.tmp_out /Users/cezar/vbox/.tmp_src.cc "-I/opt/local/include /opt/local/lib/libcrypto.a /opt/local/lib/libssl.a"
Undefined symbols:
  "_inflateEnd", referenced from:
      _bio_zlib_free in libcrypto.a(c_zlib.o)
      _zlib_stateful_finish in libcrypto.a(c_zlib.o)
  "_deflate", referenced from:
      _bio_zlib_ctrl in libcrypto.a(c_zlib.o)
      _bio_zlib_write in libcrypto.a(c_zlib.o)
      _zlib_stateful_compress_block in libcrypto.a(c_zlib.o)
  "_deflateEnd", referenced from:
      _bio_zlib_free in libcrypto.a(c_zlib.o)
      _zlib_stateful_finish in libcrypto.a(c_zlib.o)
  "_inflateInit_", referenced from:
      _bio_zlib_read in libcrypto.a(c_zlib.o)
      _zlib_stateful_init in libcrypto.a(c_zlib.o)
  "_zError", referenced from:
      _bio_zlib_ctrl in libcrypto.a(c_zlib.o)
      _bio_zlib_read in libcrypto.a(c_zlib.o)
      _bio_zlib_write in libcrypto.a(c_zlib.o)
  "_deflateInit_", referenced from:
      _bio_zlib_write in libcrypto.a(c_zlib.o)
      _zlib_stateful_init in libcrypto.a(c_zlib.o)
  "_inflate", referenced from:
      _bio_zlib_read in libcrypto.a(c_zlib.o)
      _zlib_stateful_expand_block in libcrypto.a(c_zlib.o)
ld: symbol(s) not found
I was getting architecture issues, but removed everything in macports and installed everything again from scratch. Now this.

I've spent hours on this so far. All I'm trying to do is fix a bug in VirtualBox, a one line bug. :)
emperorcezar
Posts: 2
Joined: 31. Aug 2011, 23:44
Primary OS: Mac OS X other
VBox Version: OSE other
Guest OSses: Linux

Re: Errors building OSE 3.2.8 on Mac OS X 10.6 Snow Leopard

Post by emperorcezar »

This is now a bug. I'll be filing it as soon as I figure out the process.

I had to compile openssl libraries specifically to 64bit for config to work. Then durring compile it complains that they openssl is not i386.

The compile scripts on conflicting themselves.
tarcisocomp
Posts: 1
Joined: 14. Oct 2011, 14:55
Primary OS: Ubuntu other
VBox Version: OSE other
Guest OSses: Ubuntu 11.04

Re: Errors building OSE 3.2.8 on Mac OS X 10.6 Snow Leopard

Post by tarcisocomp »

I am trying to compile VirtualBox for Mac OS X on Snow Leopard and had the same error as Phil with the wrong OpenSSL version, but when I applied the given solution, I got the same error as Cezar:

Code: Select all

Checking for ssl: 
  libcrypto not found at -I/opt/local//include /opt/local//lib/libcrypto.a /opt/local//lib/libssl.a or openssl headers not found
  Check the file /Users/Tarciso/Documents/workspace/virtualbox420/configure.log for detailed error information.
Check /Users/Tarciso/Documents/workspace/virtualbox420/configure.log for details
My log contains:

Code: Select all

***** Checking ssl *****
compiling the following source file:
#include <cstdio>
#include <openssl/opensslv.h>
#include <openssl/ssl.h>
extern "C" int main(void)
{
  printf("found version %s", OPENSSL_VERSION_TEXT);
  SSL_library_init();
#if OPENSSL_VERSION_NUMBER >= 0x00908000
  printf(", OK.\n");
  return 0;
#else
  printf(", expected version 0.9.8 or higher\n");
  return 1;
#endif
}
using the following command line:
g++ -mmacosx-version-min=10.5 -isysroot /Developer/SDKs/MacOSX10.5.sdk -Wl,-syslibroot,/Developer/SDKs/MacOSX10.5.sdk -g -O -Wall -o /Users/Tarciso/Documents/workspace/virtualbox420/.tmp_out /Users/Tarciso/Documents/workspace/virtualbox420/.tmp_src.cc "-I/opt/local//include /opt/local//lib/libcrypto.a /opt/local//lib/libssl.a"
ld: warning: _OPENSSL_ia32cap_P has different visibility (hidden) in /opt/local//lib/libcrypto.a(x86_64cpuid.o) and (default) in /opt/local//lib/libcrypto.a(cryptlib.o)
Undefined symbols:
  "_inflateEnd", referenced from:
      _bio_zlib_free in libcrypto.a(c_zlib.o)
      _zlib_stateful_finish in libcrypto.a(c_zlib.o)
  "_deflate", referenced from:
      _bio_zlib_ctrl in libcrypto.a(c_zlib.o)
      _bio_zlib_write in libcrypto.a(c_zlib.o)
      _zlib_stateful_compress_block in libcrypto.a(c_zlib.o)
  "_deflateEnd", referenced from:
      _bio_zlib_free in libcrypto.a(c_zlib.o)
      _zlib_stateful_finish in libcrypto.a(c_zlib.o)
  "_inflateInit_", referenced from:
      _bio_zlib_read in libcrypto.a(c_zlib.o)
      _zlib_stateful_init in libcrypto.a(c_zlib.o)
  "_zError", referenced from:
      _bio_zlib_ctrl in libcrypto.a(c_zlib.o)
      _bio_zlib_read in libcrypto.a(c_zlib.o)
      _bio_zlib_write in libcrypto.a(c_zlib.o)
  "_deflateInit_", referenced from:
      _bio_zlib_write in libcrypto.a(c_zlib.o)
      _zlib_stateful_init in libcrypto.a(c_zlib.o)
  "_inflate", referenced from:
      _bio_zlib_read in libcrypto.a(c_zlib.o)
      _zlib_stateful_expand_block in libcrypto.a(c_zlib.o)
ld: symbol(s) not found
collect2: ld returned 1 exit status
I've already tried deactivating and reactivating openssl, running

Code: Select all

sudo port upgrade --enforce-variants openssl +universal
and even reinstalling all ports using the +universal variant.

When I run:

Code: Select all

sudo port installed openssl
I get:

Code: Select all

The following ports are currently installed:
  openssl @1.0.0a_0
  openssl @1.0.1e_1
  openssl @1.0.1e_1+universal (active)
I already checked for the files: /opt/local/lib/libcrypto.a, /opt/local/lib/libssl.a and /opt/local/bin/openssl and they all exist, but there is no libcrypto file in /opt/local/include.

I am not very experienced at compiling Virtualbox on Mac or build scripts and I already tried everything I knew. Does someone have any idea on how to solve this?
I would really appreciate!
Post Reply