Answer
Praise be to Allah and peace and blessings be upon the Messenger of Allah, to the point:
The Hadith referred to is narrated by Musa ibn `Uqbah as stated in the book of "Al Isti`ab" by Ibn `Abd Al Bar (1614-1613/4), the book of "Al Iktifa'" by Al Kala`y (184/2), the book of "Tarikhul-Islam" (the History of Islam by Al Dhahaby (400/2), the book of "Fathul-Bary" by Ibn Hajar Al Askalani (5/351). It was narrated in the book of "Dala'il Al Nubuwwah" (4/172-175) who said: Abu Al Husayn ibn Al Fadl Al Qattan informed us from Abu Bakr ibn `Attab Al `Abdy from Al Qasim ibn `Abdullah ibn Al Mughirah from Isma'il ibn Abu Uways from Isma`il ibn Ibrahim ibn `Uqbah on the authority of Musa ibn `Uqbah.
Abu `Abdullah Al Hafizh reported to us from Isma`il ibn Muhammad ibn Al Fadl Al Sha`rany from my grandfather from Ibrahim ibn Al Mundhir from Muhammad ibn Fulayh on the authority of Musa ibn `Uqbah from Ibn Shihab, this is the wording of the Hadith narrated by Al Qattan: "When Allah's Messenger (peace be upon him) returned to Medina, a Muslim man from the tribe of Thaqif called "Abu Basir ibn Osayd ibn Gariyah Ath-Thaqafy" fled from the disbelievers…," where he mentioned the well-known story of Abu Gundul and Abu Basir (may Allah be pleased with them both). The narration told us how Abu Basir killed one of the two men who took him from the Muslim side. He walked until he reached Sayf Al Bahr. He also mentioned how Abu Gundul ibn Suhayl fled from Quraysh and joined Abu Basir. Then any one from Quraysh embraces Islam would join Abu Basir, where they formed a guerrilla that would attack any caravan of Quraysh going to Syria. They would kill the people and take their money. Thus Quraysh submitted an appeal for the Prophet (peace be upon him) to send for Abu Basir and his men…." At the end of this narration, he said: "Allah's Messenger (peace be upon him) sent for Abu Gundul and Abu Basir commanding them to come to him and commanding the Muslims joining them to return to their countries and families and not to attack any one or any caravan that is passing by. In this narration they claimed that the message of Allah's Messenger (peace be upon him) reached Abu Gundul and Abu Basir because the latter was on his death bed. He died with the letter of Allah's Messenger (peace be upon him) in his hand reading it. Abu Gundul buried him at that place and built a Masjid near his grave."
This Hadith was also reported by Ibn `Asakir in the book of "the History of Damascus" (25/ 299-300) from the same way that Al Bayhaqy and Al Khatib Al Baghdady mentioned on the authority of Abul-Husayn ibn Al Fadl Al Qattan, the Sheikh of Al Bayhaqy.
What concerns us in this story is his saying: "and built a Masjid near his grave."
This cannot stand as evidence on the permissibility of building Masjids over graves for two reasons:
First: There is a difference between his saying "over his grave" and "near his grave". What is prohibited is: "to build Masjids over graves" but not "by graves". This is based on the Hadith narrated by `Aishah (may Allah be pleased with her): That Umm Habibah and Umm Salamah (may Allah be pleased with them both) told the Prophet (peace be upon him) that they saw a church in Abyssinia that contained pictures, he (peace be upon him) said: "When a pious person among those people died, they built a place of worship on their grave, and then decorated it with such pictures. They will be the worst of creatures on the Day of Judgment in the sight of Allah." (Narrated by Al Bukhari (427) and Muslim (528).
It is well-known that the grave of the Prophet (peace be upon him) and his two Companions (may Allah be pleased with them) was established by his Masjid. Had this been impermissible, they would not have been buried there. The one presenting the grave of Abu Basir as evidence should have built his evidence on that of the Prophet, which is a much more powerful and manifest evidence!!
Yet it seems to me that he read some thing wrong on the mentioned issue mentioned in the book of "Al Isti`ab" by ibn `Abdul-Bar whose wording reads: "Abu Gundul buried him at this place, performed funeral prayer over him, and built a Masjid on his grave."
The creed of Ahl As-Sunnah in such issues is to adopt the authentic and clear evidence and reject non-sustained proofs. Many scholars narrated this text from Musa ibn `Uqbah, where they all stated: "near his grave". These scholars include Al Kala`y, Adh-Dhahaby, and Ibn Hajar. It was also narrated on his authority by Al Bayhaqy and ibn `Asakir according to their own chains of transmission as previously mentioned. I found out that "over his grave" was mentioned only in the book of Ibn `Abd Al Bar. Perhaps, there is a printing error. Thus, we must refer to the handwritten copy of the book. If this was really so written, then this may be a metaplasm on the part of the transcriber or that of Ibn `Abdul-Bar himself because he is not infallible. In the book of "Al Istidhkar" (1/521) Ibn `Abd Al Bar himself mentioned the Hadith on the Prophet's forgetfulness during prayer, where he commented: "This Hadith indicates that none is protected from oblivion and forgetfulness because if prophets underwent this, then other people can experience that."
In the book of "Al Tamhid" (1/366), he referred to a mistake made by Ibn Shihab Az-Zuhry, where he said: "I do not know that any of the scholars or the compilers of Hadith depended on the Hadith of Ibn Shihab regarding the story of Dhul-Yadayn because of his disturbance and that he did not fully mention its chain of transmission nor its full text. Although he is a great Imam in this regard, yet none is infallible, and none can achieve perfection. The words of any person may be adopted or abandoned except the Prophet (peace be upon him)."
Second, Musa ibn `Uqbah narrated the on the authority of Az-Zuhry as a Hadith Mursal (a Hadith with no Sahaby in the Sanad) which is classified by the scholars of Hadith to be Da`if (weak). Consequently, this narration cannot stand as a proof.
The proof which sustains the weakness of this narration is: it is a Mursal narration (a narration with no Sahaby in the Sanad) on the part of Ibn Shihab. It is judged by a cluster of the Hadith scholars to be bad.
Ibn Abu Hatim stated in Kitab Al Marasil (p. 3): "Ahmed ibn Sinan told us: Yahia ibn Sa`id Al Qattan would deem the Mursal Hadith narrated by Az-Zuhry to be weak and added: It is not even a Hadith."
He said also: "It was read before `Abbas Al Duwry on the authority of Yahiya ibn Ma`in who said: "The Mursal narrated by Az-Zuhry is not a Hadith."
In the book of "the History of Damascus" (55/368), Ibn `Asakir narrated on the authority of Abu Qudamah `Ubaydullah ibn Sa`id who said: "I heard Yahiya ibn Sa`id (i.e. Al Qattan) say: " The Mursal narrated by Az-Zuhry is worse than the Hadith Mursal narrated by other than him because he is a hafizh (memorizer). Whenever he could name one, he would do so but he leaves those who are not good or those whom he does not know their conditions."
He and Al Khatib Al Baghdady also reported in "Al Kifayah" (P. 386) from the way of Ahmad ibn Abu Shurayh Al Razy. He said: I heard Abu `Abdullah Muhammad ibn Idris Al Shafi`y who defended the Sunnah and the one who fought the people of heresy saying: "The Mursal (incompletely transmitted Hadith) of Az-Zuhry is not accepted according to me because Az-Zuhry reports from Sulayman ibn Arqam."
In other wordings, he said: I heard Al Shafi`y saying: "They say: We may do this for the sake of Az-Zuhry. The Mursal of Az-Zuhry is not accepted because he reports from Sulayman ibn Arqam."
We cannot accept the narrations of Sulayman ibn Arqam as Abu Dawud, Abu Hatim, Al Tirmidhy, Ahmad, Al Hakim, Al Daraqutny and others said. Al Bukhari said: They abandoned his narrations. See "Tahdhib Al Tahdhib" (4\148).
Ibn `Asakir also narrated (369\55) from `Ali ibn Al Madiny and Ya`qub ibn Shaybah that they said: "The Mursals of Az-Zuhry are not good."
When Al Hafizh Al Dhahaby mentioned some of these sayings in "Siyar `Alam An-Nubala'" (5\339), he said: "I said: The Mursals of Az-Zuhry is like the Mu`dil (Perplexing Hadith) because it is the Hadith which two of its narrators are not mentioned. It is not proper to think that Az-Zuhry did not mention the Companion only. If the narration was reported from a Companion, he would explain it but he could not. He who counted the Mursals of Az-Zuhry as the Mursal of Sa`id ibn Al Musayyab, `Urwah ibn Al Zubayr and others. He did not know what to say. Yes, his narrations are Mursals such as the Mursals of Qatadah and others."
Al Bukhari reported in his Sahih (2731 and 2732) the original story of Abu Basir, Abu Jandal and those who were with them (may Allah be pleased with them) but neither he nor anyone else mentioned this wording "near his grave". He also reported the narration with a connected chain of narration when he said: Abdullah ibn Muhammad informed us from `Abdul-Razzaq from Mu`ammar from Az-Zuhry from Urwah ibn Al Zubayr from Al Miswar ibn Makhramah and Marawan — each one certifies the narration of the other — they said: The Messenger (peace be upon him) sent out in the time of Al Hudaybiyah. He mentioned the Hadith of Al Hudaybiyah in length and narrated the famous story of Abu Jandal and Abu Basir (may Allah be pleased with them) and how did Abu Basir killed one of the two men who took him from the Prophet (peace be upon him). Then he sent out until he reached Sayf Al Bahr and how Abu Jandal ibn Suhayl escaped Makkah and joined Abu Basir. Everyone sent out from Makkah as a Muslim has joined Abu Basir until he formed a guerrilla. When they heard the news that a Qurayshi caravan has sent out for the Levant, they blocked its way, killed everyone there and took their monies. Quraysh sent to the Prophet (peace be upon him) asking him to send to Abu Basir and his companions telling him that everyone passes by Abu Basir should be safe. The Prophet (peace be upon him) sent to them and thereupon, Allah revealed: "And He is the one Who has withheld their hands from you and your hands from them in the midst of Makkah, after He had made you victors over them." Until He says: "put in their hearts pride and haughtiness — the pride and haughtiness of the time of ignorance." [Surat Al Fath: 26]. Their pride was: they did not admit that he was the Messenger of Allah and did not recognize "In the name of Allah, the Most Gracious, the Most Merciful" and blocked their way to the House of Allah.
Thus, that story was narrated with the connected chain of transmission and the story neither contained the news of Abu Basir's death nor that he has built a grave on his Masjid.
Then, Al Bukhari reported the Hadith (2733) after this narration saying: Aqil reported from Az-Zuhry: `Urwah said: `A'ishah told me that the Messenger of Allah (peace be upon him) was testing them. We were informed that when Allah revealed that they should give in to the polytheists what they have spent on their migrant husbands and sentenced Muslims not to hold with the bonds and covenants of the unbelievers, `Umar divorced two women. We do not know anyone from the female migrants reverted after their faith. We also were informed that Abu Basir ibn Usayd Al Thaqafy came to the Prophet (peace be upon him) believing and migrant during the period of the treaty, so Al Akhnas ibn Shurayk wrote to the Prophet (peace be upon him) asking him to turn Abu Basir in and mentioned the Hadith. See (4182).
Al Hafizh ibn Hajar explained in "Fathul-Bary" (351\5) the meaning of what Al Bukhari did. He said: "His saying: "`Aqil said from Az-Zuhry" which was mentioned in length in the first conditions. The compiler meant to explain the insertion in the narration of Mu`ammar. As for his saying: "we have been informed" is the saying of Az-Zuhry that Ibn Mardawayh reported in his Tafsir from the way of `Aqil. As for his saying: "We have been informed that Abu Basir…" Is the saying of Az-Zuhry too and the meaning is: The story of Abu Basir in the narration of `Aqil is from the Mursals of Az-Zuhry. It is also narrated connected to Al Miswar but he followed Mu`ammar in connecting the narration with Ibn Ishaq as above mentioned. Al Awza`y followed `Aqil in mentioning the narration although it is Mursal. Perhaps, Az-Zuhry mentioned the narration as Mursal once and another time he connects its chain of narration. Allah knows the best." See "Fathul-Bary" (455\7) too.
The summary of what has been mention above is: Nothing of the ways of this Hadith mentioned the death of Abu Basir whose name was: `Utbah ibn Usayd ibn Jariyah (may Allah be pleased with him) in Sayf Al Bahr or he has built a Masjid near his grave. It was narrated from weak narrations which Az-Zuhry reported and Musa ibn `Uqbah narrated them inclusively from Az-Zuhry: "Abu Jandal buried him in that place and built a Masjid near his grave." If this narration is authentically proven, there will be no proof because what is forbidden is to build Masjids on graves and not near graves.
Allah knows best!