In the three ebuilds app-containers/runc, app-containers/docker, app-containers/docker-cli, the variable CGO_CFLAGS is set like this: export CGO_CFLAGS="-I${ESYSROOT}/usr/include" However, if CGO_CFLAGS is set to anything except the empty string the default value of "-O2 -g" is discarded. Therefore optimization is unconditionally disabled by this line. I suggest as an improvement to instead set export CGO_CFLAGS="-I${ESYSROOT}/usr/include ${CFLAGS}" allowing whatever optimization set in make.conf or package.env to take effect. www-apps/hugo and app-containers/snapd already include ${CFLAGS} in their CGO_CFLAGS, so there is precedent of this behaviour. Reproducible: Always Steps to Reproduce: Build app-containers/docker with CFLAGS set to "-O2" in make.conf Actual Results: The cgo bindings are built without optimization Expected Results: The cgo bindings are built with optimization