Additional system configuration is required in order to use custom version of GCC installed from the FreeBSD ports tree.
Add the following lines to the
/etc/make.conf
file (or modify
appropriately):
Alternatively, it is possible to specify the
${CC}
and ${CPP}
variables
manually.
The examples above are for GCC
version 4.4. To use gcc43
, replace
"gcc44"
with "gcc43"
and
"4.4"
with "4.3"
and so
on.
Many of the ports' binaries and libraries link to libgcc_s
or libstdc++. The base system already includes these libraries,
but from an earlier version of GCC
(version 4.2.1). To supply rtld (and ldd) with correct versions,
add the following lines to the
/etc/libmap.conf
file (or modify
appropriately):
The examples above are for GCC
version 4.4. To use gcc43
, replace
"gcc44"
with "gcc43"
and so on. Note also that all of these libraries are fully
backwards compatible with base system libraries.
Some C++ programs may refuse to work if these libraries are not mapped correctly. If it is not feasible to map them all, it is recommended to map at least libstdc++.so.
To add custom CFLAGS
for the ports tree
which are unsupported by the base system, adjust the
/etc/make.conf
according to the following
example:
It is possible to completely replace
CFLAGS
and/or define custom
CPUTYPE
as well. We recommend setting
CPUTYPE
because many ports decide their
optimizations flags based on this variable.
To exclude ports that have problems with custom version of
GCC, adjust the
/etc/make.conf
according to the following
example:
The example above excludes the forced use of
gcc
4.4 for the
net/openldap
* ports. It is
also possible to specify more ports on a single line:
This, and other documents, can be downloaded from http://ftp.FreeBSD.org/pub/FreeBSD/doc/
For questions about FreeBSD, read the
documentation before
contacting <questions@FreeBSD.org>.
For questions about this documentation, e-mail <doc@FreeBSD.org>.