`gcc` is used instead of `i686-pc-linux-gnu-gcc` during compilation of iproute2. Ebuilds before iproute2-3.1.0.ebuild pass CC explicitly to make with `emake CC="$(tc-getCC)" AR="$(tc-getAR)"`. iproute2-3.1.0.ebuild replaced the code with `tc-export AR CC PKG_CONFIG` which seems not to work because of 'CC = gcc' in iproute2-3.1.0/Makefile. Reproducible: Always Steps to Reproduce: 1. ACCEPT_KEYWORDS="**" emerge -av1 '=sys-apps/iproute2-3.1.0' Actual Results: gcc -D_GNU_SOURCE -march=native -O2 -pipe -Wstrict-prototypes -Wall -I../include -DRESOLVE_HOSTNAMES -DLIBDIR=\"/lib\" -fPIC -c -o ll_map.o ll_map.c gcc -D_GNU_SOURCE -march=native -O2 -pipe -Wstrict-prototypes -Wall -I../include -DRESOLVE_HOSTNAMES -DLIBDIR=\"/lib\" -fPIC -c -o libnetlink.o libnetlink.c ... Expected Results: i686-pc-linux-gnu-gcc -D_GNU_SOURCE -march=native -O2 -pipe -Wstrict-prototypes -Wall -I../include -DRESOLVE_HOSTNAMES -DLIBDIR=\"/lib\" -fPIC -c -o ll_map.o ll_map.c i686-pc-linux-gnu-gcc -D_GNU_SOURCE -march=native -O2 -pipe -Wstrict-prototypes -Wall -I../include -DRESOLVE_HOSTNAMES -DLIBDIR=\"/lib\" -fPIC -c -o libnetlink.o libnetlink.c ...
Created attachment 300753 [details, diff] proposed fix
Comment on attachment 300753 [details, diff] proposed fix This additionally removes PKG_CONFIG export as it seems to be unused and adds HOSTCC export for cross-compilation cases.
should be all set now in the tree; thanks for the report! Commit message: Respect CC from build env http://sources.gentoo.org/sys-apps/iproute2/iproute2-3.1.0.ebuild?r1=1.3&r2=1.4
make[1]: Leaving directory `/var/tmp/portage/sys-apps/iproute2-3.3.0/work/iproute2-3.3.0/misc' make[1]: Entering directory `/var/tmp/portage/sys-apps/iproute2-3.3.0/work/iproute2-3.3.0/netem' gcc -I../include -o maketable maketable.c -lm gcc -I../include -o normal normal.c -lm gcc -I../include -o pareto pareto.c -lm gcc -I../include -o paretonormal paretonormal.c -lm ./paretonormal > paretonormal.dist ./normal > normal.dist ./pareto > pareto.dist ./maketable experimental.dat > experimental.dist make[1]: Leaving directory `/var/tmp/portage/sys-apps/iproute2-3.3.0/work/iproute2-3.3.0/netem' Not fixed at all for me.
(In reply to comment #4) > make[1]: Entering directory > `/var/tmp/portage/sys-apps/iproute2-3.3.0/work/iproute2-3.3.0/netem' > gcc -I../include -o maketable maketable.c -lm > Not fixed at all for me. +1. The problem only in netem subdirectory. My proposed fix in attachment 300753 [details, diff] should fix this though.
(In reply to comment #5) > (In reply to comment #4) > > make[1]: Entering directory > > `/var/tmp/portage/sys-apps/iproute2-3.3.0/work/iproute2-3.3.0/netem' > > gcc -I../include -o maketable maketable.c -lm > > Not fixed at all for me. > > +1. > > The problem only in netem subdirectory. > My proposed fix in attachment 300753 [details, diff] [details, diff] should fix this though. Oops, sorry, I'm typing faster than thinking. These programs in netem directory are built using HOSTCC as they are being run during the build, so the behavior you see is correct. Although, I'd prefer $(tc-getBUILD_CC) instead of simple gcc.
(In reply to comment #4) yes, as pointed out, you're seeing *build time* code, not target code, hence it is not ignoring $CC
should be all set now in the tree; thanks for the report! Commit message: Also respect BUILD_CC http://sources.gentoo.org/sys-apps/iproute2/iproute2-3.7.0.ebuild?r1=1.4&r2=1.5