Technically, compulsory licensing is allowed under TRIPS (https://www.wto.org/english/tratop_e/trips_e/public_health_f...). But the US and others opted out of this (https://www.wto.org/english/docs_e/legal_e/31bis_trips_annex...).