Worshippers from around the world have gathered in Islam’s holiest city amid regional conflicts and tightened restrictions.