Pavick
November 8th, 2010, 23:07
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 (http://pastebin.com/cexSdKZd), patch-c-format.h (http://pastebin.com/GLTkS2NV), patch-common.opt (http://pastebin.com/4JfaZvaF), patch-function.c (http://pastebin.com/q5U1VjPn), patch-gcc.c (http://pastebin.com/CXuF3pWX), patch-i386.c (http://pastebin.com/XsFJcjdk), and patch-i386.opt (http://pastebin.com/ipY46zDw) 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. cd /usr/ports/lang/gcc45 && make install.
3. Update your source tree. See here (http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/cvsup.html) for help. csup SUPFILE.
4. Copy patch-src (http://pastebin.com/W7LVxHfQ) to /usr/src, make.conf (http://pastebin.com/VbveXCWU) to /etc, and libmap.conf (http://pastebin.com/7Ai8C7tV) 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 (http://pastebin.com/Ym2MwY59) is a minimally correct version.
5. Update your source tree. cd /usr/src && patch -p0 < patch-src.
6. Refresh your /usr/include and /usr/obj directories. make includes && rm -rf /usr/obj.
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. make buildworld (if you get the error /usr/obj/usr/src/make.amd64/usr/share/man/man1 does not exists), then try mkdir /usr/obj/usr/src/make.amd64/usr/share, mkdir /usr/obj/usr/src/make.amd64/usr/share/man,
mkdir /usr/obj/usr/src/make.amd64/usr/share/man/man1, and make buildworld.
8. Build kernel. See here (http://www.freebsd.org/doc/handbook/makeworld.html) 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.
1. Copy the patches patch-c-format.c (http://pastebin.com/cexSdKZd), patch-c-format.h (http://pastebin.com/GLTkS2NV), patch-common.opt (http://pastebin.com/4JfaZvaF), patch-function.c (http://pastebin.com/q5U1VjPn), patch-gcc.c (http://pastebin.com/CXuF3pWX), patch-i386.c (http://pastebin.com/XsFJcjdk), and patch-i386.opt (http://pastebin.com/ipY46zDw) 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. cd /usr/ports/lang/gcc45 && make install.
3. Update your source tree. See here (http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/cvsup.html) for help. csup SUPFILE.
4. Copy patch-src (http://pastebin.com/W7LVxHfQ) to /usr/src, make.conf (http://pastebin.com/VbveXCWU) to /etc, and libmap.conf (http://pastebin.com/7Ai8C7tV) 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 (http://pastebin.com/Ym2MwY59) is a minimally correct version.
5. Update your source tree. cd /usr/src && patch -p0 < patch-src.
6. Refresh your /usr/include and /usr/obj directories. make includes && rm -rf /usr/obj.
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. make buildworld (if you get the error /usr/obj/usr/src/make.amd64/usr/share/man/man1 does not exists), then try mkdir /usr/obj/usr/src/make.amd64/usr/share, mkdir /usr/obj/usr/src/make.amd64/usr/share/man,
mkdir /usr/obj/usr/src/make.amd64/usr/share/man/man1, and make buildworld.
8. Build kernel. See here (http://www.freebsd.org/doc/handbook/makeworld.html) 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.