On the 'host system' (the system that provides the Linux command-line environment to be used to install Gentoo to the storage device of choice) a working regular build toolchain has to be installed. On Gentoo this is usually always the case. On Debian or derivatives like Ubuntu install the toolchain with
apt install build-essential. For other systems please consult their respective documentation.
Next determine the architecture of the host system (the system the current Linux command-line environment runs on):
In case the host system's and the target system's architecture are not the same, set up a cross build environment suitable for the target system's architecture. If both are the same move directly to the Installing required tools section.