Using haraam earnings for hajj, getting married or building a masjid

If a person had amassed immense wealth made up of trading in haraam, and then repented to Allaah [from that], is it then permissible for him to perform hajj using this wealth, or donate to charity from it, or [even] get married or build a masjid using it?