It calls gcc directly only at linking time: cc -march=native -O2 -g0 -Wall -DTRACE -Wl,-O1 -Wl,--as-needed -Wl,--hash-style=gnu gznbd.c -lz -o gznbd tc-export CC fixes for me.
should be all set now in the tree; thanks for the report! Commit message: Set CC when building gznbd http://sources.gentoo.org/sys-block/nbd/nbd-3.2.ebuild?r1=1.2&r2=1.3