Problems are worked around by using older gcc wrapper for gnat bootstrap. (from ca441636f1^) I tried nicer solutions first, but I was unable to fix all problems for hours.
Nixpkgs is a collection of packages for Nix package manager. Nixpkgs also includes NixOS linux distribution source code.