All you have to do is build the toolchain with CGO_ENABLED=0. The optional CGo bits are not needed for anything that the compiler cares about I don’t think; IIRC with CGo enabled it will use the system’s DNS resolver on Linux for example, instead of reading resolv.conf and talking to DNS servers directly.