From owner-freebsd-emulation@FreeBSD.ORG Tue Jul 6 10:38:20 2010 Return-Path: Delivered-To: freebsd-emulation@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E10CF106564A; Tue, 6 Jul 2010 10:38:20 +0000 (UTC) (envelope-from avg@freebsd.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id A663B8FC1E; Tue, 6 Jul 2010 10:38:19 +0000 (UTC) Received: from porto.topspin.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id NAA18252; Tue, 06 Jul 2010 13:38:18 +0300 (EEST) (envelope-from avg@freebsd.org) Received: from localhost.topspin.kiev.ua ([127.0.0.1]) by porto.topspin.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1OW5Xd-000NAT-R8; Tue, 06 Jul 2010 13:38:17 +0300 Message-ID: <4C330798.5090606@freebsd.org> Date: Tue, 06 Jul 2010 13:38:16 +0300 From: Andriy Gapon User-Agent: Thunderbird 2.0.0.24 (X11/20100603) MIME-Version: 1.0 To: Bernhard Froehlich References: <4C0DF92C.9020204@icyb.net.ua> <4C32DEF6.1020409@freebsd.org> <84bf85053cb54d393398f37c0861d1fb@bluelife.at> In-Reply-To: <84bf85053cb54d393398f37c0861d1fb@bluelife.at> X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: freebsd-emulation@freebsd.org, vbox@freebsd.org Subject: Re: emulators/virtualbox-ose vs non-base gcc X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Jul 2010 10:38:21 -0000 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