Subject: building with gcc4
To: None <>
From: matthew green <>
List: tech-toolchain
Date: 05/13/2006 04:17:27
hi folks..

to build the world with GCC4 one must set HAVE_GCC=4 (i've been
using the environment but mk.conf should also work.)  this will
cause nbgmake to be installed, tools/gcc to install gcc4 and the
normal build framework to build gcc4 programs and libs.

right now only i386 & sparc64 builds work (maybe not entirely,
i have not yet fun a full release for either..) and macppc is
capable of attempting but there is a merge problem for

unfortunately src/lib/csu is broken with GCC4 some how.  i had
a quick look but it wasn't obvious what is going wrong.  it seems
to be some problem with how our init_fallthru() works - dynamic
programs dump core with a stack trace that repeats through
this function and static binaries complain because _DYNAMIC is
not NULL...  the same thing occurs on sparc64 & i386.  using
older versions of crt0.o and crti.0 make things work again.

it would be great if someone else looked at this while i'm
looking at some other problems.

for folks who want to generate mknative files, the process is
set out in src/tools/gcc/README.mknative but remember that you
have to set HAVE_GCC=4.

you should be able to build i386 & sparc64 kernels though not
all of the kernel has been cleaned for GCC4 warnings (i have
built and tested GENERIC for both platforms.)  but do not install
the userland yet as it is broken!  (you might be able to play
around if you copy old crt[0i].o into the build tree and make
sure they are used... but i don't support this of course :-)

also, the installed /usr/bin/cc is not going to work yet...