Here's the equivalent URLs for gcc-8 packages, but for arm64, from the ports server.
sudo apt update
wget http://ports.ubuntu.com/ubuntu-ports/pool/universe/g/gcc-8/gcc-8_8.4.0-3ubuntu2_arm64.deb
wget http://ports.ubuntu.com/ubuntu-ports/pool/universe/g/gcc-8/gcc-8-base_8.4.0-3ubuntu2_arm64.deb
wget http://ports.ubuntu.com/ubuntu-ports/pool/universe/g/gcc-8/libgcc-8-dev_8.4.0-3ubuntu2_arm64.deb
wget http://ports.ubuntu.com/ubuntu-ports/pool/universe/g/gcc-8/cpp-8_8.4.0-3ubuntu2_arm64.deb
# libmpx2 omitted as it's not available for arm64
wget http://ports.ubuntu.com/ubuntu-ports/pool/main/i/isl/libisl22_0.22.1-1_arm64.deb
sudo apt install ./gcc-8_8.4.0-3ubuntu2_arm64.deb ./gcc-8-base_8.4.0-3ubuntu2_arm64.deb ./libgcc-8-dev_8.4.0-3ubuntu2_arm64.deb ./cpp-8_8.4.0-3ubuntu2_arm64.deb ./libisl22_0.22.1-1_arm64.deb
wget http://ports.ubuntu.com/ubuntu-ports/pool/universe/g/gcc-8/libstdc++-8-dev_8.4.0-3ubuntu2_arm64.deb
wget http://ports.ubuntu.com/ubuntu-ports/pool/universe/g/gcc-8/g++-8_8.4.0-3ubuntu2_arm64.deb
sudo apt install ./libstdc++-8-dev_8.4.0-3ubuntu2_arm64.deb ./g++-8_8.4.0-3ubuntu2_arm64.deb