# emulators/virtualbox-ose build failure



## amnixed (Jun 6, 2015)

Hello,

Trying to upgrade emulators/virtualbox-ose but building virtualbox-ose-4.3.28 fails with "(bad C++ code)".

I have posted the build log at http://pastebin.com/zkAhyPK6

This is a FreeBSD 9.3-STABLE #0 r281654 amd64 system.

Would you please advise?


----------



## junovitch@ (Jun 7, 2015)

According to Portsmon there are no build failures right now with 4.3.28.  See http://portsmon.freebsd.org/portoverview.py?category=emulators&portname=virtualbox-ose for details.  Looking at the description of issues, I don't see any that look like they are for "bad C++ code".  Are you using any specific port options by any chance?


----------



## amnixed (Jun 7, 2015)

Thanks for your reply. Here is the configuration:


```
# make showconfig
===> The following configuration options are available for virtualbox-ose-4.3.28:
  DBUS=on: D-Bus IPC system support
  DEBUG=off: Debug symbols, additional logs and assertions
  GUESTADDITIONS=on: Build with Guest Additions
  MANUAL=off: Build with user manual
  NLS=on: Native Language Support
  PULSEAUDIO=off: PulseAudio sound server support
  PYTHON=on: Python bindings or support
  QT4=on: Build with QT4 Frontend
  UDPTUNNEL=on: Build with UDP tunnel support
  VDE=off: Build with VDE support
  VNC=on: Build with VNC support
  VPX=off: Use vpx for video capturing
  WEBSERVICE=on: Build Webservice
  X11=on: X11 (graphics) support
===> Use 'make config' to modify these settings
```


----------



## protocelt (Jun 7, 2015)

Looks like you're using gcc(1) from base to compile the port which is quite old now. If you're not using clang(1) maybe try installing lang/gcc from ports and then try again.


----------



## amnixed (Jun 7, 2015)

I have both lang/gcc and lang/clang33 installed.

Is lang/gcc or lang/clang33 preferred? How do I force the port to use either one?


----------



## protocelt (Jun 7, 2015)

amnixed said:


> I have both lang/gcc and lang/clang33 installed.
> 
> Is lang/gcc or lang/clang33 preferred? How do I force the port to use either one?


I'm not on a FreeBSD box to check right now however I believe emulators/virtualbox-ose requires GCC to build. I would try the following:

Add DEAULT_VERSIONS= gcc=4.8 in your /etc/make.conf file.
Rebuild devel/kBuild
Rebuild/update emulators/virtualbox-ose


----------



## amnixed (Jun 7, 2015)

Thanks for your advice, I followed it, but unfortunately, the build breaks down at exactly the same place.


----------



## tobik@ (Jun 7, 2015)

Try with `make clean; make CC=gcc48 CXX=g++48` in emulators/virtualbox-ose.


----------



## amnixed (Jun 8, 2015)

Thank you all for your help. Got a little farther, but still no luck: http://pastebin.com/wwscmEz7


----------



## protocelt (Jun 8, 2015)

amnixed said:


> Thank you all for your help. Got a little farther, but still no luck: http://pastebin.com/wwscmEz7


Ok, that's a separate issue but at least we're further along. Since you're using ports, have you been updating this box consistently and following /usr/ports/UPDATING or has it been some time since you updated it last?

As a sidenote, ports-mgmt/portmaster is probably a better choice than ports-mgmt/portupgrade for updating ports. portmaster(8) is only a shell script with no dependencies and integrates with pkg(8) while portupgrade(1) depends on lang/ruby and uses it's own database which can sometimes cause problems.


----------



## kpa (Jun 8, 2015)

protocelt said:


> Ok, that's a separate issue but at least we're further along. Since you're using ports, have you been updating this box consistently and following /usr/ports/UPDATING or has it been some time since you updated it last?
> 
> As a sidenote, ports-mgmt/portmaster is probably a better choice than ports-mgmt/portupgrade for updating ports. portmaster(8) is only a shell script with no dependencies and integrates with pkg(8) while portupgrade(1) depends on lang/ruby and uses it's own database which can sometimes cause problems.



