AHMAD 23577:
from Abū Ayyūb al-Anṣārī —
[Machine] The Messenger of Allah ﷺ said, "When one of you goes to relieve himself, he should not face the Qibla (direction of prayer) nor turn his back towards it, but he should either face the east or the west." Abu Ayyub commented, "When we arrived in Sham (Greater Syria), we found the toilets were made toward the Qibla, so we would change our direction and seek forgiveness from Allah."
أحمد ٢٣٥٧٧:
عن ابو ايوب الانصاري —
قَالَ رَسُولُ اللهِ ﷺ إِذَا أَتَى أَحَدُكُمُ الْغَائِطَ فَلَا يَسْتَقْبِلِ الْقِبْلَةَ وَلَا يَسْتَدْبِرْهَا وَلَكِنْ لِيُشَرِّقْ أَوْ لِيُغَرِّبْ قَالَ أَبُو أَيُّوبَ فَلَمَّا قَدِمْنَا الشَّامَ وَجَدْنَا مَرَاحِيضَ جُعِلَتْ نَحْوَ الْقِبْلَةِ فَنَنْحَرِفُ وَنَسْتَغْفِرُ اللهَ
hadithunlocked.com