I heard the Prophet ﷺ delivering a sermon. Hisham said, on the pulpit, and he said, "Whoever cannot find a waist-wrapper should wear trousers, and whoever cannot find sandals should wear leather socks."In his version, Hisham said, "He should wear trousers unless he cannot find any."
حدثنا هشام بن عمار ومحمد بن الصباح قالا حدثنا سفيان بن عيينة عن عمرو بن دينار عن جابر بن زيد أبي الشعثاء
سمعت النبي ﷺ يخطب قال هشام على المنبر فقال من لم يجد إزارا فليلبس سراويل ومن لم يجد نعلين فليلبس خفين وقال هشام في حديثه فليلبس سراويل إلا أن يفقد
Sourced from Bukhari, book of Clothing, chapter on tanned leather sandals and similar footwear, no. 5804, 5853, 1841, and 1843, and Muslim, book of Hajj, chapter on what may and may not be worn by one in the state of ihram for Hajj or Umrah, no. 1178, from the hadith of Ibn Uyayna, through this same chain.