Compiling kernel with gcc43 [SOLVED]
Mario Lobo
lobo at bsd.com.br
Fri Apr 2 15:40:02 UTC 2010
On Thursday 01 April 2010 16:53:36 Pegasus Mc Cleaft wrote:
> On Thursday 01 April 2010 15:27:41 Oliver Fromme wrote:
> > Mario Lobo <lobo at bsd.com.br> wrote:
> > > [...]
> > > It's compiling right now.
> > >
> > > I'll post my findings and impressions on results and performance right
> > > after the next reboot.
> >
> > So, how is it going? Any benchmarks yet? I'm curious
> > if the new gcc version will really make a significant
> > difference.
>
> I would love to see the /etc/make.conf, /etc/src.conf and
> /etc/libmap.conf files that were used for the build. I have tried compiling
> in VBox a current kernel and world, but it usually just bombs out for me.
> I would like to give this a go as well.
>
> Peg
>
Well, to tell the truth I wasn't that thrilled with the results. I didn't
benchmark anything by my impressions were that at least disk access was a bit
slower not only during booting but it was more noticeable to me particularly
on a burning DVD session. Of course this is ultra abstract.
In all previous experiences I had in burning CD/DVD with k3b, I recollect that
during burning, the software buffer and device buffer gouges were always 100%,
with the software buffer gouge dropping down occasionally to 89/92%.
After recompiling the kernel with gcc43, the software buffer was always empty
and the device buffer rarely reached 40/50%. I think (if not mistaken) this
means that the device is asking "where is my data??" and the OS is not
providing it fast enough.
I could not get world to build with gcc43 so I gave that up. Then I moved on
to VirtualBox. I managed to have it compiled and running. After long trial and
error sessions, I could pin point what was breaking compilation and fixed it.
Here are the steps:
------------------------------------------------------------------------------
Compiling vbox/vbox-devel with gcc43
1) /usr/include/cam/cam.h needed #include <stdio.h> for FILE define,
complained by:
work/VirtualBox-3.1.51.r27657_OSE/src/VBox/Main/freebsd/HostHardwareFreeBSD.cpp:47:
/usr/include/cam/cam.h:246: error: 'FILE' has not been declared
2)/usr/ports/emulators/virtualbox-
ose/work/VirtualBox-3.1.6_OSE/src/VBox/Main/generic/NetIf-generic.cpp
needed #include <stdio.h> because of popen() (this step is ONLY for
virtualbox-ose)
3)/usr/ports/emulators/virtualbox-ose(-
devel)/work/VirtualBox-3.1.6_OSE/src/VBox/Main/freebsd/NetIf-freebsd.cpp
needed #include <stdlib.h> because of malloc()/free()
4) Config.kmk needed some tweaks:
a) line 1750 - $(APPEND) '$@' 'VBOX_GCC_mtune-generic ?= $(call
VBOX_GCC_CHECK_CC,-mtune=amdfam10 -D__FreeBSD_cc_version=0,)'
to use instructions closer to Phenom and avoid cc complains.
b) took out all references to "-fformat-extensions" and "-fno_format-
extensions"
c) Preceeded all relevant locations of "/usr/lib \" with
"/usr/local/lib/gcc43 \" so kbuild searched there for libraries first.
(except TEMPLATE_VBOXQT4GUIEXE_LIBPATH !)
d) You can use the same Config.kmk for building kmods as well
5) took out -fformat-extensions from src/sys/conf/kern.mk
And I left /etc/libmap.conf
libgcc_s.so.1 gcc43/libgcc_s.so.1
libgomp.so.1 gcc43/libgomp.so.1
libobjc.so.3 gcc43/libobjc.so.2
libssp.so.0 gcc43/libssp.so.0
libstdc++.so.6 gcc43/libstdc++.so.6
/etc/make.conf
CC=/usr/local/bin/gcc43
CXX=/usr/local/bin/g++43
CPP=/usr/local/bin/cpp43
CFLAGS+=-mssse3 -D__FreeBSD_cc_version=0
CXXFLAGS+=-D__FreeBSD_cc_version=0
CPUTYPE=amdfam10
#MAKEOPTS+= -j4
and /etc/src.conf
NO_WERROR=
WERROR=
------------------------------------------------------------------------------
New problems started to come when I tried to extend this to other ports,
breaking a lot of them, to point of making me revert everything back to what
it was. In fact I am still in this process right now, and reving a lot of
problems to rebuild kde4.
This is it for now, guys. If you find anything new, please post.
Best of luck,
--
Mario Lobo
http://www.mallavoodoo.com.br
FreeBSD since version 2.2.8 [not Pro-Audio.... YET!!] (99,7% winfoes FREE)
More information about the freebsd-questions
mailing list