Both of them use pkg(8) because `make install` on a port uses `pkg register`. The databases used by ports-mgmt/portupgrade do nothing to replace the functionality of pkg(8). The database is just a quick index to the ports tree and before the new pkg came along there was a similar database for /var/db/pkg that is no longer used.

That said, I agree that ports-mgmt/portmaster is the better choise now out of the two because the other one has become largely redundant because of pkg and portmaster has no dependencies.


----------



## protocelt (Jun 8, 2015)

kpa said:


> Both of them use pkg(8) because `make install` uses `pkg register`. The databases used by ports-mgmt/portupgrade do nothing to replace the functionality of pkg(8). The database is just a quick index to the ports tree and before the new pkg came along there was a similar database for /var/db/pkg that is no longer used.


True, I probably should have been more clear on that in my post. Thanks


----------



## amnixed (Jun 8, 2015)

protocelt said:


> Ok, that's a separate issue but at least we're further along. Since you're using ports, have you been updating this box consistently and following /usr/ports/UPDATING or has it been some time since you updated it last?
> 
> As a sidenote, ports-mgmt/portmaster is probably a better choice than ports-mgmt/portupgrade for updating ports. portmaster(8) is only a shell script with no dependencies and integrates with pkg(8) while portupgrade(1) depends on lang/ruby and uses it's own database which can sometimes cause problems.



As a rule, I always run portsnap(8) before using portupgrade(1), and first always upgrade ports-mgmt/pkg if there is an upgrade available, and then upgrade ports-mgmt/portupgrade if needed. What I have is:


```
# portversion -vR pkg-1.5.3
[Reading data from pkg(8) ... - 753 packages found - done]
pkg-1.5.3  =  up-to-date with port

[root@lizard /usr/ports]# portversion -vR portupgrade-2.4.14,2
[Reading data from pkg(8) ... - 753 packages found - done]
portupgrade-2.4.14,2  =  up-to-date with port
ruby-2.1.6,1  =  up-to-date with port
ruby21-bdb5-0.6.6_4  =  up-to-date with port
```


----------



## protocelt (Jun 8, 2015)

Using either upgrade tool really comes down to a matter of preference. Both will work. I just find(and many others) portmaster(8) to be the better of the two.

You never mentioned if you have been following any relevant instructions in /usr/ports/UPDATING before updating. Not following that file each and every time you update can and will cause a ton of problems due to dependencies and libraries not being in sync as well as ports being removed or renamed. I just wanted to rule that out before going any further.


----------



## amnixed (Jun 8, 2015)

I must admit that I have not always read /usr/ports/UPDATING before updating. As a matter of fact, pkg_libchk(1) is reporting a few missing dependencies, let me fix these.


----------



## amnixed (Jun 11, 2015)

protocelt said:


> Using either upgrade tool really comes down to a matter of preference. Both will work. I just find(and many others) portmaster(8) to be the better of the two.
> 
> You never mentioned if you have been following any relevant instructions in /usr/ports/UPDATING before updating. Not following that file each and every time you update can and will cause a ton of problems due to dependencies and libraries not being in sync as well as ports being removed or renamed. I just wanted to rule that out before going any further.



I have fixed the problems indicated by pkg_libchk(1) with the exception of these:


```
# pkg_libchk
virtualbox-ose-4.3.10: /usr/local/lib/virtualbox/VBoxSDL.so misses libSDL-1.2.so.11
virtualbox-ose-4.3.10: /usr/local/lib/virtualbox/VBoxSVC misses libpng15.so.15
virtualbox-ose-4.3.10: /usr/local/lib/virtualbox/components/VBoxC.so misses libpng15.so.15
```

OF course I couldn't fix the above, because building emulators/virtualbox-ose fails again with "bad C++ code".

Is there anything else I can try?


----------



## protocelt (Jun 18, 2015)

Sorry for the late reply. Life and all that.  I can't reproduce this on my machine. What do you have in your /etc/make.conf file?


----------



## talsamon (Jun 19, 2015)

You can try it with  `WITHOUT_ICONV=yes`.


----------

