For me every package is found to be build without respecting the CFLAGS. Simple example are portage-utils. Only q is build so the tracking is easy. x86_64-pc-linux-gnu-gcc -O2 -pipe -ftracer -march=corei7-avx -mtune=corei7-avx -mcx16 -msahf -mno-movbe -maes -mpclmul -mpopcnt -mno-abm -mno-lwp -mno-fma -mno-fma4 -mno-xop -mno-bmi -mno-tbm -mavx -msse4.2 -msse4.1 --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=8192 -frecord-gcc-switches -g -Wimplicit-function-declaration -std=gnu99 -Wl,-O1 -Wl,--as-needed -Wl,-O1 -Wl,--hash-style=gnu -Wl,--sort-common main.c -o q CFLAGS="-O2 -pipe -ftracer -march=corei7-avx -mtune=corei7-avx -mcx16 -msahf -mno-movbe -maes -mpclmul -mpopcnt -mno-abm -mno-lwp -mno-fma -mno-fma4 -mno-xop -mno-bmi -mno-tbm -mavx -msse4.2 -msse4.1 --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=8192 -frecord-gcc-switches -g -Wimplicit-function-declaration" For me it seems that all CFLAGS are respected.
Created attachment 296833 [details] /var/log/portage/build/app-portage/portage-utils-0.9:20111224-083631.log build.log
The problem is that the binaries can't be stripped until after the CFLAGS check: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=b91754cb94e3f3d2db50768ec7cad47314d806ce
This fixes false positives for linux kernel modules: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=dfe2afc9549e596a438a322feb35240d52ca26b5
This is fixed in 2.1.10.43 and 2.2.0_alpha83.