To configure specific compiler switches per package in Gentoo use these instructions.
Modifying environmental variables per package
package.env file can be used to modify environmental variables per package. See /etc/portage/env in the Gentoo Wiki for details.
Conflicting compiler switches
make.conf one typically specifies compiler switches that are selected to optimize for one’s specific machine. But some packages (e.g. www-client/chromium) have their own build system, which can result in conflicting compiler switches.
Disabling compiler switches per package
This can be done via
package.env and helper files in the
env subdirectory. For example, if
/etc/portage/make.conf specifies the following section:
/etc/portage/package.env the following section will select specific flags for the
and in the
/etc/portage/env/cflags-no-optimization file holds the specific environmental variable:
This prevents that the
-O2 compiler switch that is specified in
make.conf is used for the