if you run: # CC=gcc-4.9.2 emerge ksh it still uses `cc`: >>> Emerging (1 of 1) app-shells/ksh-93.20140625::gentoo * INIT.2014-06-25.tgz SHA256 SHA512 WHIRLPOOL size ;-) ... [ ok ] * ast-base.2014-06-25.tgz SHA256 SHA512 WHIRLPOOL size ;-) ... [ ok ] >>> Unpacking source... >>> Unpacking INIT.2014-06-25.tgz to /var/tmp/portage/app-shells/ksh-93.20140625/work >>> Unpacking ast-base.2014-06-25.tgz to /var/tmp/portage/app-shells/ksh-93.20140625/work >>> Source unpacked in /var/tmp/portage/app-shells/ksh-93.20140625/work >>> Preparing source in /var/tmp/portage/app-shells/ksh-93.20140625/work ... * Applying ksh-prefix.patch ... [ ok ] * Adjusting to prefix / * msg.c ... [ ok ] >>> Source prepared. >>> Configuring source in /var/tmp/portage/app-shells/ksh-93.20140625/work ... >>> Source configured. >>> Compiling source in /var/tmp/portage/app-shells/ksh-93.20140625/work ... package: update /var/tmp/portage/app-shells/ksh-93.20140625/work/bin/execrate package: initialize the /var/tmp/portage/app-shells/ksh-93.20140625/work/arch/linux.i386 view package: update /var/tmp/portage/app-shells/ksh-93.20140625/work/arch/linux.i386/lib/probe/C/make/probe package: update /var/tmp/portage/app-shells/ksh-93.20140625/work/arch/linux.i386/bin/mamake package: update /var/tmp/portage/app-shells/ksh-93.20140625/work/arch/linux.i386/bin/proto ../../lib/libpp/ppproto.c: In function 'proto_error': ../../lib/libpp/ppproto.c:315:2: warning: ignoring return value of 'write', declared with attribute warn_unused_result [-Wunused-result] proto.c: In function 'main': proto.c:582:5: warning: ignoring return value of 'write', declared with attribute warn_unused_result [-Wunused-result] package: update /var/tmp/portage/app-shells/ksh-93.20140625/work/arch/linux.i386/bin/ratz package: update /var/tmp/portage/app-shells/ksh-93.20140625/work/arch/linux.i386/bin/release package: make /var/tmp/portage/app-shells/ksh-93.20140625/work/arch/linux.i386/bin/nmake with mamake package: make output captured in /var/tmp/portage/app-shells/ksh-93.20140625/work/arch/linux.i386/lib/package/gen/make.out package: make start at Tue Apr 14 22:30:53 EDT 2015 in /var/tmp/portage/app-shells/ksh-93.20140625/work/arch/linux.i386 CC=cc SHELL=sh HOSTTYPE=linux.i386 NPROC=4 PACKAGEROOT=/var/tmp/portage/app-shells/ksh-93.20140625/work and later on, the build is full of lines like: + cc -D_BLD_DLL -fPIC -D_BLD_ast -O2 -march=amdfam10 -pipe -g -frecord-gcc-switches -Wimplicit-function-declaration -I. -I/var/tmp/portage/app-shells/ksh-93.20140625/work/src/lib/libast -Icomp -I/var/tmp/portage/app-shells/ksh-93.20140625/work/src/lib/libast/comp -Iinclude -I/var/tmp/portage/app-shells/ksh-93.20140625/work/src/lib/libast/include -Istd -I/var/tmp/portage/app-shells/ksh-93.20140625/work/src/lib/libast/std -D_PACKAGE_ast -c /var/tmp/portage/app-shells/ksh-93.20140625/work/src/lib/libast/misc/signal.c
The build system saves ${CC} in a shell script called ${S}/bin/cc. It then adds ${S}/bin to the front of PATH.