[vbox-dev] Build issues with 4.0.12 and 4.1.2 on OSX Lion

Arend Dittmer arend at mypocketxp.com
Tue Sep 13 14:05:08 GMT 2011


Thank you Darshan and Francois for getting back to me. For the build that
fails the linker tries to link with libiconv in
/Developer/SDKs/MacOSX10.6.sdk:

Build: Linking vbox-img
Undefined symbols:
  "_libiconv", referenced from:
      rtStrConvertUncached(void const*, unsigned long, char const*, void**,
unsigned long, char const*, unsigned int)in RuntimeR3.a(utf8-posix.o)
      rtstrConvertCached(void const*, unsigned long, char const*, void**,
unsigned long, char const*, unsigned int, void**)in
RuntimeR3.a(utf8-posix.o)
  "_libiconv_close", referenced from:
      rtStrConvertUncached(void const*, unsigned long, char const*, void**,
unsigned long, char const*, unsigned int)in RuntimeR3.a(utf8-posix.o)
      rtStrConvertUncached(void const*, unsigned long, char const*, void**,
unsigned long, char const*, unsigned int)in RuntimeR3.a(utf8-posix.o)
      rtstrConvertCached(void const*, unsigned long, char const*, void**,
unsigned long, char const*, unsigned int, void**)in
RuntimeR3.a(utf8-posix.o)
      _rtStrIconvCacheDestroy in RuntimeR3.a(utf8-posix.o)
  "_libiconv_open", referenced from:
      rtStrConvertUncached(void const*, unsigned long, char const*, void**,
unsigned long, char const*, unsigned int)in RuntimeR3.a(utf8-posix.o)
      rtstrConvertCached(void const*, unsigned long, char const*, void**,
unsigned long, char const*, unsigned int, void**)in
RuntimeR3.a(utf8-posix.o)
ld: symbol(s) not found
collect2: ld returned 1 exit status
kmk: ***
[/Users/adittmer/VBOX_4.X/VirtualBox-4.0.12_OSE/out/darwin.amd64/release/obj/vbox-img/vbox-img]
Error 1
The failing command:
@g++-4.2                 -mmacosx-version-min=10.6 -Wl,-syslibroot,*
/Developer/SDKs/MacOSX10.6.sdk* -Wl,-headerpad_max_install_names   -m64   -o
/Users/adittmer/VBOX_4.X/VirtualBox-4.0.12_OSE/out/darwin.amd64/release/obj/vbox-img/vbox-img
-filelist
/Users/adittmer/VBOX_4.X/VirtualBox-4.0.12_OSE/out/darwin.amd64/release/obj/vbox-img/vbox-img.rsp

/Users/adittmer/VBOX_4.X/VirtualBox-4.0.12_OSE/out/darwin.amd64/release/lib/RuntimeR3.a
 /Users/adittmer/VBOX_4.X/VirtualBox-4.0.12_OSE/out/darwin.amd64/release/lib/VBox-liblzf.a
 -lz   -liconv
kmk: ***
[/Users/adittmer/VBOX_4.X/VirtualBox-4.0.12_OSE/out/darwin.amd64/release/obj/vbox-img/vbox-img]
Deleting file
`/Users/adittmer/VBOX_4.X/VirtualBox-4.0.12_OSE/out/darwin.amd64/release/obj/vbox-img/vbox-img.rsp'

If I manually run the command in the same directory and force linking with
the macports libiconv it actually builds. The macports library is universal:

SanRafael:VirtualBox-4.0.12_OSE adittmer$ file /opt/local/lib/libiconv.dylib
/opt/local/lib/libiconv.dylib: Mach-O universal binary with 2 architectures
/opt/local/lib/libiconv.dylib (for architecture i386): Mach-O dynamically
linked shared library i386
/opt/local/lib/libiconv.dylib (for architecture x86_64): Mach-O 64-bit
dynamically linked shared library x86_64

The issue is that libiconv in /Developer/SDKs/MacOSX10.6.sdk* *does not have
the _libiconv symbol (and the other symbols that are missing which are
_libiconv_open and _libiconv_close) for 64-bit:

SanRafael:VirtualBox-4.0.12_OSE adittmer$ nm -a -arch x86_64
/Developer/SDKs/MacOSX10.6.sdk/usr/lib/libiconv.dylib | grep libiconv
00000000000fa760 D __libiconv_version
00000000000159a4 T _libiconv_relocate
000000000001599a T _libiconv_set_relocation_prefix
SanRafael:VirtualBox-4.0.12_OSE adittmer$ nm -a -arch i386
/Developer/SDKs/MacOSX10.6.sdk/usr/lib/libiconv.dylib | grep libiconv
000f5be0 D __libiconv_version
000086af T _libiconv
0000fd7a T _libiconv_close
000158d8 T _libiconv_open
00015dae T _libiconv_relocate
00015d9f T _libiconv_set_relocation_prefix
00008bd9 T _libiconvctl
00008847 T _libiconvlist

I configured with:

./configure --with-openssl-dir=/opt/local --disable-python --disable-java
--disable-docs --target-arch=amd64

and my LocalConfig.kmk looks like this:

VBOX_DEF_MACOSX_VERSION_MIN = 10.6
VBOX_DARWIN_NO_COMPACT_LINKEDIT =
VBOX_MACOS_10_5_WORKAROUND =

Thanks again

Arend


On Tue, Sep 13, 2011 at 1:14 AM, François Revol <revol at free.fr> wrote:

> Le 13/09/2011 09:18, K M Darshan a écrit :
> > I built it on my Mac 64 bit lion os.. I am not seeing those warnings..
> > Am I missing anything.. Please could you give me the command line
> params you built it with..
> >
>
> Did you install the libiconv from MacPorts by chance ?
>
> If so try to rebuild it as universal variant.
> I recall having some issues with libs from MacPorts when not installed
> as universal binary.
>
> François.
>



-- 
Arend Dittmer
TheMicroComputer
Phone: 415 497 7797
e-mail: arend at mypocketxp.com
http://www.mypocketxp.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.virtualbox.org/pipermail/vbox-dev/attachments/20110913/f33c1a76/attachment.html>


More information about the vbox-dev mailing list