Opened 12 years ago

Closed 12 years ago

Last modified 11 years ago

#36910 closed defect (fixed)

Virtualbox @4.2.4 +vde2+vnc won't start VMs

Reported by: anddam (Andrea D'Amore) Owned by: macports-tickets@…
Priority: Normal Milestone:
Component: ports Version: 2.1.2
Keywords: Cc: royliu@…, vincent+macports@…, mallman (Michael Allman), cooljeanius (Eric Gallager)
Port: virtualbox

Description

After upgrading port virtualbox to @4.2.4 it cannot start any VM on my 10.7 system with XCode 4.5.1, trying to do so shows a dialog containing the following error:

Failed to open a session for the virtual machine Arch.

Failed to load VMMR0.r0 (VERR_GENERAL_FAILURE).

Result Code: NS_ERROR_FAILURE (0x80004005)
Component: Console
Interface: IConsole {db7ab4ca-2a3f-4183-9243-c1208da92392}

The error happens at an early stage of the VM starting and it's not dependent on the guest OS. The launchd item and kexts have been correctly unloaded and reloaded.

Switching back to @4.2.2 reverts the behavior to a correct start of the VMs.

I'd like to get feedback from VBox's users to check if this issue is related to system or Xcode version.

Change History (36)

comment:1 Changed 12 years ago by pixilla (Bradley Giesbrecht)

Is there anything interesting in system.log?

Are all the libraries virtualbox links to +universal?

comment:2 Changed 12 years ago by royliu@…

I am getting the same problem, and submitted a request for help here.

http://permalink.gmane.org/gmane.comp.emulators.virtualbox.devel/5515

No response so far.

comment:3 in reply to:  2 Changed 12 years ago by vincent+macports@…

I have the same issue with all current versions of VirtualBox (4.1.22, 4.2.4, version from svn).

System: 10.7.5, XCode 4.5.2. The interesting entry in the log file is:

00:00:01.581 pdmR3LoadR0U: pszName="VMMR0.r0" rc=VERR_GENERAL_FAILURE szErr="supLoadModule returned VERR_GENERAL_FAILURE"
00:00:01.581 VMSetError: XXX/VBox/VMM/VMMR3/VM.cpp(591) int vmR3CreateU(UVM*, uint32_t, int (*)(VM*, void*), void*); rc=VERR_GENERAL_FAILURE
00:00:01.595 VMSetError: Failed to load VMMR0.r0
00:00:01.595 ERROR [COM]: aRC=NS_ERROR_FAILURE (0x80004005) aIID={1968b7d3-e3bf-4ceb-99e0-cb7c913317bb} aComponent={Console} aText={Failed to load VMMR0.r0 (VERR_GENERAL_FAILURE)}, preserve=false
00:00:01.627 Power up failed (vrc=VERR_GENERAL_FAILURE, rc=NS_ERROR_FAILURE (0X80004005))
Last edited 12 years ago by vincent+macports@… (previous) (diff)

comment:4 Changed 12 years ago by vincent+macports@…

Cc: vincent+macports@… added

Cc Me!

comment:5 Changed 12 years ago by royliu@…

What is the last working version?

comment:6 in reply to:  5 ; Changed 12 years ago by anddam (Andrea D'Amore)

Replying to royliu@…:

What is the last working version?

For me it's @4.2.2_0+vde2+vnc.

comment:7 Changed 12 years ago by vincent+macports@…

The problem is, I can't even reproduce what MacPorts is doing:

Step 1) unpack
Step 2) patch -p0 < ../patch-build.diff (and all the others)
Step 3) manually adjust LocalConfig.kmk: a) VBOX_DEF_MACOSX_VERSION_MIN = 10.7 b) set VBOX_PATH_APP_* = "/Applications/MacPorts/VirtualBox.app/..."
Step 4) Now, I would start using ./configure, . ./env.sh, kmk
Which ./configure line is supposed to be correct, assuming a working MacPorts installation?

If I use:

