Date: Tue, 06 Jul 2010 10:00:35 +0200 From: Bernhard Froehlich <decke@FreeBSD.org> To: Andriy Gapon <avg@freebsd.org> Cc: freebsd-emulation@freebsd.org, vbox@freebsd.org Subject: Re: emulators/virtualbox-ose vs non-base gcc Message-ID: <84bf85053cb54d393398f37c0861d1fb@bluelife.at> In-Reply-To: <4C32DEF6.1020409@freebsd.org> References: <4C0DF92C.9020204@icyb.net.ua> <4C32DEF6.1020409@freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 06 Jul 2010 10:44:54 +0300, Andriy Gapon <avg@freebsd.org> wrote: > on 08/06/2010 11:02 Andriy Gapon said the following: >> I am trying to compile my ports with gcc44 instead of a base gcc. >> It seems that currently VirtualBox build system assumes that FreeBSD >> means base >> GCC only. For example, it unconditionally uses -fno-format-extensions >> and >> -fformat-extensions options. Those are extensions available in base >> GCC, but >> not in ports GCCs (at least for time being). >> I am not proficient in KBuild, so I don't have a patch, but I can make a >> suggestion that for these options CC and CXX should be tested in >> addition to >> KBUILD_TARGET. >> >> Additionally, two files seem to miss some include directives because of >> GCC >> changes outlined here: >> http://gcc.gnu.org/gcc-4.3/porting_to.html > > I would like to remind that the reported issues are still there with > VirtualBox > 3.2.6 and something like the following patch is still required. > > --- src/VBox/Main/freebsd/NetIf-freebsd.cpp.orig 2010-07-06 > 10:31:07.328680775 +0300 > +++ src/VBox/Main/freebsd/NetIf-freebsd.cpp 2010-07-06 10:31:28.000532682 > +0300 > @@ -44,6 +44,7 @@ > #include <netinet/in.h> > > #include <stdio.h> > +#include <stdlib.h> > #include <unistd.h> > #include <errno.h> > > --- src/VBox/Main/freebsd/HostHardwareFreeBSD.cpp.orig 2010-07-06 > 10:29:23.130414466 +0300 > +++ src/VBox/Main/freebsd/HostHardwareFreeBSD.cpp 2010-07-06 > 10:32:59.702484321 > +0300 > @@ -40,6 +40,7 @@ > # include <unistd.h> > # include <sys/ioctl.h> > # include <fcntl.h> > +# include <stdio.h> > # include <cam/cam.h> > # include <cam/cam_ccb.h> > # include <cam/scsi/scsi_pass.h> > > > And probably the following should just work too. > > --- Config.kmk.orig 2010-06-25 17:23:52.000000000 +0300 > +++ Config.kmk 2010-07-05 20:59:21.772469818 +0300 > @@ -2612,7 +2613,7 @@ > $(VBOX_GCC_WARN) -Wpointer-arith -Winline $(VBOX_GCC_Wno-pointer-sign) \ > -Wstrict-prototypes -Wmissing-prototypes -Wstrict-prototypes > -Wnested-externs \ > -Wimplicit-function-declaration -Werror-implicit-function-declaration \ > - -O2 -fformat-extensions -ffreestanding -fno-strict-aliasing -fno-common > -finline-limit=8000 \ > + -O2 -ffreestanding -fno-strict-aliasing -fno-common -finline-limit=8000 \ > $(VBOX_GCC_fno-stack-protector) $(VBOX_GCC_R0_OPT) $(VBOX_GCC_R0_FP) \ > -nostdinc -std=c99 > TEMPLATE_VBOXR0DRV_CFLAGS.x86 = -m32 -mno-align-long-strings > -mpreferred-stack-boundary=2 -mno-mmx -mno-3dnow -mno-sse -mno-sse2 > @@ -2621,7 +2622,7 @@ > -mno-3dnow -msoft-float -fno-asynchronous-unwind-tables -Wundef > TEMPLATE_VBOXR0DRV_CXXFLAGS = -fno-exceptions -fno-rtti \ > $(VBOX_GCC_WARN) -Wpointer-arith -Winline \ > - -O2 -fno-format-extensions -fno-strict-aliasing -fno-common > -finline-limit=8000 \ > + -O2 -fno-strict-aliasing -fno-common -finline-limit=8000 \ > $(VBOX_GCC_fno-stack-protector) $(VBOX_GCC_R0_OPT) $(VBOX_GCC_R0_FP) \ > -nostdinc > TEMPLATE_VBOXR0DRV_CXXFLAGS.x86 = $(TEMPLATE_VBOXR0DRV_CFLAGS.x86) Thanks for the patch. We are aware of it and I already have it on my todo so it will just take some time. -- Bernhard Froehlich http://www.bluelife.at/
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?84bf85053cb54d393398f37c0861d1fb>