I am currently posting this from a FreeBSD amd64 system that has been compiled with gcc45. I believe the following steps are the 'right way' to install FreeBSD with gcc45. I would be happy to respond to questions and comments.
1. Copy the patches patch-c-format.c, patch-c-format.h, patch-common.opt, patch-function.c, patch-gcc.c, patch-i386.c, and patch-i386.opt to /usr/ports/lang/gcc45/files. Make sure to start their names with "patch-".
2. Install gcc45. These patches work with gcc-core-4.5-20101104. [cmd=]cd /usr/ports/lang/gcc45 && make install[/cmd].
3. Update your source tree. See here for help. [cmd=]csup SUPFILE[/cmd].
4. Copy patch-src to /usr/src, make.conf to /etc, and libmap.conf to /etc. Edit make.conf to give the correct CPUTYPE, MACHINE, and MACHINE_ARCH. Depending on your system, use may need to remove -fira-loop-pressure or -maccumulate-outgoing-args. The included make.conf is for a production build. Here is a minimally correct version.
5. Update your source tree. [cmd=]cd /usr/src && patch -p0 < patch-src[/cmd].
6. Refresh your /usr/include and /usr/obj directories. [cmd=]make includes && rm -rf /usr/obj[/cmd].
7. Build world. The make.conf that is provided installs everything except CXX and OBJC. Normally this would imply that gperf, groff, and devd would not be installed; however, among other things the patch-src fixes that. [cmd=]make buildworld[/cmd] (if you get the error /usr/obj/usr/src/make.amd64/usr/share/man/man1 does not exists), then try [cmd=]mkdir /usr/obj/usr/src/make.amd64/usr/share[/cmd], [cmd=]mkdir /usr/obj/usr/src/make.amd64/usr/share/man[/cmd],
[cmd=]mkdir /usr/obj/usr/src/make.amd64/usr/share/man/man1[/cmd], and [cmd=]make buildworld[/cmd].
8. Build kernel. See here for help. Surprisingly, binutils does not need to be patched. However, patch-src coerces ld to use the right format when compiling the kernel.
9. Install kernel.
10. Reboot into single user mode or root.
11. Save your settings.
11. Install world.
12. Restore your settings.
13. Reboot.
1. Copy the patches patch-c-format.c, patch-c-format.h, patch-common.opt, patch-function.c, patch-gcc.c, patch-i386.c, and patch-i386.opt to /usr/ports/lang/gcc45/files. Make sure to start their names with "patch-".
2. Install gcc45. These patches work with gcc-core-4.5-20101104. [cmd=]cd /usr/ports/lang/gcc45 && make install[/cmd].
3. Update your source tree. See here for help. [cmd=]csup SUPFILE[/cmd].
4. Copy patch-src to /usr/src, make.conf to /etc, and libmap.conf to /etc. Edit make.conf to give the correct CPUTYPE, MACHINE, and MACHINE_ARCH. Depending on your system, use may need to remove -fira-loop-pressure or -maccumulate-outgoing-args. The included make.conf is for a production build. Here is a minimally correct version.
5. Update your source tree. [cmd=]cd /usr/src && patch -p0 < patch-src[/cmd].
6. Refresh your /usr/include and /usr/obj directories. [cmd=]make includes && rm -rf /usr/obj[/cmd].
7. Build world. The make.conf that is provided installs everything except CXX and OBJC. Normally this would imply that gperf, groff, and devd would not be installed; however, among other things the patch-src fixes that. [cmd=]make buildworld[/cmd] (if you get the error /usr/obj/usr/src/make.amd64/usr/share/man/man1 does not exists), then try [cmd=]mkdir /usr/obj/usr/src/make.amd64/usr/share[/cmd], [cmd=]mkdir /usr/obj/usr/src/make.amd64/usr/share/man[/cmd],
[cmd=]mkdir /usr/obj/usr/src/make.amd64/usr/share/man/man1[/cmd], and [cmd=]make buildworld[/cmd].
8. Build kernel. See here for help. Surprisingly, binutils does not need to be patched. However, patch-src coerces ld to use the right format when compiling the kernel.
# make buildkernel KERNCONF=MYKERNEL
.9. Install kernel.
# make installkernel KERNCONF=MYKERNEL
.10. Reboot into single user mode or root.
11. Save your settings.
# mergemaster -p
.11. Install world.
# cd /usr/src && make installworld
.12. Restore your settings.
# mergemaster
.13. Reboot.