[haiku-development] Trouble building @vmware-image on Mac OS X 10.9 Mavericks

  • From: John Scipione <jscipione@xxxxxxxxx>
  • To: "haiku-development@xxxxxxxxxxxxx" <haiku-development@xxxxxxxxxxxxx>
  • Date: Mon, 28 Oct 2013 20:16:53 -0400

Hi again list,

I'm trying to troubleshoot an issue I'm having building an
@vmware-image image of Haiku on 10.9 Mavericks. AFAIK the latest rev
builds the vmware image fine on 10.8 Mountain Lion so there must be
something about 10.9 causing the issue. Haiku builds correctly, but
then has an issue creating the vmware image, well, actually it has
trouble setting the vmdk file executable.

Here's the error I'm getting:

$ jam -q @vmware-image

...

BuildHaikuImage1 /Volumes/Haiku/haiku/generated/haiku.vmdk

Creating image ...
libc++abi.dylib: terminating with uncaught exception of type
BPrivate::Storage::Exception
/Volumes/Haiku/haiku/build/scripts/build_haiku_image: line 277: 79913
Abort trap: 6           $makebootable $imageOffsetFlags "$imagePath"

export imagePath="/Volumes/Haiku/haiku/generated/haiku.vmdk"
export isImage="1"
export isVMwareImage="1"
/Volumes/Haiku/haiku/build/scripts/build_haiku_image
/Volumes/Haiku/haiku/generated/haiku.image-init-vars
/Volumes/Haiku/haiku/generated/haiku.image-make-dirs
/Volumes/Haiku/haiku/generated/haiku.image-copy-files
/Volumes/Haiku/haiku/generated/haiku.image-extract-files

...failed BuildHaikuImage1 /Volumes/Haiku/haiku/generated/haiku.vmdk ...
...removing /Volumes/Haiku/haiku/generated/haiku.vmdk

BUILD FAILURE:
...failed updating 1 target(s)...
...updated 6777 target(s)...

Here's what I've learned digging into what is causing the problem.

I get the uncaught exception error if I run the makebootable binary
directly on any file.

The reason for this, as far as I can tell is that the makebootable
binary (whose source is located in
src/bin/makebootable/platform/bios_ia32/makebootable.cpp) is calling
BResources::LoadResouce() on the makebootable executable itself in
read_boot_code_data() right around line 151.

The makebootable binary here is a Mach-O 64-bit executable so
BResources::LoadResource() has no idea how to load it, it only knows
how to read Elf and PEF binaries. This is causing BResources (well,
actually BResourceFile) to throw an exception which as you can see
from the above output is uncaught. Looking at the code in
src/kits/storage/ResourceFile.cpp everywhere an exception is called it
is surrounding try catch block.

So, the first problem here is that the BPrivate::Storage::Exception
isn't getting caught as it should. Instead of getting an uncaught
exception error I should get some sort of error message printed to
stderr. Perhaps -f-no-exceptions is getting passed to the compiler
somewhere?

The second problem of course is that it isn't setting the vmdk
bootable. I'm a little confused here because I can't imagine how this
ever worked unless I'm mistaken about the build system trying to read
in a Mach-O binary. Perhaps it is suppose to call the Haiku
makebootable binary located in
generated/objects/haiku/x86_gcc2/release/bin/makebootable/platform/bios_ia32/makebootable
instead and not the host binary?

I need to investigate a bit more what happens on 10.8 ML, but, I've
looked and the makebootable binary is a 64-bit Mach-O binary there
too.

Any help is greatly appreciated.

Other related posts: