Port patch from Gilles:

open-mpi/ompi@8da6c14