./configure --with-qt-dir=/opt/local --with-openssl-dir=/opt/local--with-gcc=/opt/local/bin/gcc-apple-4.2 --with-g++=/opt/local/bin/g++-apple-4.2 --disable-hardening --target-arch=amd64 --enable-vde

Compilation stops during linking, complaining that symbols for iconv cannot be found (see https://www.virtualbox.org/pipermail/vbox-dev/2011-September/004546.html):

If I use:

./configure --with-qt-dir=/opt/local --with-gcc=/opt/local/bin/gcc-apple-4.2 --with-g++=/opt/local/bin/g++-apple-4.2 --disable-hardening --target-arch=amd64 --enable-vde

Lion's OpenSSL is used that makes use of deprecated functions. Later on, compilation fails.

If I use:

./configure --with-qt-dir=/opt/local --with-openssl-dir=/usr/local/ssl--with-gcc=/opt/local/bin/gcc-apple-4.2 --with-g++=/opt/local/bin/g++-apple-4.2 --disable-hardening --target-arch=amd64 --enable-vde

I receive the error outlined above (I'm using a current OpenSSL lib (default options) installed into /usr/local/ssl), but no complaints about libpng.

If I use:

./configure --with-qt-dir=/opt/local --with-openssl-dir=/opt/local --with-gcc=/opt/local/bin/gcc-apple-4.2 --with-g++=/opt/local/bin/g++-apple-4.2 --disable-hardening --target-arch=amd64 --enable-vde --enable-vnc

The configuration fails, as the libs for libvncserver cannot be found.

I would assume that due to the way how VirtualBox handles some flags (e.g., setting for OpenSSL modifies directory for libpng as well) that a version conflict exists between libraries of the system and MacPorts which then may produce the above error.

I very much appreciate your help and would like to know if any of the above configure lines are supposed to be correct.

comment:8 in reply to:  7 Changed 12 years ago by anddam (Andrea D'Amore)

Replying to vincent+macports@…:

The problem is, I can't even reproduce what MacPorts is doing: […] Which ./configure line is supposed to be correct, assuming a working MacPorts installation?

Are you actually using MacPorts to build? If so you can check the log by either using -d option or log action or opening the file in logs directory. For the last two you may want to use -k if you are running a target that automatically cleans builds, e.g. install.

These are the configure and build commands I get on my 10.7 system with Xcode 4.5.2 and trunk macports:

--->  Configuring virtualbox
DEBUG: Using compiler 'MacPorts Apple gcc 4.2'
DEBUG: Executing org.macports.configure (virtualbox)
DEBUG: Environment: CPATH='/opt/local/include' CFLAGS='-pipe -O2 -arch x86_64' CPPFLAGS='-I/opt/local/include' CXXFLAGS='-pipe -O2 -arch x86_64' LIBRARY_PATH='/opt/local/lib' MACOSX_
DEPLOYMENT_TARGET='10.7' PKG_CONFIG_PATH='/opt/local/lib/pkgconfig' CXX='/opt/local/bin/g++-apple-4.2' CC_PRINT_OPTIONS_FILE='/opt/local/var/macports/build/_opt_local_var_macports_so
urces_svn.macports.org_trunk_dports_emulators_virtualbox/virtualbox/work/.CC_PRINT_OPTIONS' F90FLAGS='-pipe -O2 -m64' LDFLAGS='-L/opt/local/lib -arch x86_64' FCFLAGS='-pipe -O2 -m64'
 OBJC='/opt/local/bin/gcc-apple-4.2' INSTALL='/usr/bin/install -c' MOC='/opt/local/bin/moc' QMAKESPEC='macx-g++' FFLAGS='-pipe -O2 -m64' OBJCFLAGS='-pipe -O2 -arch x86_64' QTDIR='/op
t/local' CC_PRINT_OPTIONS='YES' CC='/opt/local/bin/gcc-apple-4.2' QMAKE='/opt/local/bin/qmake'
DEBUG: Assembled command: 'cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_svn.macports.org_trunk_dports_emulators_virtualbox/virtualbox/work/VirtualBox-4.2.4" && .
/configure --with-qt-dir=/opt/local --with-openssl-dir=/opt/local --with-gcc=/opt/local/bin/gcc-apple-4.2 --with-g++=/opt/local/bin/g++-apple-4.2 --enable-vde --enable-vnc'
DEBUG: Executing command line:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_svn.macports.org_trunk_dports_emulators_virtualbox/virtualbox/work/VirtualBox-4.2.4"
 && ./configure --with-qt-dir=/opt/local --with-openssl-dir=/opt/local --with-gcc=/opt/local/bin/gcc-apple-4.2 --with-g++=/opt/local/bin/g++-apple-4.2 --enable-vde --enable-vnc
--->  Building virtualbox
DEBUG: Executing proc-pre-org.macports.build-build-0
DEBUG: Executing org.macports.build (virtualbox)
DEBUG: Environment: CPATH='/opt/local/include' CC_PRINT_OPTIONS_FILE='/opt/local/var/macports/build/_opt_local_var_macports_sources_svn.macports.org_trunk_dports_emulators_virtualbox/virtualbox/work/.CC_PRINT_OPTIONS' QTDIR='/opt/local' LIBRARY_PATH='/opt/local/lib' CC_PRINT_OPTIONS='YES' MACOSX_DEPLOYMENT_TARGET='10.7' VERBOSE='1' QMAKESPEC='macx-g++' MOC='/opt/local/bin/moc' QMAKE='/opt/local/bin/qmake'
DEBUG: Assembled command: 'cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_svn.macports.org_trunk_dports_emulators_virtualbox/virtualbox/work/VirtualBox-4.2.4" && . env.sh && kmk all KBUILD_VERBOSE=full'
DEBUG: Executing command line:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_svn.macports.org_trunk_dports_emulators_virtualbox/virtualbox/work/VirtualBox-4.2.4" && . env.sh && kmk all KBUILD_VERBOSE=full

comment:9 in reply to:  6 ; Changed 12 years ago by royliu@…

That's funny. I thought so too until I downgraded, rebuilt, and everything continued to be broken. Would you be so kind as to make sure that all of your dependencies are up to date and do a similar downgrade/rebuild of 4.2.2? The regression could be the result of a change in some dependency.

Replying to and.damore@…:

Replying to royliu@…:

What is the last working version?

For me it's @4.2.2_0+vde2+vnc.

comment:10 in reply to:  9 Changed 12 years ago by anddam (Andrea D'Amore)

Replying to royliu@…:

That's funny. I thought so too until I downgraded, rebuilt, and everything continued to be broken. Would you be so kind as to make sure that all of your dependencies are up to date and do a similar downgrade/rebuild of 4.2.2? The regression could be the result of a change in some dependency.

You're correct, when rebuilding from source I can still reproduce the error.

So we're aiming at some dependencies update that happened between r99021, the revision when I built 4.2.2, and r99468, that was committed at the time in which this ticket was open.

edit Here's the list of changed rdeps in the suggested window:

apple-gcc42
cctools
cctools-headers
curl
ld64
libpng
m4
qt4-mac
tiff

I'll try reverting apple-gcc42 cctools* and ld64 and then rebuilding vbox.

Last edited 12 years ago by anddam (Andrea D'Amore) (previous) (diff)

comment:11 in reply to:  9 ; Changed 12 years ago by anddam (Andrea D'Amore)

Replying to royliu@…:

The regression could be the result of a change in some dependency.

Bingo, I got a working Virtualbox 4.2.4 reverting apple-gcc42 (its changes didn't trigger a rebuild so there's just a single image for it), cctools* and ld64 to r99021. Here's my current setup

> port -q installed virtualbox apple-gcc42 cctools cctools-headers ld64
  apple-gcc42 @5666.3_9 (active)
  cctools @829_2+llvm31 (active)
  cctools @836_0+llvm31
  cctools-headers @829_0 (active)
  cctools-headers @836_0
  ld64 @133.3_4+llvm30 (active)
  ld64 @134.9_0+llvm30
  virtualbox @4.2.4_0+vde2+vnc (active)

Now we need to track the exact culprit, the dependency chain is apple-gcc42 > cctools > ld64 > cctools-headers.

Last edited 12 years ago by anddam (Andrea D'Amore) (previous) (diff)

comment:12 in reply to:  11 ; Changed 12 years ago by royliu@…

Just to be clear, does this mean the problem has to be in one of cctools, cctools-headers, ld64? apple-gcc42 didn't seem to change.

Replying to and.damore@…:

Replying to royliu@…:

The regression could be the result of a change in some dependency.

Bingo, I got a working Virtualbox 4.2.4 reverting apple-gcc42 (its changes didn't trigger a rebuild so there's just a single image for it), cctools* and ld64 to r99021. Here's my current setup

> port -q installed virtualbox apple-gcc42 cctools cctools-headers ld64
  apple-gcc42 @5666.3_9 (active)
  cctools @829_2+llvm31 (active)
  cctools @836_0+llvm31
  cctools-headers @829_0 (active)
  cctools-headers @836_0
  ld64 @133.3_4+llvm30 (active)
  ld64 @134.9_0+llvm30
  virtualbox @4.2.4_0+vde2+vnc (active)

Now we need to track the exact culprit, the dependency chain is apple-gcc42 > cctools > ld64 > cctools-headers.

comment:13 in reply to:  12 Changed 12 years ago by anddam (Andrea D'Amore)

Replying to royliu@…:

Just to be clear, does this mean the problem has to be in one of cctools, cctools-headers, ld64? apple-gcc42 didn't seem to change.

Yes the problem is on of those ports. Specifically it's been introduced with changeset:99185, I can obtain a working virtualbox from an updated dports tree by reverting devel/cctools devel/cctools-headers and devel/ld64 to r99184 and I can obtain a broken virtualbox by then updating those three ports at r99185.

Since apple-gcc42 is built using cctools > ld64 > cctools-headers I rebuilt apple-gcc42 as well on each test run in order to have a clean room test.

Have a try with

sudo port unload virtualbox
sudo port -f uninstall virtualbox-guest-additions virtualbox-extension-pack virtualbox apple-gcc42 cctools ld64 cctools-headers
cd /opt/local/var/macports/sources/svn.macports.org/trunk/dports
svn up
svn up -r 99184 devel/cctools devel/ld64 devel/cctools-headers
sudo port -s install cctools-headers ld64 cctools apple-gcc42 virtualbox

That's roughly the script I've been using for test, edit your paths and variants accordingly.

comment:14 Changed 12 years ago by jeremyhu (Jeremy Huddleston Sequoia)

Please narrow this down to determine if the issue is from ld64 or cctools. I think deactivating the old version, activating the new one, and using 'port install virtualbox' instead of 'port upgrade virtualbox' will handle that.

Additionally, please check if the issue exists with just our version of that port or if the issue exists in XCode 4.5.1 as well. You can force apple-gcc42 to use XCode 4.5.1's linker by changing this symlink:

/opt/local/libexec/apple-gcc42/gcc/i686-apple-darwin12/4.2.1/ld

By default, that symlink points to ld provided by the ld64 port, but try removing it and replacing it with a link to /usr/bin/ld (make sure you have the latest version of Developer Tool's Command Line Tools installed or you may have the XCode 4.4 version despite having XCode 4.5 installed). You can similarly force XCode 4.5.1's assembler by modifying the as symlink instead of the ld symlink.

comment:15 in reply to:  14 Changed 12 years ago by anddam (Andrea D'Amore)

Replying to jeremyhu@…:

Please narrow this down to determine if the issue is from ld64 or cctools.

I just made a few tests:

  • cctools, ld64, cctools-headers at r99184 yields a working virtualbox
  • cctools at HEAD, ld64 and cctools-headers at r99184 yields a working virtualbox
  • cctools and ld64 at HEAD, cctools-headers at r99184 yields a broken virtualbox
  • cctools and cctools-headers at HEAD and ld64 at 99184 yields a working virtualbox

I'd say the culprit is ld64.

I think deactivating the old version, activating the new one, and using 'port install virtualbox' instead of 'port upgrade virtualbox' will handle that.

Since I guessed ld was using in building apple-gcc42 I went safe and rebuilt the virtualbox as well in the script, I was doing other stuff and giving a look at the results every now and then.

Additionally, please check if the issue exists with just our version of that port or if the issue exists in XCode 4.5.1 as well.

You can force apple-gcc42 to use XCode 4.5.1's linker by changing this symlink:

/opt/local/libexec/apple-gcc42/gcc/i686-apple-darwin12/4.2.1/ld

I wasn't getting this, then I read your email and now I do.

By default, that symlink points to ld provided by the ld64 port, but try removing it and replacing it with a link to /usr/bin/ld (make sure you have the latest version of Developer Tool's Command Line Tools installed or you may have the XCode 4.4 version despite having XCode 4.5 installed). You can similarly force XCode 4.5.1's assembler by modifying the as symlink instead of the ld symlink.

Will do the test, I'm on 4.5.2 but have to check if I have the related command line tool version, AFAIR when I updated those weren't available still.

Last edited 12 years ago by anddam (Andrea D'Amore) (previous) (diff)

comment:16 Changed 12 years ago by anddam (Andrea D'Amore)

Jeremy: after updating all ports' directories to HEAD, I uninstalled ld64 and cctools-headers that in last test were at 99184, installed those at HEAD, renamed /opt/local/bin/ld and symlinked it to the one provided by Xcode 4.5.1 command line tools.

At this point I had an updated set of ports with the active ld being the one provided by Xcode, but cctools, apple-gcc42 and virtualbox had been built with ld from r99184 so I rebuilt them in order.

Here's output of /usr/bin/ld/:

/o/l/bin> /usr/bin/ld -v
@(#)PROGRAM:ld  PROJECT:ld64-134.9
configured to support archs: armv6 armv7 armv7s i386 x86_64
LTO support using: LLVM version 3.1svn, from Apple Clang 4.1 (build 421.11.66)

The resulting virtualbox port doesn't work giving the same error as this ticket's description reports. Hope this helps answering your question about the two different scenarios, I guess the next test should be installing Xcode 4.4 command line tools and try again to see if the bug has to be reported upstream to Apple. Unluckily I need to use vbox so for now I'm just reverting ld64 and lock it that way in my local repo as this is kinda time consuming.

Last edited 12 years ago by anddam (Andrea D'Amore) (previous) (diff)

comment:17 Changed 12 years ago by royliu@…

Jeremy: Any success with getting VirtualBox to build with Xcode 4.5.2?

comment:18 Changed 12 years ago by royliu@…

Fixed in r101907.

comment:19 in reply to:  18 ; Changed 12 years ago by anddam (Andrea D'Amore)

Replying to royliu@…:

Fixed in r101907.

Thanks.

I'm curious about how you spotted the difference between LLVMGCC42MACHO_LD and LLVMGCCMACHO though.

comment:20 in reply to:  19 Changed 12 years ago by royliu@…

I didn't. I asked for help on the VirtualBox mailing list and a scarily competent Oracle dev responded.

https://www.virtualbox.org/pipermail/vbox-dev/2013-January/005600.html

Replying to and.damore@…:

Replying to royliu@…:

Fixed in r101907.

Thanks.

I'm curious about how you spotted the difference between LLVMGCC42MACHO_LD and LLVMGCCMACHO though.

comment:21 Changed 12 years ago by anddam (Andrea D'Amore)

Resolution: fixed
Status: newclosed

Confirmed working, closing ticket.

comment:22 Changed 12 years ago by mallman (Michael Allman)

I just installed virtualbox @4.2.6_0+vde2+vnc for the first time, and I'm getting this error when I try to launch a VM. Can this ticket be re-opened? Any logs/info you'd like me to post that can help debug this issue? I don't see any errors in the kernel log. I'm running 10.7.5 with Xcode 4.6 and up-to-date command line tools.

comment:23 in reply to:  22 ; Changed 12 years ago by anddam (Andrea D'Amore)

Resolution: fixed
Status: closedreopened

I bumped Virtualbox revision in r102962 since that was missing in 101907.

Replying to msa@…:

I just installed virtualbox @4.2.6_0+vde2+vnc for the first time, and I'm getting this error when I try to launch a VM. Can this ticket be re-opened? Any logs/info you'd like me to post that can help debug this issue? I don't see any errors in the kernel log. I'm running 10.7.5 with Xcode 4.6 and up-to-date command line tools.

I'm on 10.7.5 with Xcode 4.5 and vbox works just fine.

When did you last sync the ports tree?

What's the output of

port installed virtualbox ld64

?

comment:24 in reply to:  23 Changed 12 years ago by mallman (Michael Allman)

Replying to and.damore@…:

I bumped Virtualbox revision in r102962 since that was missing in 101907.

Replying to msa@…:

I just installed virtualbox @4.2.6_0+vde2+vnc for the first time, and I'm getting this error when I try to launch a VM. Can this ticket be re-opened? Any logs/info you'd like me to post that can help debug this issue? I don't see any errors in the kernel log. I'm running 10.7.5 with Xcode 4.6 and up-to-date command line tools.

I'm on 10.7.5 with Xcode 4.5 and vbox works just fine.

When did you last sync the ports tree?

I synced it a couple days ago---right before building virtualbox. I just resynced and rebuilt virtualbox. Same problem.

What's the output of

port installed virtualbox ld64

?

  ld64 @134.9_1+llvm31 (active)
  virtualbox @4.2.6_1+vde2+vnc (active)

comment:25 Changed 12 years ago by mallman (Michael Allman)

Cc: msa@… added

Cc Me!

comment:26 in reply to:  22 ; Changed 12 years ago by anddam (Andrea D'Amore)

Replying to msa@…:

I just installed virtualbox @4.2.6_0+vde2+vnc for the first time, and I'm getting this error when I try to launch a VM. Can this ticket be re-opened? Any logs/info you'd like me to post that can help debug this issue? I don't see any errors in the kernel log. I'm running 10.7.5 with Xcode 4.6 and up-to-date command line tools.

I've updated XCode to 4.6 and installed the new CLI tools, I rebuilt ld64 and virtualbox* ports and I'm able to run VMs.

me@biboop ~> port installed name:virtualbox ld64
The following ports are currently installed:
  ld64 @134.9_1+llvm31 (active)
  virtualbox @4.2.6_1+vde2+vnc (active)
  virtualbox-extension-pack @4.2.6-82870_1 (active)
  virtualbox-guest-additions @4.2.6_1 (active) 

So, sadly, I cannot reproduce.

I suggest you to post your issue on the Oracle's dev mailing list, as royliu did.

comment:27 in reply to:  26 ; Changed 12 years ago by mallman (Michael Allman)

Replying to and.damore@…:

I've updated XCode to 4.6 and installed the new CLI tools, I rebuilt ld64 and virtualbox* ports and I'm able to run VMs.

me@biboop ~> port installed name:virtualbox ld64
The following ports are currently installed:
  ld64 @134.9_1+llvm31 (active)
  virtualbox @4.2.6_1+vde2+vnc (active)
  virtualbox-extension-pack @4.2.6-82870_1 (active)
  virtualbox-guest-additions @4.2.6_1 (active) 

I just uninstalled ld64, llvm, cctools and all of my macports gcc compilers and reinstalled virtualbox. It still doesn't work, but one relevant fact I noticed is that when I ran "sudo port install name:virtualbox" macports didn't reinstall ld64 or any build tools. Indeed,

$ port deps virtualbox
Full Name: virtualbox @4.2.6_1+vde2+vnc
Build Dependencies:   pkgconfig
Library Dependencies: qt4-mac, curl, libidl, libxml2, libxslt, openssl, libsdl,
                      vde2, LibVNCServer
$ port installed ld64 apple-gcc42 llvm-3.1 llvm-3.2
None of the specified ports are installed.

Which build tools is the virtualbox port supposed to use?

comment:28 in reply to:  27 ; Changed 12 years ago by anddam (Andrea D'Amore)

Replying to msa@…:

I just uninstalled ld64, llvm, cctools and all of my macports gcc compilers and reinstalled virtualbox. It still doesn't work, but one relevant fact I noticed is that when I ran "sudo port install name:virtualbox" macports didn't reinstall ld64 or any build tools. Indeed,

$ port deps virtualbox
Full Name: virtualbox @4.2.6_1+vde2+vnc
Build Dependencies:   pkgconfig
Library Dependencies: qt4-mac, curl, libidl, libxml2, libxslt, openssl, libsdl,
                      vde2, LibVNCServer
$ port installed ld64 apple-gcc42 llvm-3.1 llvm-3.2
None of the specified ports are installed.

Which build tools is the virtualbox port supposed to use?

My output is:

me@biboop ~> port deps virtualbox
Full Name: virtualbox @4.2.6_1+vde2+vnc
Build Dependencies:   pkgconfig, apple-gcc42
Library Dependencies: qt4-mac, curl, libidl, libxml2, libxslt, openssl, libsdl, vde2, LibVNCServer
me@biboop ~>

Your output means you actually have an executable file at /Applications/Xcode.app/Contents/Developer/usr/bin/gcc-4.2, see the Portfile. Maybe it's legacy, I'm not sure why you have that file. If you have still the Xcode image (i.e. the dmg not from App Store) and you want to get rid of it you wipe off Xcode.app and reinstall Xcode + CLI tools.

edit: this will most likely pull in apple-gcc42 and ld64, so you should get a working build.

Last edited 12 years ago by anddam (Andrea D'Amore) (previous) (diff)

comment:29 in reply to:  28 ; Changed 12 years ago by mallman (Michael Allman)

Replying to and.damore@…:

Replying to msa@…:

I just uninstalled ld64, llvm, cctools and all of my macports gcc compilers and reinstalled virtualbox. It still doesn't work, but one relevant fact I noticed is that when I ran "sudo port install name:virtualbox" macports didn't reinstall ld64 or any build tools. Indeed,

$ port deps virtualbox
Full Name: virtualbox @4.2.6_1+vde2+vnc
Build Dependencies:   pkgconfig
Library Dependencies: qt4-mac, curl, libidl, libxml2, libxslt, openssl, libsdl,
                      vde2, LibVNCServer
$ port installed ld64 apple-gcc42 llvm-3.1 llvm-3.2
None of the specified ports are installed.

Which build tools is the virtualbox port supposed to use?

My output is:

me@biboop ~> port deps virtualbox
Full Name: virtualbox @4.2.6_1+vde2+vnc
Build Dependencies:   pkgconfig, apple-gcc42
Library Dependencies: qt4-mac, curl, libidl, libxml2, libxslt, openssl, libsdl, vde2, LibVNCServer
me@biboop ~>

Your output means you actually have an executable file at /Applications/Xcode.app/Contents/Developer/usr/bin/gcc-4.2, see the Portfile.

I don't have /Applications/Xcode.app/Contents/Developer/usr/bin/gcc-4.2. I do have /Applications/Xcode.app/Contents/Developer/usr/bin/gcc, though.

$ /Applications/Xcode.app/Contents/Developer/usr/bin/gcc-4.2
-bash: /Applications/Xcode.app/Contents/Developer/usr/bin/gcc-4.2: No such file or directory
$ /Applications/Xcode.app/Contents/Developer/usr/bin/gcc
i686-apple-darwin11-llvm-gcc-4.2: no input files

It seems the virtualbox port assumes that if the configured compiler is available, then it's not the llvm compiler and it's safe to use. That assumption seems faulty. Perhaps it should just require and use the apple-gcc42 port unconditionally?

Maybe it's legacy, I'm not sure why you have that file. If you have still the Xcode image (i.e. the dmg not from App Store) and you want to get rid of it you wipe off Xcode.app and reinstall Xcode + CLI tools.

Not sure which you mean here. Delete and install Xcode from the dmg or from the App Store? I like using the latter because I get updates that way.

edit: this will most likely pull in apple-gcc42 and ld64, so you should get a working build.

I'll try deleting and reinstalling Xcode tomorrow. Thanks for your help.

comment:30 in reply to:  29 ; Changed 12 years ago by anddam (Andrea D'Amore)

Replying to msa@…:

I don't have /Applications/Xcode.app/Contents/Developer/usr/bin/gcc-4.2. I do have /Applications/Xcode.app/Contents/Developer/usr/bin/gcc, though.

I assumed you had the same setup I have. Out of curiosity and before uninstalling anything please run

cd $(port dir virtualbox)

assuming you're using bash, changethe subshell command accordingly to your shell, then edit the Portfile with your favorite editor and add the following line outside any block, for instance at line 68

    ui_msg "configure.cc:${configure.cc}"

then save the file and run port lint virtualbox, this should print out the value of configure.cc, I'm curious about why mp isn't depending on apple-gcc42 in your case.

comment:31 in reply to:  30 ; Changed 12 years ago by mallman (Michael Allman)

Replying to and.damore@…:

Replying to msa@…:

I don't have /Applications/Xcode.app/Contents/Developer/usr/bin/gcc-4.2. I do have /Applications/Xcode.app/Contents/Developer/usr/bin/gcc, though.

I assumed you had the same setup I have. Out of curiosity and before uninstalling anything please run

cd $(port dir virtualbox)

assuming you're using bash, changethe subshell command accordingly to your shell, then edit the Portfile with your favorite editor and add the following line outside any block, for instance at line 68

    ui_msg "configure.cc:${configure.cc}"

then save the file and run port lint virtualbox, this should print out the value of configure.cc, I'm curious about why mp isn't depending on apple-gcc42 in your case.

$ port lint virtualbox
configure.cc:/usr/bin/gcc-4.2
--->  Verifying Portfile for virtualbox
--->  0 errors and 0 warnings found.
$ ls -l /usr/bin/gcc-4.2 
-rwxr-xr-x  1 root  wheel  113024 May 15  2011 /usr/bin/gcc-4.2
$ /usr/bin/gcc-4.2 
i686-apple-darwin11-gcc-4.2.1: no input files

comment:32 in reply to:  31 ; Changed 12 years ago by anddam (Andrea D'Amore)

Replying to msa@…:

$ port lint virtualbox
configure.cc:/usr/bin/gcc-4.2
--->  Verifying Portfile for virtualbox
--->  0 errors and 0 warnings found.
$ ls -l /usr/bin/gcc-4.2 
-rwxr-xr-x  1 root  wheel  113024 May 15  2011 /usr/bin/gcc-4.2
$ /usr/bin/gcc-4.2 
i686-apple-darwin11-gcc-4.2.1: no input files

That sounds legacy, please run

xcode-select -print-path

and paste the output here.

comment:33 in reply to:  32 Changed 12 years ago by mallman (Michael Allman)

Replying to and.damore@…:

Replying to msa@…:

$ port lint virtualbox
configure.cc:/usr/bin/gcc-4.2
--->  Verifying Portfile for virtualbox
--->  0 errors and 0 warnings found.
$ ls -l /usr/bin/gcc-4.2 
-rwxr-xr-x  1 root  wheel  113024 May 15  2011 /usr/bin/gcc-4.2
$ /usr/bin/gcc-4.2 
i686-apple-darwin11-gcc-4.2.1: no input files

That sounds legacy, please run

xcode-select -print-path

and paste the output here.

$ xcode-select -print-path
/Applications/Xcode.app/Contents/Developer

comment:34 Changed 12 years ago by mallman (Michael Allman)

I scrubbed my system of legacy Xcode dust bunnies and reinstalled Xcode. Then I cleaned and reinstalled virtualbox. It was built against apple-gcc42 and my VM starts successfully. So the problem in my case was legacy Xcode binaries.

Thanks and.damore for your help. I wouldn't have figured this out without it. Should we (re-)close this issue?

Cheers.

comment:35 Changed 12 years ago by anddam (Andrea D'Amore)

Resolution: fixed
Status: reopenedclosed

comment:36 Changed 11 years ago by cooljeanius (Eric Gallager)

Cc: egall@… added

Cc Me!

Note: See TracTickets for help on using tickets.