Date: Tue, 06 Jul 2010 13:38:16 +0300 From: Andriy Gapon <avg@freebsd.org> To: Bernhard Froehlich <decke@freebsd.org> Cc: freebsd-emulation@freebsd.org, vbox@freebsd.org Subject: Re: emulators/virtualbox-ose vs non-base gcc Message-ID: <4C330798.5090606@freebsd.org> In-Reply-To: <84bf85053cb54d393398f37c0861d1fb@bluelife.at> References: <4C0DF92C.9020204@icyb.net.ua> <4C32DEF6.1020409@freebsd.org> <84bf85053cb54d393398f37c0861d1fb@bluelife.at>
next in thread | previous in thread | raw e-mail | index | archive | help
on 06/07/2010 11:00 Bernhard Froehlich said the following: > Thanks for the patch. We are aware of it and I already have it on my todo > so it will just take some time. Thank you for the update. BTW, there is another issue with building VirtualBox using gcc44. $ VirtualBox VirtualBox: supR3HardenedMainGetTrustedMain: dlopen("/usr/local/lib/virtualbox/VirtualBox.so",) failed: /usr/local/lib/virtualbox/VBoxREM.so: Undefined symbol "atan2l" zsh: exit 1 VirtualBox The problem is that base libstdc++ defines atan2l wrapper, but gcc44's libstdc++ doesn't do that, which I believe to be correct, because atan2l is defined in libm: $ objdump -T /usr/local/lib/virtualbox/VBoxREM.so | fgrep atan2l 0000000000000000 DF *UND* 0000000000000000 GLIBCXX_3.4 atan2l $ objdump -T /usr/lib/libstdc++.so | fgrep atan2l 00000000000519d0 g DF .text 0000000000000048 GLIBCXX_3.4 atan2l $ objdump -T /usr/lib/libm.so | fgrep atan2l 0000000000012230 g DF .text 000000000000035a FBSD_1.1 atan2l $ objdump -T /usr/local/lib/gcc44/libstdc++.so | fgrep atan2l $ Dependency on atan2l@GLIBCXX_3.4 is recorded because at link time linker uses /usr/lib/libstdc++.so. In turn, this happens because /usr/lib is explicitly specified in link search path (-L) and thus has higher precedence than built-in path (which includes /usr/local/lib/gcc44 for gcc44). I think that there is no reason to [explicitly] have /usr/lib (and also /usr/X11R6/lib) in virtualbox's library search path. Thus I propose the following patch: --- Config.kmk.orig 2010-06-25 17:23:52.000000000 +0300 +++ Config.kmk 2010-07-06 13:19:42.295639150 +0300 @@ -2794,8 +2795,6 @@ /usr/X11R6/include \ /usr/local/include TEMPLATE_VBOXR3EXE_LIBPATH += \ - /usr/lib \ - /usr/X11R6/lib \ /usr/local/lib else ifeq ($(KBUILD_TARGET),solaris) TEMPLATE_VBOXR3EXE_TOOL = GXX3PLAIN @@ -3236,8 +3235,6 @@ /usr/X11R6/include \ /usr/local/include TEMPLATE_VBOXMAINEXE_LIBPATH += \ - /usr/lib \ - /usr/X11R6/lib \ /usr/local/lib else ifeq ($(KBUILD_TARGET),solaris) TEMPLATE_VBOXMAINEXE_TOOL = GXX3PLAIN @@ -3564,8 +3561,6 @@ /usr/X11R6/include \ /usr/local/include TEMPLATE_VBOXQT4GUIEXE_LIBPATH += \ - /usr/lib \ - /usr/X11R6/lib \ /usr/local/lib endif ifeq ($(KBUILD_TARGET),solaris) @@ -3747,8 +3742,6 @@ /usr/X11R6/include \ /usr/local/include TEMPLATE_VBOXBLDPROG_LIBPATH += \ - /usr/lib \ - /usr/X11R6/lib \ /usr/local/lib else ifeq ($(KBUILD_HOST),solaris) TEMPLATE_VBOXBLDPROG_TOOL = GXX3PLAIN The patch is tested and works. Perhaps, there is a better way to achieve the same effect for FreeBSD. -- Andriy Gapon
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4C330798.5090606>