Using newer version of GCC and binutils with the FreeBSD Ports Collection

Martin Matuska

$FreeBSD: doc/en_US.ISO8859-1/articles/custom-gcc/article.sgml,v 1.2 2009/09/04 14:22:47 danger Exp $

This article describes how to use newer versions of the GCC compilers and binutils from the FreeBSD ports tree. Custom GCC configurations are also discussed.


Table of Contents
1 Introduction
2 Prerequisites
3 Configuring ports for custom version of GCC
4 Impact on the binary performance

1 Introduction

The default system compiler as of FreeBSD 8.0 is GCC version 4.2.1. In addition, the base system of FreeBSD includes binutils version 2.15. These versions are several years old and lack, among other things, support for recent CPU instructions like SSSE3, SSE4.1, SSE4.2, etc. Due to licensing issues, new versions of these applications will not be integrated into the base system. Luckily, it is possible to use a newer version of the GCC compiler (e.g. version 4.4) with the help of the FreeBSD ports tree.