On Wednesday 23 August 2006 23:48, Michael Hennebry wrote:
> > >>> Oh, and BTW, on gentoo your optimization choices for gcc are -O, -O2
                                   note 'choices for gcc' above ^^^^^
> > >>> or nothing, because all other -O options are replaced with -O2 by
> > >>> toolchain.eclass.
>
> Perhaps I misunderstood the preceeding.
> I'd taken it to mean that recompiling any package with gentoo tools
> would result in -Os being replaced by  -O2 .

I probably should have explained it better before. If you look at the gcc 
ebuild (/usr/portage/sys-devel/gcc/gcc-YOUR_VERSION.ebuild) you will note a 
line that says:

inherit toolchain

This inherits the toolchain.eclass for the gcc ebuild. In 
the /usr/portage/eclass/toolchain.eclass you will find the following:

        # In general gcc does not like optimization, and add -O2 where
        # it is safe.  This is especially true for gcc 3.3 + 3.4
        replace-flags -O? -O2

This replaces -Os, -O3 or any other -O? with -O2. But it only applies to 
ebuilds that inherits the toolchain.eclass.

In conclusion in order to find out what packages don't use your CFLAGS you 
will either have to look at the ebuilds and any eclasses that they append or 
simply install it and look at the CFLAGS in the pkg database when it is 
installed:

# grep ^CFLAGS /etc/make.conf
CFLAGS="-O2 -march=pentium-m -pipe"

# cat /var/db/pkg/www-client/mozilla-firefox-1.5.0.6/CFLAGS
-march=pentium-m -pipe -Wno-return-type -w -freorder-blocks 
-fno-reorder-functions

As you can see the mozilla-firefox ebuild or any of it's eclasses has stripped 
any -O? CFLAGS entirely...

The following command should show you a complete list of packages that you 
have currently installed but which wasn't installed with your current CFLAGS:

# CFLAGS=$(source /etc/make.conf && echo "${CFLAGS}") ; \
        grep -v "${CFLAGS//\-/\\-}" /var/db/pkg/*/*/CFLAGS

-- 
Bo Andresen

Attachment: pgpAlYpbAPOat.pgp
Description: PGP signature

Reply via email to